[ 
https://issues.apache.org/jira/browse/FLINK-10005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16564894#comment-16564894
 ] 

ASF GitHub Bot commented on FLINK-10005:
----------------------------------------

zentol commented on a change in pull request #6466: [FLINK-10005][DataStream 
API] StreamingFileSink: sets initialPartCounter=maxUsed in new Buckets
URL: https://github.com/apache/flink/pull/6466#discussion_r206781260
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/functions/sink/filesystem/RollingPolicyTest.java
 ##########
 @@ -134,24 +137,67 @@ public void testRollOnCheckpointPolicy() throws 
Exception {
                        // we take a checkpoint so we roll.
                        testHarness.snapshot(1L, 1L);
 
+                       for (File file: FileUtils.listFiles(outDir, null, 
true)) {
+                               if 
(Objects.equals(file.getParentFile().getName(), "test1")) {
+                                       
Assert.assertTrue(file.getName().contains(".part-0-1.inprogress."));
+                               } else if 
(Objects.equals(file.getParentFile().getName(), "test2")) {
+                                       
Assert.assertTrue(file.getName().contains(".part-0-0.inprogress."));
+                               }
+                       }
+
                        // this will create a new part file
                        testHarness.processElement(new 
StreamRecord<>(Tuple2.of("test1", 4), 4L));
                        TestUtils.checkLocalFs(outDir, 3, 0);
 
+                       testHarness.notifyOfCompletedCheckpoint(1L);
+                       for (File file: FileUtils.listFiles(outDir, null, 
true)) {
+                               if 
(Objects.equals(file.getParentFile().getName(), "test1")) {
+                                       Assert.assertTrue(
+                                                       
file.getName().contains(".part-0-2.inprogress.") || 
file.getName().equals("part-0-1")
+                                       );
+                               } else if 
(Objects.equals(file.getParentFile().getName(), "test2")) {
+                                       Assert.assertEquals("part-0-0", 
file.getName());
+                               }
+                       }
+
                        // and open and fill .part-0-2.inprogress
                        testHarness.processElement(new 
StreamRecord<>(Tuple2.of("test1", 5), 5L));
                        testHarness.processElement(new 
StreamRecord<>(Tuple2.of("test1", 6), 6L));
-                       TestUtils.checkLocalFs(outDir, 3, 0);                   
 // nothing committed yet
+                       TestUtils.checkLocalFs(outDir, 1, 2);
 
                        // we take a checkpoint so we roll.
                        testHarness.snapshot(2L, 2L);
 
                        testHarness.processElement(new 
StreamRecord<>(Tuple2.of("test2", 7), 7L));
-                       TestUtils.checkLocalFs(outDir, 4, 0);
+                       TestUtils.checkLocalFs(outDir, 2, 2);
+
+                       for (File file: FileUtils.listFiles(outDir, null, 
true)) {
+                               if 
(Objects.equals(file.getParentFile().getName(), "test1")) {
+                                       Assert.assertTrue(
+                                                       
file.getName().contains(".part-0-2.inprogress.") || 
file.getName().equals("part-0-1")
 
 Review comment:
   you can create a better error message here using hamcrest.
   ```
   assertThat(
        file.getName(),
        either(containsString(".part-0-2.inprogress."))
                .or(equalTo("part-0-1")));
   ```

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


> StreamingFileSink ignores checkpoint/processing time rolling policies
> ---------------------------------------------------------------------
>
>                 Key: FLINK-10005
>                 URL: https://issues.apache.org/jira/browse/FLINK-10005
>             Project: Flink
>          Issue Type: Bug
>          Components: Streaming Connectors
>    Affects Versions: 1.6.0
>            Reporter: Chesnay Schepler
>            Assignee: Kostas Kloudas
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 1.6.0
>
>
> The {{StreamingFileSink}} supports different policies to determine whether a 
> new part file should be created; on each checkpoint, once a certain size is 
> reached or on processing time.
> This feature only works correctly for size thresholds, other policies are 
> ignored.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to