具有 azure-storage-api java 的 downloadAttributes 上不存在指定的 blob
The specified blob does not exist on downloadAttributes with azure-storage-api java
我们有一个应用程序,其中许多 (~1000) 个消费者尝试从 blob 存储中获取文件。没有对 blob 文件的并发访问,但它们共享单个存储帐户。我在 blob 存储上看到可用的文件,但我们经常看到以下异常
Caused by: com.microsoft.azure.storage.StorageException: The specified blob does not exist.
at com.microsoft.azure.storage.StorageException.translateFromHttpStatus(StorageException.java:207)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:172)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:306)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:177)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.blob.CloudBlob.downloadAttributes(CloudBlob.java:1268)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.blob.CloudBlob.downloadAttributes(CloudBlob.java:1235)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
我们正在使用
Azure-storage-api 1.1.0
这是已知错误或限制吗?
在什么情况下我们会得到这个异常?
我们使用以下代码下载 blob
String storageConnectionString = "DefaultEndpointsProtocol=http;AccountName="+ storageAccount + ";AccountKey=" + primaryAccessKey;
CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
CloudBlobClient blobClient = account.createCloudBlobClient();
CloudBlobContainer container = blobClient.getContainerReference(containerName.toLowerCase());
CloudBlockBlob blockBlob = container.getBlockBlobReference(fileName);
blockBlob.downloadAttributes();
//
int size = (int)blockBlob.getProperties().getLength();
out = new byte[size];
blockBlob.downloadToByteArray(out, 0);
什么是constantly
?是 always
,还是超过 X 个消费者试图获取 blob?
在 Scalability Targets for Azure Storage 上,您可以了解有关目标可伸缩性参数的更多信息。其中之一是单个 blob 的目标吞吐量:
Target throughput for single blob Up to 60 MB per second, or up to 500
requests per second
对于您的 1000 个使用者,毫无疑问您在查询同一个 blob 时达到了该限制。问题是 - 你真的需要从 blob 中获取如此强烈的信息吗,你可以在某个地方缓存(中间面)还是可以使用 CDN(它也适用于 SAS's )
如果 1000 个消费者击中 1000 个不同的 blob,则存在限制,例如:
Total Request Rate (assuming 1KB object size) per storage account Up to 20,000 IOPS, entities per second, or messages per
second
其中,对于 1000 个消费者,每秒发出 20 个请求 - 根据文件中的块数,也可能是该限制。
无论如何,您应该修改您的应用程序并发现您达到了哪个限制。
这只是为了让以后阅读此问题的人在扫描所有请求 url 以进行下载后清楚这一点。
有一堆不存在的 blob url 导致了这个异常。
我们有一个应用程序,其中许多 (~1000) 个消费者尝试从 blob 存储中获取文件。没有对 blob 文件的并发访问,但它们共享单个存储帐户。我在 blob 存储上看到可用的文件,但我们经常看到以下异常
Caused by: com.microsoft.azure.storage.StorageException: The specified blob does not exist.
at com.microsoft.azure.storage.StorageException.translateFromHttpStatus(StorageException.java:207)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:172)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:306)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:177)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.blob.CloudBlob.downloadAttributes(CloudBlob.java:1268)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
at com.microsoft.azure.storage.blob.CloudBlob.downloadAttributes(CloudBlob.java:1235)[3:org.ops4j.pax.logging.pax-logging-service:1.6.9]
我们正在使用
Azure-storage-api 1.1.0
这是已知错误或限制吗? 在什么情况下我们会得到这个异常?
我们使用以下代码下载 blob
String storageConnectionString = "DefaultEndpointsProtocol=http;AccountName="+ storageAccount + ";AccountKey=" + primaryAccessKey;
CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
CloudBlobClient blobClient = account.createCloudBlobClient();
CloudBlobContainer container = blobClient.getContainerReference(containerName.toLowerCase());
CloudBlockBlob blockBlob = container.getBlockBlobReference(fileName);
blockBlob.downloadAttributes();
//
int size = (int)blockBlob.getProperties().getLength();
out = new byte[size];
blockBlob.downloadToByteArray(out, 0);
什么是constantly
?是 always
,还是超过 X 个消费者试图获取 blob?
在 Scalability Targets for Azure Storage 上,您可以了解有关目标可伸缩性参数的更多信息。其中之一是单个 blob 的目标吞吐量:
Target throughput for single blob Up to 60 MB per second, or up to 500 requests per second
对于您的 1000 个使用者,毫无疑问您在查询同一个 blob 时达到了该限制。问题是 - 你真的需要从 blob 中获取如此强烈的信息吗,你可以在某个地方缓存(中间面)还是可以使用 CDN(它也适用于 SAS's )
如果 1000 个消费者击中 1000 个不同的 blob,则存在限制,例如:
Total Request Rate (assuming 1KB object size) per storage account Up to 20,000 IOPS, entities per second, or messages per second
其中,对于 1000 个消费者,每秒发出 20 个请求 - 根据文件中的块数,也可能是该限制。
无论如何,您应该修改您的应用程序并发现您达到了哪个限制。
这只是为了让以后阅读此问题的人在扫描所有请求 url 以进行下载后清楚这一点。
有一堆不存在的 blob url 导致了这个异常。