@Test public void testDownload() throws Exception { downloadBlob(blobId); assertEquals(1, azureMetrics.blobDownloadRequestCount.getCount()); assertEquals(1, azureMetrics.blobDownloadSuccessCount.getCount()); assertEquals(0, azureMetrics.blobDownloadErrorCount.getCount()); assertEquals(1, azureMetrics.blobDownloadTime.getCount()); }
public void downloadBlob(BlobId blobId, OutputStream outputStream) throws BlobStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { BlobLayout blobLayout = blobLayoutStrategy.getDataBlobLayout(blobId); downloadFile(blobLayout.containerName, blobLayout.blobFilePath, outputStream, true); azureMetrics.blobDownloadSuccessCount.inc(); } catch (Exception e) { azureMetrics.blobDownloadErrorCount.inc(); throw e; } finally { storageTimer.stop(); } }
AzureBlobDataAccessor { public void downloadBlob(BlobId blobId, OutputStream outputStream) throws BlobStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { BlobLayout blobLayout = blobLayoutStrategy.getDataBlobLayout(blobId); downloadFile(blobLayout.containerName, blobLayout.blobFilePath, outputStream, true); azureMetrics.blobDownloadSuccessCount.inc(); } catch (Exception e) { azureMetrics.blobDownloadErrorCount.inc(); throw e; } finally { storageTimer.stop(); } } }
AzureBlobDataAccessor { public void downloadBlob(BlobId blobId, OutputStream outputStream) throws BlobStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { BlobLayout blobLayout = blobLayoutStrategy.getDataBlobLayout(blobId); downloadFile(blobLayout.containerName, blobLayout.blobFilePath, outputStream, true); azureMetrics.blobDownloadSuccessCount.inc(); } catch (Exception e) { azureMetrics.blobDownloadErrorCount.inc(); throw e; } finally { storageTimer.stop(); } } AzureBlobDataAccessor(CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig,
      AzureBlobLayoutStrategy blobLayoutStrategy, AzureMetrics azureMetrics);   AzureBlobDataAccessor(BlobServiceClient storageClient, BlobBatchClient blobBatchClient, String clusterName,
      AzureMetrics azureMetrics); }
AzureBlobDataAccessor { public void downloadBlob(BlobId blobId, OutputStream outputStream) throws BlobStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { BlobLayout blobLayout = blobLayoutStrategy.getDataBlobLayout(blobId); downloadFile(blobLayout.containerName, blobLayout.blobFilePath, outputStream, true); azureMetrics.blobDownloadSuccessCount.inc(); } catch (Exception e) { azureMetrics.blobDownloadErrorCount.inc(); throw e; } finally { storageTimer.stop(); } } AzureBlobDataAccessor(CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig,
      AzureBlobLayoutStrategy blobLayoutStrategy, AzureMetrics azureMetrics);   AzureBlobDataAccessor(BlobServiceClient storageClient, BlobBatchClient blobBatchClient, String clusterName,
      AzureMetrics azureMetrics); BlobServiceClient getStorageClient(); boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata,
      InputStream blobInputStream); void uploadFile(String containerName, String fileName, InputStream inputStream); boolean downloadFile(String containerName, String fileName, OutputStream outputStream, boolean errorOnNotFound); void downloadBlob(BlobId blobId, OutputStream outputStream); CloudBlobMetadata getBlobMetadata(BlobId blobId); AzureCloudDestination.UpdateResponse updateBlobMetadata(BlobId blobId, Map<String, Object> updateFields,
      CloudUpdateValidator cloudUpdateValidator); List<CloudBlobMetadata> purgeBlobs(List<CloudBlobMetadata> blobMetadataList); }
AzureBlobDataAccessor { public void downloadBlob(BlobId blobId, OutputStream outputStream) throws BlobStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { BlobLayout blobLayout = blobLayoutStrategy.getDataBlobLayout(blobId); downloadFile(blobLayout.containerName, blobLayout.blobFilePath, outputStream, true); azureMetrics.blobDownloadSuccessCount.inc(); } catch (Exception e) { azureMetrics.blobDownloadErrorCount.inc(); throw e; } finally { storageTimer.stop(); } } AzureBlobDataAccessor(CloudConfig cloudConfig, AzureCloudConfig azureCloudConfig,
      AzureBlobLayoutStrategy blobLayoutStrategy, AzureMetrics azureMetrics);   AzureBlobDataAccessor(BlobServiceClient storageClient, BlobBatchClient blobBatchClient, String clusterName,
      AzureMetrics azureMetrics); BlobServiceClient getStorageClient(); boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata,
      InputStream blobInputStream); void uploadFile(String containerName, String fileName, InputStream inputStream); boolean downloadFile(String containerName, String fileName, OutputStream outputStream, boolean errorOnNotFound); void downloadBlob(BlobId blobId, OutputStream outputStream); CloudBlobMetadata getBlobMetadata(BlobId blobId); AzureCloudDestination.UpdateResponse updateBlobMetadata(BlobId blobId, Map<String, Object> updateFields,
      CloudUpdateValidator cloudUpdateValidator); List<CloudBlobMetadata> purgeBlobs(List<CloudBlobMetadata> blobMetadataList);  }