Class BucketLoaderJob
- java.lang.Object
-
- org.linuxforhealth.fhir.bucket.api.BucketLoaderJob
-
public class BucketLoaderJob extends java.lang.Object
Represents an allocated job to load a bundle
-
-
Constructor Summary
Constructors Constructor Description BucketLoaderJob(long resourceBundleLoadId, long resourceBundleId, java.lang.String bucketName, java.lang.String bucketPath, java.lang.String objectName, long objectSize, FileType ft, int version)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntry()
Increment the number of operations inflightvoid
addTotalResourceCount(int resources)
Increment the total number of resources that have been created when processing this jobvoid
fileProcessingComplete()
Called after the file has been read (but the job is not complete until the completedCount matches the itemCountjava.lang.String
getBucketName()
int
getCompletedCount()
How many rows have been completed so farint
getEntryCount()
int
getFailureCount()
How many rows have failedFileType
getFileType()
Get the type of file this object representslong
getLastCallResponseTime()
java.lang.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)long
getObjectSize()
long
getProcessingEndTime()
long
getProcessingStartTime()
long
getResourceBundleId()
long
getResourceBundleLoadId()
int
getTotalResourceCount()
int
getVersion()
void
operationComplete(boolean success)
Signal operation complete.void
registerCallback(java.util.function.Consumer<BucketLoaderJob> cb)
Register a Consumer to call back when the job is donevoid
setLastCallResponseTime(long lastCallResponseTime)
void
setProcessingStartTime(long processingStartTime)
java.lang.String
toString()
-
-
-
Constructor Detail
-
BucketLoaderJob
public BucketLoaderJob(long resourceBundleLoadId, long resourceBundleId, java.lang.String bucketName, java.lang.String bucketPath, java.lang.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(java.util.function.Consumer<BucketLoaderJob> cb)
Register a Consumer to call back when the job is done- Parameters:
cb
-
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getBucketName
public java.lang.String getBucketName()
-
getObjectKey
public java.lang.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
-
-