Class NoOpEnumerator

    • Constructor Detail

      • NoOpEnumerator

        public NoOpEnumerator()
    • Method Detail

      • handleSplitRequest

        public void handleSplitRequest​(int subtaskId,
                                       @Nullable
                                       String requesterHostname)
        Description copied from interface: SplitEnumerator
        Handles the request for a split. This method is called when the reader with the given subtask id calls the SourceReaderContext.sendSplitRequest() method.
        Specified by:
        handleSplitRequest in interface SplitEnumerator<FromElementsSplit,​NoOpEnumState>
        Parameters:
        subtaskId - the subtask id of the source reader who sent the source event.
        requesterHostname - Optional, the hostname where the requesting task is running. This can be used to make split assignments locality-aware.
      • addSplitsBack

        public void addSplitsBack​(List<FromElementsSplit> splits,
                                  int subtaskId)
        Description copied from interface: SplitEnumerator
        Add splits back to the split enumerator. This will only happen when a SourceReader fails and there are splits assigned to it after the last successful checkpoint.
        Specified by:
        addSplitsBack in interface SplitEnumerator<FromElementsSplit,​NoOpEnumState>
        Parameters:
        splits - The splits to add back to the enumerator for reassignment.
        subtaskId - The id of the subtask to which the returned splits belong.
      • snapshotState

        public NoOpEnumState snapshotState​(long checkpointId)
                                    throws Exception
        Description copied from interface: SplitEnumerator
        Creates a snapshot of the state of this split enumerator, to be stored in a checkpoint.

        The snapshot should contain the latest state of the enumerator: It should assume that all operations that happened before the snapshot have successfully completed. For example all splits assigned to readers via SplitEnumeratorContext.assignSplit(SourceSplit, int) and SplitEnumeratorContext.assignSplits(SplitsAssignment)) don't need to be included in the snapshot anymore.

        This method takes the ID of the checkpoint for which the state is snapshotted. Most implementations should be able to ignore this parameter, because for the contents of the snapshot, it doesn't matter for which checkpoint it gets created. This parameter can be interesting for source connectors with external systems where those systems are themselves aware of checkpoints; for example in cases where the enumerator notifies that system about a specific checkpoint being triggered.

        Specified by:
        snapshotState in interface SplitEnumerator<FromElementsSplit,​NoOpEnumState>
        Parameters:
        checkpointId - The ID of the checkpoint for which the snapshot is created.
        Returns:
        an object containing the state of the split enumerator.
        Throws:
        Exception - when the snapshot cannot be taken.