Class CollectingStatusListener

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getByteCount()
      Get the number of bytes already read.
      long getFileSize()
      Get the total size in bytes.
      long getRecordCount()
      Get the number of records already indexed.
      java.lang.Throwable getThrowable()
      Get the throwable that occurred while indexing.
      boolean isCompleted()
      Get the completion status.
      void onComplete()
      Called when the indexing finished successfully (without an exception).
      void onError​(java.lang.Throwable throwable)
      Called when there was an error while indexing.
      void onInit​(long fileSize)
      Called on initialization.
      void onReadBytes​(int bytes)
      Called when a new read operation has been performend.
      void onReadRecord()
      Called when a new record has been read.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • fileSize

        private volatile long fileSize
      • recordCount

        private final java.util.concurrent.atomic.AtomicLong recordCount
      • byteCount

        private final java.util.concurrent.atomic.AtomicLong byteCount
      • completionStatus

        private volatile boolean completionStatus
      • failedThrowable

        private volatile java.lang.Throwable failedThrowable
    • Constructor Detail

      • CollectingStatusListener

        public CollectingStatusListener()
        Default constructor.
    • Method Detail

      • onInit

        public void onInit​(long fileSize)
        Description copied from interface: StatusListener
        Called on initialization.
        Specified by:
        onInit in interface StatusListener
        Parameters:
        fileSize - the total file size.
      • getFileSize

        public long getFileSize()
        Get the total size in bytes.
        Returns:
        the total size in bytes
      • getRecordCount

        public long getRecordCount()
        Get the number of records already indexed.
        Returns:
        the number of records already indexed
      • onReadBytes

        public void onReadBytes​(int bytes)
        Description copied from interface: StatusListener
        Called when a new read operation has been performend.
        Specified by:
        onReadBytes in interface StatusListener
        Parameters:
        bytes - number of bytes read.
      • getByteCount

        public long getByteCount()
        Get the number of bytes already read.
        Returns:
        the number of bytes already read
      • onComplete

        public void onComplete()
        Description copied from interface: StatusListener
        Called when the indexing finished successfully (without an exception).
        Specified by:
        onComplete in interface StatusListener
      • isCompleted

        public boolean isCompleted()
        Get the completion status.
        Returns:
        true, when all data have been indexed successfully
      • onError

        public void onError​(java.lang.Throwable throwable)
        Description copied from interface: StatusListener
        Called when there was an error while indexing.
        Specified by:
        onError in interface StatusListener
        Parameters:
        throwable - the exception thrown.
      • getThrowable

        public java.lang.Throwable getThrowable()
        Get the throwable that occurred while indexing.
        Returns:
        the throwable that occurred while indexing, null otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object