Class AzureProvider
- java.lang.Object
 - 
- com.ibm.fhir.bulkdata.provider.impl.AzureProvider
 
 
- 
- All Implemented Interfaces:
 Provider
public class AzureProvider extends Object implements Provider
AzureProvider integrates the BulkData feature with Azure Blob Storage. The code uses the Blob Clients. $export: The AppendBlobClient is used during upload to append to an export file. $import: The BlobClient with BlobRange is used to retrieve windows of data. 
- 
- 
Constructor Summary
Constructors Constructor Description AzureProvider(String source)Configures the Azure based on the storageProvider source 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParseFailure(int idx)logs the parse failures.voidclose()voidcreateSource()creates the base output location for the type.longgetNumberOfLoaded()longgetNumberOfParseFailures()List<Resource>getResources()gets the read resources.longgetSize(String workItem)gets the size of the given work item.protected voidinitializeBlobClient(String workItem)initializes the blob clientvoidlistBlobsForContainer()lists the blobs on the container.booleanprocessLines(com.ibm.fhir.bulkdata.provider.impl.AzureProvider.CountInputStreamReader counter, BufferedReader reader, int window, boolean endOfFile, StringBuilder previous)processes the lines in the ndjson file.voidpushOperationOutcomes()Pushes the Operation OutcomesvoidreadResources(long numOfLinesToSkip, String workItem)reads from a given workitem (or file) in a source and skips a certain noumber of linesprotected voidregisterOverride(String connectionString, String container, ExportTransientUserData chunkData, String cosBucketPathPrefix, String fhirResourceType, long currentBytes)registers the overrides for testing.voidregisterTransient(long executionId, ExportTransientUserData transientUserData, String cosBucketPathPrefix, String fhirResourceType)voidregisterTransient(ImportTransientUserData transientUserData)voidwriteDirectly(String workItem, InputStream in, int size)writes directly to Azure using AppendBlock clientvoidwriteResources(String mediaType, List<ReadResultDTO> dtos)wraps the complexity of writing FHIR Resources out to a target 
 - 
 
- 
- 
Constructor Detail
- 
AzureProvider
public AzureProvider(String source)
Configures the Azure based on the storageProvider source- Parameters:
 source-
 
 - 
 
- 
Method Detail
- 
registerOverride
protected void registerOverride(String connectionString, String container, ExportTransientUserData chunkData, String cosBucketPathPrefix, String fhirResourceType, long currentBytes)
registers the overrides for testing.- Parameters:
 connectionString-container- the container (also known as a bucket)chunkData- the export datacosBucketPathPrefix- path prefixfhirResourceType- resource typecurrentBytes- the long value or location of the end of the last resource
 
- 
initializeBlobClient
protected void initializeBlobClient(String workItem)
initializes the blob client- Parameters:
 workItem-
 
- 
createSource
public void createSource() throws FHIRExceptionDescription copied from interface:Providercreates the base output location for the type.- Specified by:
 createSourcein interfaceProvider- Throws:
 FHIRException
 
- 
getSize
public long getSize(String workItem) throws FHIRException
Description copied from interface:Providergets the size of the given work item.- Specified by:
 getSizein interfaceProvider- Returns:
 - Throws:
 FHIRException
 
- 
listBlobsForContainer
public void listBlobsForContainer() throws FHIRExceptionlists the blobs on the container.- Throws:
 FHIRException
 
- 
writeDirectly
public void writeDirectly(String workItem, InputStream in, int size) throws Exception
writes directly to Azure using AppendBlock client- Parameters:
 workItem- the filein-size-- Throws:
 Exception
 
- 
writeResources
public void writeResources(String mediaType, List<ReadResultDTO> dtos) throws Exception
Description copied from interface:Providerwraps the complexity of writing FHIR Resources out to a target- Specified by:
 writeResourcesin interfaceProvider- Throws:
 Exception
 
- 
readResources
public void readResources(long numOfLinesToSkip, String workItem) throws FHIRExceptionDescription copied from interface:Providerreads from a given workitem (or file) in a source and skips a certain noumber of lines- Specified by:
 readResourcesin interfaceProvider- Throws:
 FHIRException
 
- 
processLines
public boolean processLines(com.ibm.fhir.bulkdata.provider.impl.AzureProvider.CountInputStreamReader counter, BufferedReader reader, int window, boolean endOfFile, StringBuilder previous) throws FHIRGeneratorException, IOExceptionprocesses the lines in the ndjson file.- Parameters:
 counter-reader-window-endOfFile-previous-- Returns:
 - Throws:
 FHIRGeneratorExceptionIOException
 
- 
addParseFailure
public void addParseFailure(int idx) throws FHIRGeneratorException, IOExceptionlogs the parse failures.- Parameters:
 idx-- Throws:
 FHIRGeneratorExceptionIOException
 
- 
pushOperationOutcomes
public void pushOperationOutcomes() throws FHIRExceptionDescription copied from interface:ProviderPushes the Operation Outcomes- Specified by:
 pushOperationOutcomesin interfaceProvider- Throws:
 FHIRException
 
- 
close
public void close() throws Exception 
- 
getResources
public List<Resource> getResources() throws FHIRException
Description copied from interface:Providergets the read resources.- Specified by:
 getResourcesin interfaceProvider- Returns:
 - Throws:
 FHIRException
 
- 
getNumberOfParseFailures
public long getNumberOfParseFailures() throws FHIRException- Specified by:
 getNumberOfParseFailuresin interfaceProvider- Throws:
 FHIRException
 
- 
getNumberOfLoaded
public long getNumberOfLoaded() throws FHIRException- Specified by:
 getNumberOfLoadedin interfaceProvider- Throws:
 FHIRException
 
- 
registerTransient
public void registerTransient(ImportTransientUserData transientUserData)
- Specified by:
 registerTransientin interfaceProvider
 
- 
registerTransient
public void registerTransient(long executionId, ExportTransientUserData transientUserData, String cosBucketPathPrefix, String fhirResourceType) throws Exception- Specified by:
 registerTransientin interfaceProvider- Throws:
 Exception
 
 - 
 
 -