Package com.ibm.fhir.bucket.api
Class BucketLoaderJob
- java.lang.Object
-
- com.ibm.fhir.bucket.api.BucketLoaderJob
-
public class BucketLoaderJob extends Object
Represents an allocated job to load a bundle
-
-
Constructor Summary
Constructors Constructor Description BucketLoaderJob(long resourceBundleLoadId, long resourceBundleId, String bucketName, String bucketPath, String objectName, long objectSize, FileType ft, int version)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntry()Increment the number of operations inflightvoidaddTotalResourceCount(int resources)Increment the total number of resources that have been created when processing this jobvoidfileProcessingComplete()Called after the file has been read (but the job is not complete until the completedCount matches the itemCountStringgetBucketName()intgetCompletedCount()How many rows have been completed so farintgetEntryCount()intgetFailureCount()How many rows have failedFileTypegetFileType()Get the type of file this object representslonggetLastCallResponseTime()StringgetObjectKey()Get the reconstituted object key which is a concatenation of the bucketPath and the objectName, with some special treatment of objects in the root location because we can't have an empty path (in the database)longgetObjectSize()longgetProcessingEndTime()longgetProcessingStartTime()longgetResourceBundleId()longgetResourceBundleLoadId()intgetTotalResourceCount()intgetVersion()voidoperationComplete(boolean success)Signal operation complete.voidregisterCallback(Consumer<BucketLoaderJob> cb)Register a Consumer to call back when the job is donevoidsetLastCallResponseTime(long lastCallResponseTime)voidsetProcessingStartTime(long processingStartTime)StringtoString()
-
-
-
Constructor Detail
-
BucketLoaderJob
public BucketLoaderJob(long resourceBundleLoadId, long resourceBundleId, String bucketName, String bucketPath, String objectName, long objectSize, FileType ft, int version)Public constructor- Parameters:
resourceBundleLoadId-resourceBundleId-bucketName-bucketPath-objectName-objectSize-ft-version-
-
-
Method Detail
-
registerCallback
public void registerCallback(Consumer<BucketLoaderJob> cb)
Register a Consumer to call back when the job is done- Parameters:
cb-
-
getBucketName
public String getBucketName()
-
getObjectKey
public String getObjectKey()
Get the reconstituted object key which is a concatenation of the bucketPath and the objectName, with some special treatment of objects in the root location because we can't have an empty path (in the database)- Returns:
-
getObjectSize
public long getObjectSize()
- Returns:
- the objectSize in bytes
-
getFileType
public FileType getFileType()
Get the type of file this object represents- Returns:
-
getResourceBundleId
public long getResourceBundleId()
- Returns:
- the resourceBundleId
-
addEntry
public void addEntry()
Increment the number of operations inflight
-
operationComplete
public void operationComplete(boolean success)
Signal operation complete.
-
fileProcessingComplete
public void fileProcessingComplete()
Called after the file has been read (but the job is not complete until the completedCount matches the itemCount
-
getFailureCount
public int getFailureCount()
How many rows have failed- Returns:
-
getCompletedCount
public int getCompletedCount()
How many rows have been completed so far- Returns:
-
getEntryCount
public int getEntryCount()
- Returns:
- the entryCount. This value is only meaningful after fileProcessingComplete(). If called before, the value may not representative of all the entries in the file
-
getResourceBundleLoadId
public long getResourceBundleLoadId()
- Returns:
- the resourceBundleLoadId
-
getVersion
public int getVersion()
- Returns:
- the version
-
getProcessingStartTime
public long getProcessingStartTime()
- Returns:
- the processingStartTime
-
setProcessingStartTime
public void setProcessingStartTime(long processingStartTime)
- Parameters:
processingStartTime- the processingStartTime to set
-
getProcessingEndTime
public long getProcessingEndTime()
- Returns:
- the processingEndTime
-
getLastCallResponseTime
public long getLastCallResponseTime()
- Returns:
- the lastCallResponseTime in milliseconds
-
setLastCallResponseTime
public void setLastCallResponseTime(long lastCallResponseTime)
- Parameters:
lastCallResponseTime- the lastCallResponseTime to set in milliseconds
-
addTotalResourceCount
public void addTotalResourceCount(int resources)
Increment the total number of resources that have been created when processing this job- Parameters:
resources-
-
getTotalResourceCount
public int getTotalResourceCount()
- Returns:
- the totalResourceCount
-
-