flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #2707: [FLINK-4939] GenericWriteAheadSink: Decouple the c...
Date Wed, 02 Nov 2016 10:35:03 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2707#discussion_r86108131
  
    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java
---
    @@ -77,63 +86,96 @@ public GenericWriteAheadSink(CheckpointCommitter committer, TypeSerializer<IN>
s
     	public void open() throws Exception {
     		super.open();
     		committer.setOperatorId(id);
    -		committer.setOperatorSubtaskId(getRuntimeContext().getIndexOfThisSubtask());
     		committer.open();
    -		cleanState();
    -		checkpointStreamFactory =
    -				getContainingTask().createCheckpointStreamFactory(this);
    +
    +		checkpointStreamFactory = getContainingTask()
    +			.createCheckpointStreamFactory(this);
    +
    +		cleanRestoredHandles();
     	}
     
     	public void close() throws Exception {
     		committer.close();
     	}
     
     	/**
    -	 * Saves a handle in the state.
    +	 * Called when a checkpoint barrier arrives.
    +	 * Closes any open streams to the backend and marks them as pending for
    +	 * committing to the final output system, e.g. Cassandra.
     	 *
    -	 * @param checkpointId
    -	 * @throws IOException
    +	 * @param checkpointId the id of the latest received checkpoint.
    +	 * @throws IOException in case something went wrong when handling the stream to the
backend.
     	 */
     	private void saveHandleInState(final long checkpointId, final long timestamp) throws
Exception {
    +		Preconditions.checkNotNull(this.pendingHandles, "The operator has not been properly
initialized.");
    --- End diff --
    
    this seems unnecessary.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message