flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] zentol commented on a change in pull request #6477: [FLINK-10027] Add logging to StreamingFileSink
Date Thu, 02 Aug 2018 13:37:24 GMT
zentol commented on a change in pull request #6477: [FLINK-10027] Add logging to StreamingFileSink
URL: https://github.com/apache/flink/pull/6477#discussion_r207213170
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Bucket.java
 ##########
 @@ -53,175 +53,234 @@
 
 	private final RecoverableWriter fsWriter;
 
-	private final Map<Long, List<RecoverableWriter.CommitRecoverable>> pendingPerCheckpoint
= new HashMap<>();
+	private final RollingPolicy<IN, BucketID> rollingPolicy;
 
-	private long partCounter;
-
-	private PartFileWriter<IN, BucketID> currentPart;
-
-	private List<RecoverableWriter.CommitRecoverable> pending;
-
-	/**
-	 * Constructor to restore a bucket from checkpointed state.
-	 */
-	public Bucket(
-			RecoverableWriter fsWriter,
-			int subtaskIndex,
-			long initialPartCounter,
-			PartFileWriter.PartFileFactory<IN, BucketID> partFileFactory,
-			BucketState<BucketID> bucketState) throws IOException {
+	private final Map<Long, List<RecoverableWriter.CommitRecoverable>> pendingPartsPerCheckpoint
= new HashMap<>();
 
-		this(fsWriter, subtaskIndex, bucketState.getBucketId(), bucketState.getBucketPath(), initialPartCounter,
partFileFactory);
-
-		// the constructor must have already initialized the filesystem writer
-		Preconditions.checkState(fsWriter != null);
-
-		// we try to resume the previous in-progress file, if the filesystem
-		// supports such operation. If not, we just commit the file and start fresh.
+	private long partCounter;
 
-		final RecoverableWriter.ResumeRecoverable resumable = bucketState.getInProgress();
-		if (resumable != null) {
-			currentPart = partFileFactory.resumeFrom(
-					bucketId, fsWriter, resumable, bucketState.getCreationTime());
-		}
+	private PartFileWriter<IN, BucketID> inProgressPart;
 
-		// we commit pending files for previous checkpoints to the last successful one
 
 Review comment:
   we could keep this comment

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message