Class AbstractStreamingWriter<IN,​OUT>

    • Field Detail

      • currentWatermark

        protected transient long currentWatermark
    • Method Detail

      • partitionCreated

        protected abstract void partitionCreated​(String partition)
        Notifies a partition created.
      • partitionInactive

        protected abstract void partitionInactive​(String partition)
        Notifies a partition become inactive. A partition becomes inactive after all the records received so far have been committed.
      • onPartFileOpened

        protected abstract void onPartFileOpened​(String partition,
                                                 Path newPath)
        Notifies a new file has been opened.

        Note that this does not mean that the file has been created in the file system. It is only created logically and the actual file will be generated after it is committed.

      • commitUpToCheckpoint

        protected void commitUpToCheckpoint​(long checkpointId)
                                     throws Exception
        Commit up to this checkpoint id.
        Throws:
        Exception
      • notifyCheckpointComplete

        public void notifyCheckpointComplete​(long checkpointId)
                                      throws Exception
        Description copied from interface: CheckpointListener
        Notifies the listener that the checkpoint with the given checkpointId completed and was committed.

        These notifications are "best effort", meaning they can sometimes be skipped. To behave properly, implementers need to follow the "Checkpoint Subsuming Contract". Please see the class-level JavaDocs for details.

        Please note that checkpoints may generally overlap, so you cannot assume that the notifyCheckpointComplete() call is always for the latest prior checkpoint (or snapshot) that was taken on the function/operator implementing this interface. It might be for a checkpoint that was triggered earlier. Implementing the "Checkpoint Subsuming Contract" (see above) properly handles this situation correctly as well.

        Please note that throwing exceptions from this method will not cause the completed checkpoint to be revoked. Throwing exceptions will typically cause task/job failure and trigger recovery.

        Specified by:
        notifyCheckpointComplete in interface CheckpointListener
        Overrides:
        notifyCheckpointComplete in class AbstractStreamOperator<OUT>
        Parameters:
        checkpointId - The ID of the checkpoint that has been completed.
        Throws:
        Exception - This method can propagate exceptions, which leads to a failure/recovery for the task. Note that this will NOT lead to the checkpoint being revoked.
      • close

        public void close()
                   throws Exception
        Description copied from interface: StreamOperator
        This method is called at the very end of the operator's life, both in the case of a successful completion of the operation, and in the case of a failure and canceling.

        This method is expected to make a thorough effort to release all resources that the operator has acquired.

        NOTE:It can not emit any records! If you need to emit records at the end of processing, do so in the StreamOperator.finish() method.

        Specified by:
        close in interface StreamOperator<IN>
        Overrides:
        close in class AbstractStreamOperator<OUT>
        Throws:
        Exception