Class BucketLoaderJob


  • public class BucketLoaderJob
    extends Object
    Represents an allocated job to load a bundle
    • 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