Class IncrementalSnapshotContext<T>


  • @NotThreadSafe
    public class IncrementalSnapshotContext<T>
    extends Object
    A class describing current state of incremental snapshot
    Author:
    Jiri Pechanec
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • windowOpened

        private boolean windowOpened
      • chunkEndPosition

        private Object[] chunkEndPosition
        The last primary key in chunk that is now in process.
      • dataCollectionsToSnapshot

        private final Queue<T> dataCollectionsToSnapshot
      • useCatalogBeforeSchema

        private final boolean useCatalogBeforeSchema
      • lastEventKeySent

        private Object[] lastEventKeySent
        The PK of the last record that was passed to Kafka Connect. In case of connector restart the start of the first chunk will be populated from it.
      • currentChunkId

        private String currentChunkId
      • maximumKey

        private Object[] maximumKey
        The largest PK in the table at the start of snapshot.
    • Constructor Detail

      • IncrementalSnapshotContext

        public IncrementalSnapshotContext()
      • IncrementalSnapshotContext

        public IncrementalSnapshotContext​(boolean useCatalogBeforeSchema)
    • Method Detail

      • openWindow

        public boolean openWindow​(String id)
      • closeWindow

        public boolean closeWindow​(String id)
      • deduplicationNeeded

        public boolean deduplicationNeeded()
      • arrayToSerializedString

        private String arrayToSerializedString​(Object[] array)
      • serializedStringToArray

        private Object[] serializedStringToArray​(String field,
                                                 String serialized)
      • dataCollectionsToSnapshotAsString

        private String dataCollectionsToSnapshotAsString()
      • stringToDataCollections

        private List<String> stringToDataCollections​(String dataCollectionsStr)
      • snapshotRunning

        protected boolean snapshotRunning()
      • addTablesIdsToSnapshot

        private void addTablesIdsToSnapshot​(List<T> dataCollectionIds)
      • addDataCollectionNamesToSnapshot

        public List<T> addDataCollectionNamesToSnapshot​(List<String> dataCollectionIds)
      • sendEvent

        public void sendEvent​(Object[] key)
      • currentDataCollectionId

        public T currentDataCollectionId()
      • tablesToBeSnapshottedCount

        public int tablesToBeSnapshottedCount()
      • nextChunkPosition

        public void nextChunkPosition​(Object[] end)
      • chunkEndPosititon

        public Object[] chunkEndPosititon()
      • resetChunk

        private void resetChunk()
      • isNonInitialChunk

        public boolean isNonInitialChunk()
      • nextDataCollection

        public T nextDataCollection()
      • startNewChunk

        public void startNewChunk()
      • currentChunkId

        public String currentChunkId()
      • maximumKey

        public void maximumKey​(Object[] key)