azagrebin 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_r246443897
 
 

 ##########
 File path: 
flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBStateDataTransferTest.java
 ##########
 @@ -138,6 +149,133 @@ public void testMultiThreadRestoreCorrectly() throws 
Exception {
                }
        }
 
+       /**
+        * Test that the exception arose in the thread pool will rethrow to the 
main thread.
+        */
+       @Test
+       public void testMultiThreadUploadThreadPoolExceptionRethrow() throws 
IOException {
+               SpecifiedException expectedException = new 
SpecifiedException("throw exception while multi thread upload states.");
+
+               CheckpointStateOutputStream outputStream = 
createFailingCheckpointStateOutputStream(expectedException);
+               CheckpointStreamFactory checkpointStreamFactory = 
(CheckpointedStateScope scope) -> outputStream;
+
+               File file = 
temporaryFolder.newFile(String.valueOf(UUID.randomUUID()));
+               generateRandomFileContent(file.getPath(), 20);
+
+               Map<StateHandleID, Path> filePaths = new HashMap<>(1);
+               filePaths.put(new StateHandleID("mockHandleID"), new 
Path(file.getPath()));
+               try {
+                       RocksDbStateDataTransfer.uploadFilesToCheckpointFs(
+                               filePaths,
+                               5,
+                               checkpointStreamFactory,
+                               new CloseableRegistry());
+                       fail();
+               } catch (Exception e) {
+                       assertEquals(expectedException, e);
+               }
+       }
+
+       /**
+        * Test that upload files with multi-thread correctly.
+        */
+       @Test
+       public void testMultiThreadUploadCorrectly() throws Exception {
+
 
 Review comment:
   could you remove this new line?

----------------------------------------------------------------
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