Class FileOffsetWriter

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • snapshotProps

        private final Properties snapshotProps
      • commitLogProps

        private final Properties commitLogProps
      • offsetDir

        private final File offsetDir
      • snapshotOffsetFile

        private final File snapshotOffsetFile
      • commitLogOffsetFile

        private final File commitLogOffsetFile
      • snapshotOffsetFileLock

        private final FileLock snapshotOffsetFileLock
      • commitLogOffsetFileLock

        private final FileLock commitLogOffsetFileLock
    • Method Detail

      • markOffset

        public void markOffset​(String sourceTable,
                               String sourceOffset,
                               boolean isSnapshot)
        Description copied from interface: OffsetWriter
        Update the offset in memory if the provided offset is greater than the existing offset.
        Specified by:
        markOffset in interface OffsetWriter
        Parameters:
        sourceTable - string in the format of ..
        sourceOffset - string in the format of :
        isSnapshot - whether the offset is coming from a snapshot or commit log
        • isOffsetProcessed

          public boolean isOffsetProcessed​(String sourceTable,
                                           String sourceOffset,
                                           boolean isSnapshot)
          Description copied from interface: OffsetWriter
          Determine if an offset has been processed based on the table name, offset position, and whether it is from snapshot or not.
          Specified by:
          isOffsetProcessed in interface OffsetWriter
          Parameters:
          sourceTable - string in the format of .
        .
        sourceOffset - string in the format of :
        isSnapshot - whether the offset is coming from a snapshot or commit log
        Returns:
        true if the offset has been processed, false otherwise.
        • flush

          public void flush()
          Description copied from interface: OffsetWriter
          Flush latest offsets to disk.
          Specified by:
          flush in interface OffsetWriter
        • close

          public void close()
          Description copied from interface: OffsetWriter
          Close all resources used by this class.
          Specified by:
          close in interface OffsetWriter