azagrebin commented on a change in pull request #6777: [FLINK-10461] [State 
Backends, Checkpointing] Speed up download files when restore from DFS
URL: https://github.com/apache/flink/pull/6777#discussion_r236198988
 
 

 ##########
 File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java
 ##########
 @@ -236,8 +239,25 @@ public RocksDBStateBackend(StateBackend 
checkpointStreamBackend) {
         * @param enableIncrementalCheckpointing True if incremental 
checkpointing is enabled.
         */
        public RocksDBStateBackend(StateBackend checkpointStreamBackend, 
TernaryBoolean enableIncrementalCheckpointing) {
+               this(checkpointStreamBackend, enableIncrementalCheckpointing, 
CheckpointingOptions.CHECKPOINT_RESTORE_THREAD_NUM.defaultValue());
+       }
+
+       /**
+        * Creates a new {@code RocksDBStateBackend} that uses the given state 
backend to store its
+        * checkpoint data streams. Typically, one would supply a filesystem or 
database state backend
+        * here where the snapshots from RocksDB would be stored.
+        *
+        * <p>The snapshots of the RocksDB state will be stored using the given 
backend's
+        * {@link StateBackend#createCheckpointStorage(JobID)}.
+        *
+        * @param checkpointStreamBackend The backend write the checkpoint 
streams to.
+        * @param enableIncrementalCheckpointing True if incremental 
checkpointing is enabled.
+        * @param restoredThreadNum thread num used to download files from DFS 
when restore.
+        */
+       public RocksDBStateBackend(StateBackend checkpointStreamBackend, 
TernaryBoolean enableIncrementalCheckpointing, int restoredThreadNum) {
                this.checkpointStreamBackend = 
checkNotNull(checkpointStreamBackend);
                this.enableIncrementalCheckpointing = 
enableIncrementalCheckpointing;
+               this.restoredThreadNum = restoredThreadNum;
 
 Review comment:
   Actually, instead of changing and exploding the constructor signatures, I 
would suggest to set it here to -1 (undefined). Then we could remove `final` 
from `restoredThreadNum` and add setter method for it, like for 
`predefinedOptions`. Users could use the setter to set this option per job.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to