klion26 commented on a change in pull request #7351: [FLINK-11008][State Backends, Checkpointing]SpeedUp upload state files using multithread URL: https://github.com/apache/flink/pull/7351#discussion_r244333053
########## File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDbStateDataTransfer.java ########## @@ -61,6 +74,144 @@ static void transferAllStateDataToDirectory( downloadDataForAllStateHandles(miscFiles, dest, restoringThreadNum, closeableRegistry); } + public static void uploadStateFiles( + CheckpointStreamFactory checkpointStreamFactory, + SnapshotDirectory localBackupDirectory, + Set<StateHandleID> baseSstFiles, + int uploadingThreadNum, + CloseableRegistry snapshotCloseableRegistry, + @Nonnull ConcurrentHashMap<StateHandleID, StreamStateHandle> sstFiles, + @Nonnull ConcurrentHashMap<StateHandleID, StreamStateHandle> miscFiles) throws Exception { + + Preconditions.checkState(localBackupDirectory.exists()); + + FileStatus[] fileStatuses = localBackupDirectory.listStatus(); + if (fileStatuses != null) { + ExecutorService executorService = createExecutorService(uploadingThreadNum); + + try { + List<Runnable> runnables = createUploadRunnables( Review comment: @azagrebin thank you for your reply, I'll update the code according to your suggestions. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services