You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/10/22 09:10:58 UTC

[GitHub] [flink] JingsongLi opened a new pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

JingsongLi opened a new pull request #13744:
URL: https://github.com/apache/flink/pull/13744


   
   ## What is the purpose of the change & Brief change log
   
   ### Introduce Compaction operators:
     The compaction operator graph is:
     TempFileWriter|parallel ---(InputFile&EndInputFile)---> CompactCoordinator|non-parallel
     ---(CompactionUnit&EndCompaction)--->CompactOperator|parallel---(PartitionCommitInfo)--->
     PartitionCommitter|non-parallel
    
     Because the end message is a kind of barrier of record messages, they can only be transmitted
     in the way of full broadcast in the link from coordinator to compact operator.
   
   ### Introduce CompactCoordinator
    This is the single (non-parallel) monitoring task which coordinate input files to compaction units.
    - Receives in-flight input files inside checkpoint.
    - Receives all upstream end input messages after the checkpoint completes successfully,
      starts coordination.
   
    NOTE: The coordination is a stable algorithm, which can ensure that the downstream can
   perform compaction at any time without worrying about fail over.
   
    STATE: This operator stores input files in state, after the checkpoint completes successfully,
   input files are taken out from the state for coordination.
   
   ### Introduce CompactOperator
    Receives compaction units to do compaction. Send partition commit information after
    compaction finished.
   
    Use BulkFormat to read and use BucketWriter to write.
   
   STATE: This operator stores expired files in state, after the checkpoint completes successfully,
   We can ensure that these files will not be used again and they can be deleted from the
    file system.
   
   ## Verifying this change
   
   - `CompactOperatorsTest`
   - `BinPackingTest`
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented? JavaDocs
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] lirui-apache commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512513851



##########
File path: flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactOperatorTest.java
##########
@@ -105,8 +105,63 @@ public void testCompactOperator() throws Exception {
 		});
 	}
 
+	@Test
+	public void testUnitSelection() throws Exception {
+		OneInputStreamOperatorTestHarness<CoordinatorOutput, PartitionCommitInfo> harness0 = create(2, 0);
+		harness0.setup();
+		harness0.open();
+
+		OneInputStreamOperatorTestHarness<CoordinatorOutput, PartitionCommitInfo> harness1 = create(2, 1);
+		harness1.setup();
+		harness1.open();
+
+		Path f0 = newFile(".uncompacted-f0", 3);
+		Path f1 = newFile(".uncompacted-f1", 2);
+		Path f2 = newFile(".uncompacted-f2", 2);
+		Path f3 = newFile(".uncompacted-f3", 5);
+		Path f4 = newFile(".uncompacted-f4", 1);
+		Path f5 = newFile(".uncompacted-f5", 5);
+		Path f6 = newFile(".uncompacted-f6", 4);
+		FileSystem fs = f0.getFileSystem();
+
+		// broadcast
+		harness0.processElement(new CompactionUnit(0, "p0", Arrays.asList(f0, f1, f4)), 0);
+		harness0.processElement(new CompactionUnit(1, "p0", Collections.singletonList(f3)), 0);
+		harness0.processElement(new CompactionUnit(2, "p0", Arrays.asList(f2, f5)), 0);
+		harness0.processElement(new CompactionUnit(3, "p0", Collections.singletonList(f6)), 0);
+
+		harness1.processElement(new CompactionUnit(0, "p0", Arrays.asList(f0, f1, f4)), 0);
+		harness1.processElement(new CompactionUnit(1, "p0", Collections.singletonList(f3)), 0);
+		harness1.processElement(new CompactionUnit(2, "p0", Arrays.asList(f2, f5)), 0);
+		harness1.processElement(new CompactionUnit(3, "p0", Collections.singletonList(f6)), 0);
+
+		harness0.processElement(new EndCompaction(1), 0);
+
+		// check all compacted file generated
+		Assert.assertTrue(fs.exists(new Path(folder, "compacted-f0")));
+		Assert.assertTrue(fs.exists(new Path(folder, "compacted-f2")));

Review comment:
       Also verify `f3` and `f6` are not compacted at this point.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     }, {
       "hash" : "039f49ada096d2f85fc6908618f77c8483a446fb",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8550",
       "triggerID" : "039f49ada096d2f85fc6908618f77c8483a446fb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 039f49ada096d2f85fc6908618f77c8483a446fb Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8550) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot commented on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 73d36420f9e131efb1ba70053b5ef315f79afd68 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] JingsongLi commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512392582



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactMessages.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Util class for all compaction messages.
+ *
+ * <p>The compaction operator graph is:
+ * TempFileWriter|parallel ---(InputFile&EndInputFile)---> CompactCoordinator|non-parallel
+ * ---(CompactionUnit&EndCompaction)--->CompactOperator|parallel---(PartitionCommitInfo)--->
+ * PartitionCommitter|non-parallel
+ *
+ * <p>Because the end message is a kind of barrier of record messages, they can only be transmitted
+ * in the way of full broadcast in the link from coordinator to compact operator.
+ */
+public class CompactMessages {
+	private CompactMessages() {}
+
+	/**
+	 * The input of compact coordinator.
+	 */
+	public interface CoordinatorInput extends Serializable {}
+
+	/**
+	 * A partitioned input file.
+	 */
+	public static class InputFile implements CoordinatorInput {
+		private final String partition;
+		private final Path file;
+
+		public InputFile(String partition, Path file) {
+			this.partition = partition;
+			this.file = file;
+		}
+
+		public String getPartition() {
+			return partition;
+		}
+
+		public Path getFile() {
+			return file;
+		}
+	}
+
+	/**
+	 * A flag to end file input.
+	 */
+	public static class EndInputFile implements CoordinatorInput {
+		private final long checkpointId;
+		private final int taskId;
+		private final int numberOfTasks;
+
+		public EndInputFile(long checkpointId, int taskId, int numberOfTasks) {
+			this.checkpointId = checkpointId;
+			this.taskId = taskId;
+			this.numberOfTasks = numberOfTasks;
+		}
+
+		public long getCheckpointId() {
+			return checkpointId;
+		}
+
+		public int getTaskId() {
+			return taskId;
+		}
+
+		public int getNumberOfTasks() {
+			return numberOfTasks;
+		}
+	}
+
+	/**
+	 * The output of compact coordinator.
+	 */
+	public interface CoordinatorOutput extends Serializable {}
+
+	/**
+	 * The unit of a single compaction.
+	 */
+	public static class CompactionUnit implements CoordinatorOutput {
+
+		private final int unitId;
+		private final String partition;
+
+		// Store strings to improve serialization performance.
+		private final String[] pathStrings;
+
+		public CompactionUnit(int unitId, String partition, List<Path> unit) {
+			this.unitId = unitId;
+			this.partition = partition;
+			this.pathStrings = unit.stream()
+					.map(Path::toUri)
+					.map(URI::toString)
+					.toArray(String[]::new);
+		}
+
+		public boolean isTaskMessage(int taskId) {

Review comment:
       Good catch, there is a bug here, should be:
   ```
   public boolean isTaskMessage(int taskNumber, int taskId) {
       return unitId % taskNumber == taskId;
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4d7e601658c0dacc100c572f4fe8878c058e035f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c51d4e8bf5dba50e4cb501fc04a87c924fe27e36 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390) 
   * b4cbace2b682490ac53a4a8cb4438f2361f3cffd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] JingsongLi commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512435964



##########
File path: flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactCoordinatorTest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorInput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndInputFile;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.InputFile;
+import org.apache.flink.util.function.ThrowingConsumer;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * Test for {@link CompactCoordinator}.
+ */
+public class CompactCoordinatorTest extends AbstractCompactTestBase {
+
+	@Test
+	public void testCoordinatorCrossCheckpoints() throws Exception {
+		AtomicReference<OperatorSubtaskState> state = new AtomicReference<>();
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f0", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f1", 2)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f2", 2)), 0);
+
+			harness.processElement(new InputFile("p0", newFile("f3", 5)), 0);
+			harness.processElement(new InputFile("p0", newFile("f4", 1)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f5", 5)), 0);
+			harness.processElement(new InputFile("p1", newFile("f6", 4)), 0);
+
+			state.set(harness.snapshot(1, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f7", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f8", 2)), 0);
+
+			state.set(harness.snapshot(2, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new EndInputFile(2, 0, 1), 0);
+
+			List<CoordinatorOutput> outputs = harness.extractOutputValues();
+
+			Assert.assertEquals(7, outputs.size());
+
+			assertUnit(outputs.get(0), 0, "p0", Arrays.asList("f0", "f1", "f4"));

Review comment:
       OK, I'll do it




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 22d42a57852d0a240e2abb6bf1a4c2ade682601f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344) 
   * 244b9004c862573b63e7da7f4226ce5da987edc5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a01ecf0bade9f8e4a56052fb5b5d25c5034fe511 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] JingsongLi commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512378183



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactOperator.java
##########
@@ -0,0 +1,276 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.api.common.state.ListState;
+import org.apache.flink.api.common.state.ListStateDescriptor;
+import org.apache.flink.api.common.typeutils.base.ListSerializer;
+import org.apache.flink.api.common.typeutils.base.LongSerializer;
+import org.apache.flink.api.common.typeutils.base.MapSerializer;
+import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.connector.file.src.reader.BulkFormat;
+import org.apache.flink.core.fs.FSDataInputStream;
+import org.apache.flink.core.fs.FileSystem;
+import org.apache.flink.core.fs.FileSystemKind;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.core.fs.RecoverableFsDataOutputStream;
+import org.apache.flink.core.fs.RecoverableWriter;
+import org.apache.flink.runtime.state.StateInitializationContext;
+import org.apache.flink.runtime.state.StateSnapshotContext;
+import org.apache.flink.streaming.api.functions.sink.filesystem.BucketWriter;
+import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
+import org.apache.flink.streaming.api.operators.BoundedOneInput;
+import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.filesystem.stream.PartitionCommitInfo;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.util.IOUtils;
+import org.apache.flink.util.Preconditions;
+import org.apache.flink.util.function.SupplierWithException;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * Receives compaction units to do compaction. Send partition commit information after
+ * compaction finished.
+ *
+ * <p>Use {@link BulkFormat} to read and use {@link BucketWriter} to write.
+ *
+ * <p>STATE: This operator stores expired files in state, after the checkpoint completes successfully,
+ *           We can ensure that these files will not be used again and they can be deleted from the
+ *           file system.
+ */
+public class CompactOperator<T> extends AbstractStreamOperator<PartitionCommitInfo>
+		implements OneInputStreamOperator<CoordinatorOutput, PartitionCommitInfo>, BoundedOneInput {
+
+	private static final long serialVersionUID = 1L;
+
+	private static final String UNCOMPACTED_PREFIX = ".uncompacted-";
+
+	private static final String COMPACTED_PREFIX = "compacted-";
+
+	private final SupplierWithException<FileSystem, IOException> fsFactory;
+	private final CompactReader.Factory<T> readerFactory;
+	private final CompactWriter.Factory<T> writerFactory;
+
+	private transient FileSystem fileSystem;
+
+	private transient ListState<Map<Long, List<Path>>> expiredFilesState;
+	private transient TreeMap<Long, List<Path>> expiredFiles;
+	private transient List<Path> currentExpiredFiles;
+
+	private transient Set<String> partitions;
+
+	public CompactOperator(
+			SupplierWithException<FileSystem, IOException> fsFactory,
+			CompactReader.Factory<T> readerFactory,
+			CompactWriter.Factory<T> writerFactory) {
+		this.fsFactory = fsFactory;
+		this.readerFactory = readerFactory;
+		this.writerFactory = writerFactory;
+	}
+
+	@Override
+	public void initializeState(StateInitializationContext context) throws Exception {
+		super.initializeState(context);
+		this.partitions = new HashSet<>();
+		this.fileSystem = fsFactory.get();
+
+		ListStateDescriptor<Map<Long, List<Path>>> metaDescriptor =
+				new ListStateDescriptor<>("expired-files", new MapSerializer<>(
+						LongSerializer.INSTANCE,
+						new ListSerializer<>(new KryoSerializer<>(Path.class, getExecutionConfig()))
+				));
+		this.expiredFilesState = context.getOperatorStateStore().getListState(metaDescriptor);
+		this.expiredFiles = new TreeMap<>();
+		this.currentExpiredFiles = new ArrayList<>();
+
+		if (context.isRestored()) {
+			this.expiredFiles.putAll(this.expiredFilesState.get().iterator().next());
+		}
+	}
+
+	@Override
+	public void processElement(StreamRecord<CoordinatorOutput> element) throws Exception {
+		CoordinatorOutput value = element.getValue();
+		if (value instanceof CompactionUnit) {
+			CompactionUnit unit = (CompactionUnit) value;
+			if (unit.isTaskMessage(getRuntimeContext().getNumberOfParallelSubtasks())) {
+				String partition = unit.getPartition();
+				List<Path> paths = unit.getPaths();
+
+				doCompact(paths);
+				this.partitions.add(partition);
+
+				// Only after the current checkpoint is successfully executed can delete
+				// the expired files, so as to ensure the existence of the files.
+				this.currentExpiredFiles.addAll(paths);
+			}
+		} else if (value instanceof EndCompaction) {
+			endCompaction(((EndCompaction) value).getCheckpointId());
+		}
+	}
+
+	private void endCompaction(long checkpoint) {
+		this.output.collect(new StreamRecord<>(new PartitionCommitInfo(
+				checkpoint,
+				getRuntimeContext().getIndexOfThisSubtask(),
+				getRuntimeContext().getNumberOfParallelSubtasks(),
+				new ArrayList<>(this.partitions))));
+		this.partitions.clear();
+	}
+
+	@Override
+	public void snapshotState(StateSnapshotContext context) throws Exception {
+		super.snapshotState(context);
+
+		expiredFilesState.clear();
+		expiredFiles.put(context.getCheckpointId(), new ArrayList<>(currentExpiredFiles));
+		expiredFilesState.add(expiredFiles);
+		currentExpiredFiles.clear();
+	}
+
+	@Override
+	public void notifyCheckpointComplete(long checkpointId) throws Exception {

Review comment:
       No, then will wait for next checkpoint notify.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] lirui-apache commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512388323



##########
File path: flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactCoordinatorTest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorInput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndInputFile;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.InputFile;
+import org.apache.flink.util.function.ThrowingConsumer;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * Test for {@link CompactCoordinator}.
+ */
+public class CompactCoordinatorTest extends AbstractCompactTestBase {
+
+	@Test
+	public void testCoordinatorCrossCheckpoints() throws Exception {
+		AtomicReference<OperatorSubtaskState> state = new AtomicReference<>();
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f0", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f1", 2)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f2", 2)), 0);
+
+			harness.processElement(new InputFile("p0", newFile("f3", 5)), 0);
+			harness.processElement(new InputFile("p0", newFile("f4", 1)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f5", 5)), 0);
+			harness.processElement(new InputFile("p1", newFile("f6", 4)), 0);
+
+			state.set(harness.snapshot(1, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f7", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f8", 2)), 0);
+
+			state.set(harness.snapshot(2, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new EndInputFile(2, 0, 1), 0);
+
+			List<CoordinatorOutput> outputs = harness.extractOutputValues();
+
+			Assert.assertEquals(7, outputs.size());
+
+			assertUnit(outputs.get(0), 0, "p0", Arrays.asList("f0", "f1", "f4"));

Review comment:
       Yeah... but then how could we assert the first output is for `p0`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 164c8b5b7750ed567813d70f160ef9f064d0a3b0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d257594ae6a62374f9727f97dad3254ea7c25ef2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 164c8b5b7750ed567813d70f160ef9f064d0a3b0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458) 
   * 322bc2c3c11a0f5735db4a475864f894f38866da Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466) 
   * a01ecf0bade9f8e4a56052fb5b5d25c5034fe511 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     }, {
       "hash" : "039f49ada096d2f85fc6908618f77c8483a446fb",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8550",
       "triggerID" : "039f49ada096d2f85fc6908618f77c8483a446fb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a01ecf0bade9f8e4a56052fb5b5d25c5034fe511 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486) 
   * 039f49ada096d2f85fc6908618f77c8483a446fb Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8550) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c51d4e8bf5dba50e4cb501fc04a87c924fe27e36 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] JingsongLi merged pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
JingsongLi merged pull request #13744:
URL: https://github.com/apache/flink/pull/13744


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 164c8b5b7750ed567813d70f160ef9f064d0a3b0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458) 
   * 322bc2c3c11a0f5735db4a475864f894f38866da UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] lirui-apache commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r511773377



##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactMessages.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Util class for all compaction messages.
+ *
+ * <p>The compaction operator graph is:
+ * TempFileWriter|parallel ---(InputFile&EndInputFile)---> CompactCoordinator|non-parallel
+ * ---(CompactionUnit&EndCompaction)--->CompactOperator|parallel---(PartitionCommitInfo)--->
+ * PartitionCommitter|non-parallel
+ *
+ * <p>Because the end message is a kind of barrier of record messages, they can only be transmitted
+ * in the way of full broadcast in the link from coordinator to compact operator.
+ */
+public class CompactMessages {
+	private CompactMessages() {}
+
+	/**
+	 * The input of compact coordinator.
+	 */
+	public interface CoordinatorInput extends Serializable {}
+
+	/**
+	 * A partitioned input file.
+	 */
+	public static class InputFile implements CoordinatorInput {

Review comment:
       Missing serialVersionUID

##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactMessages.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Util class for all compaction messages.
+ *
+ * <p>The compaction operator graph is:
+ * TempFileWriter|parallel ---(InputFile&EndInputFile)---> CompactCoordinator|non-parallel
+ * ---(CompactionUnit&EndCompaction)--->CompactOperator|parallel---(PartitionCommitInfo)--->
+ * PartitionCommitter|non-parallel
+ *
+ * <p>Because the end message is a kind of barrier of record messages, they can only be transmitted
+ * in the way of full broadcast in the link from coordinator to compact operator.
+ */
+public class CompactMessages {
+	private CompactMessages() {}
+
+	/**
+	 * The input of compact coordinator.
+	 */
+	public interface CoordinatorInput extends Serializable {}
+
+	/**
+	 * A partitioned input file.
+	 */
+	public static class InputFile implements CoordinatorInput {
+		private final String partition;
+		private final Path file;
+
+		public InputFile(String partition, Path file) {
+			this.partition = partition;
+			this.file = file;
+		}
+
+		public String getPartition() {
+			return partition;
+		}
+
+		public Path getFile() {
+			return file;
+		}
+	}
+
+	/**
+	 * A flag to end file input.
+	 */
+	public static class EndInputFile implements CoordinatorInput {

Review comment:
       Missing serialVersionUID

##########
File path: flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactCoordinatorTest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorInput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndInputFile;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.InputFile;
+import org.apache.flink.util.function.ThrowingConsumer;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * Test for {@link CompactCoordinator}.
+ */
+public class CompactCoordinatorTest extends AbstractCompactTestBase {
+
+	@Test
+	public void testCoordinatorCrossCheckpoints() throws Exception {
+		AtomicReference<OperatorSubtaskState> state = new AtomicReference<>();
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f0", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f1", 2)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f2", 2)), 0);
+
+			harness.processElement(new InputFile("p0", newFile("f3", 5)), 0);
+			harness.processElement(new InputFile("p0", newFile("f4", 1)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f5", 5)), 0);
+			harness.processElement(new InputFile("p1", newFile("f6", 4)), 0);
+
+			state.set(harness.snapshot(1, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f7", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f8", 2)), 0);
+
+			state.set(harness.snapshot(2, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new EndInputFile(2, 0, 1), 0);
+
+			List<CoordinatorOutput> outputs = harness.extractOutputValues();
+
+			Assert.assertEquals(7, outputs.size());
+
+			assertUnit(outputs.get(0), 0, "p0", Arrays.asList("f0", "f1", "f4"));

Review comment:
       I think `CompactCoordinator` doesn't guarantee to generate `CompactionUnit` in any specific order of partitions, right?

##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactCoordinator.java
##########
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.api.common.state.ListState;
+import org.apache.flink.api.common.state.ListStateDescriptor;
+import org.apache.flink.api.common.typeutils.base.ListSerializer;
+import org.apache.flink.api.common.typeutils.base.LongSerializer;
+import org.apache.flink.api.common.typeutils.base.MapSerializer;
+import org.apache.flink.api.common.typeutils.base.StringSerializer;
+import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
+import org.apache.flink.core.fs.FileSystem;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.state.StateInitializationContext;
+import org.apache.flink.runtime.state.StateSnapshotContext;
+import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
+import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.filesystem.stream.TaskTracker;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorInput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndInputFile;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.InputFile;
+import org.apache.flink.table.runtime.util.BinPacking;
+import org.apache.flink.util.function.SupplierWithException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.function.Function;
+
+/**
+ * This is the single (non-parallel) monitoring task which coordinate input files to compaction units.
+ * - Receives in-flight input files inside checkpoint.
+ * - Receives all upstream end input messages after the checkpoint completes successfully,
+ *   starts coordination.
+ *
+ * <p>NOTE: The coordination is a stable algorithm, which can ensure that the downstream can
+ *          perform compaction at any time without worrying about fail over.
+ *
+ * <p>STATE: This operator stores input files in state, after the checkpoint completes successfully,
+ *           input files are taken out from the state for coordination.
+ */
+public class CompactCoordinator extends AbstractStreamOperator<CoordinatorOutput> implements
+		OneInputStreamOperator<CoordinatorInput, CoordinatorOutput> {
+
+	private static final long serialVersionUID = 1L;
+
+	private static final Logger LOG = LoggerFactory.getLogger(CompactCoordinator.class);
+
+	private final SupplierWithException<FileSystem, IOException> fsFactory;
+	private final long targetFileSize;
+
+	private transient FileSystem fileSystem;
+
+	private transient ListState<Map<Long, Map<String, List<Path>>>> inputFilesState;
+	private transient TreeMap<Long, Map<String, List<Path>>> inputFiles;
+	private transient Map<String, List<Path>> currentInputFiles;
+
+	private transient TaskTracker inputTaskTracker;
+
+	public CompactCoordinator(
+			SupplierWithException<FileSystem, IOException> fsFactory,
+			long targetFileSize) {
+		this.fsFactory = fsFactory;
+		this.targetFileSize = targetFileSize;
+	}
+
+	@Override
+	public void initializeState(StateInitializationContext context) throws Exception {
+		super.initializeState(context);
+
+		fileSystem = fsFactory.get();
+
+		ListStateDescriptor<Map<Long, Map<String, List<Path>>>> filesDescriptor =
+				new ListStateDescriptor<>("files-state", new MapSerializer<>(
+						LongSerializer.INSTANCE,
+						new MapSerializer<>(
+								StringSerializer.INSTANCE,
+								new ListSerializer<>(
+										new KryoSerializer<>(Path.class, getExecutionConfig())))));
+		inputFilesState = context.getOperatorStateStore().getListState(filesDescriptor);
+		inputFiles = new TreeMap<>();
+		currentInputFiles = new HashMap<>();
+		if (context.isRestored()) {
+			inputFiles.putAll(inputFilesState.get().iterator().next());
+		}
+	}
+
+	@Override
+	public void processElement(StreamRecord<CoordinatorInput> element) throws Exception {
+		CoordinatorInput value = element.getValue();
+		if (value instanceof InputFile) {
+			InputFile file = (InputFile) value;
+			currentInputFiles.computeIfAbsent(file.getPartition(), k -> new ArrayList<>()).add(file.getFile());
+		} else if (value instanceof EndInputFile) {
+			EndInputFile endInputFile = (EndInputFile) value;
+			if (inputTaskTracker == null) {
+				inputTaskTracker = new TaskTracker(endInputFile.getNumberOfTasks());
+			}
+
+			// ensure all files are ready to be compacted.
+			boolean triggerCommit = inputTaskTracker.add(
+					endInputFile.getCheckpointId(), endInputFile.getTaskId());
+			if (triggerCommit) {
+				commitUpToCheckpoint(endInputFile.getCheckpointId());
+			}
+		}

Review comment:
       Throw an exception for unknown elements?

##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactMessages.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Util class for all compaction messages.
+ *
+ * <p>The compaction operator graph is:
+ * TempFileWriter|parallel ---(InputFile&EndInputFile)---> CompactCoordinator|non-parallel
+ * ---(CompactionUnit&EndCompaction)--->CompactOperator|parallel---(PartitionCommitInfo)--->
+ * PartitionCommitter|non-parallel
+ *
+ * <p>Because the end message is a kind of barrier of record messages, they can only be transmitted
+ * in the way of full broadcast in the link from coordinator to compact operator.
+ */
+public class CompactMessages {
+	private CompactMessages() {}
+
+	/**
+	 * The input of compact coordinator.
+	 */
+	public interface CoordinatorInput extends Serializable {}
+
+	/**
+	 * A partitioned input file.
+	 */
+	public static class InputFile implements CoordinatorInput {
+		private final String partition;
+		private final Path file;
+
+		public InputFile(String partition, Path file) {
+			this.partition = partition;
+			this.file = file;
+		}
+
+		public String getPartition() {
+			return partition;
+		}
+
+		public Path getFile() {
+			return file;
+		}
+	}
+
+	/**
+	 * A flag to end file input.
+	 */
+	public static class EndInputFile implements CoordinatorInput {
+		private final long checkpointId;
+		private final int taskId;
+		private final int numberOfTasks;
+
+		public EndInputFile(long checkpointId, int taskId, int numberOfTasks) {
+			this.checkpointId = checkpointId;
+			this.taskId = taskId;
+			this.numberOfTasks = numberOfTasks;
+		}
+
+		public long getCheckpointId() {
+			return checkpointId;
+		}
+
+		public int getTaskId() {
+			return taskId;
+		}
+
+		public int getNumberOfTasks() {
+			return numberOfTasks;
+		}
+	}
+
+	/**
+	 * The output of compact coordinator.
+	 */
+	public interface CoordinatorOutput extends Serializable {}
+
+	/**
+	 * The unit of a single compaction.
+	 */
+	public static class CompactionUnit implements CoordinatorOutput {
+
+		private final int unitId;
+		private final String partition;
+
+		// Store strings to improve serialization performance.
+		private final String[] pathStrings;
+
+		public CompactionUnit(int unitId, String partition, List<Path> unit) {
+			this.unitId = unitId;
+			this.partition = partition;
+			this.pathStrings = unit.stream()
+					.map(Path::toUri)
+					.map(URI::toString)
+					.toArray(String[]::new);
+		}
+
+		public boolean isTaskMessage(int taskId) {

Review comment:
       What's the purpose of this method?

##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactMessages.java
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Util class for all compaction messages.
+ *
+ * <p>The compaction operator graph is:
+ * TempFileWriter|parallel ---(InputFile&EndInputFile)---> CompactCoordinator|non-parallel
+ * ---(CompactionUnit&EndCompaction)--->CompactOperator|parallel---(PartitionCommitInfo)--->
+ * PartitionCommitter|non-parallel
+ *
+ * <p>Because the end message is a kind of barrier of record messages, they can only be transmitted
+ * in the way of full broadcast in the link from coordinator to compact operator.
+ */
+public class CompactMessages {
+	private CompactMessages() {}
+
+	/**
+	 * The input of compact coordinator.
+	 */
+	public interface CoordinatorInput extends Serializable {}
+
+	/**
+	 * A partitioned input file.
+	 */
+	public static class InputFile implements CoordinatorInput {
+		private final String partition;
+		private final Path file;
+
+		public InputFile(String partition, Path file) {
+			this.partition = partition;
+			this.file = file;
+		}
+
+		public String getPartition() {
+			return partition;
+		}
+
+		public Path getFile() {
+			return file;
+		}
+	}
+
+	/**
+	 * A flag to end file input.

Review comment:
       It seems more of a flag to end checkpoint rather than file input?

##########
File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/stream/compact/CompactOperator.java
##########
@@ -0,0 +1,276 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.api.common.state.ListState;
+import org.apache.flink.api.common.state.ListStateDescriptor;
+import org.apache.flink.api.common.typeutils.base.ListSerializer;
+import org.apache.flink.api.common.typeutils.base.LongSerializer;
+import org.apache.flink.api.common.typeutils.base.MapSerializer;
+import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.connector.file.src.reader.BulkFormat;
+import org.apache.flink.core.fs.FSDataInputStream;
+import org.apache.flink.core.fs.FileSystem;
+import org.apache.flink.core.fs.FileSystemKind;
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.core.fs.RecoverableFsDataOutputStream;
+import org.apache.flink.core.fs.RecoverableWriter;
+import org.apache.flink.runtime.state.StateInitializationContext;
+import org.apache.flink.runtime.state.StateSnapshotContext;
+import org.apache.flink.streaming.api.functions.sink.filesystem.BucketWriter;
+import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
+import org.apache.flink.streaming.api.operators.BoundedOneInput;
+import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.table.filesystem.stream.PartitionCommitInfo;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.util.IOUtils;
+import org.apache.flink.util.Preconditions;
+import org.apache.flink.util.function.SupplierWithException;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.NavigableMap;
+import java.util.Set;
+import java.util.TreeMap;
+
+/**
+ * Receives compaction units to do compaction. Send partition commit information after
+ * compaction finished.
+ *
+ * <p>Use {@link BulkFormat} to read and use {@link BucketWriter} to write.
+ *
+ * <p>STATE: This operator stores expired files in state, after the checkpoint completes successfully,
+ *           We can ensure that these files will not be used again and they can be deleted from the
+ *           file system.
+ */
+public class CompactOperator<T> extends AbstractStreamOperator<PartitionCommitInfo>
+		implements OneInputStreamOperator<CoordinatorOutput, PartitionCommitInfo>, BoundedOneInput {
+
+	private static final long serialVersionUID = 1L;
+
+	private static final String UNCOMPACTED_PREFIX = ".uncompacted-";
+
+	private static final String COMPACTED_PREFIX = "compacted-";
+
+	private final SupplierWithException<FileSystem, IOException> fsFactory;
+	private final CompactReader.Factory<T> readerFactory;
+	private final CompactWriter.Factory<T> writerFactory;
+
+	private transient FileSystem fileSystem;
+
+	private transient ListState<Map<Long, List<Path>>> expiredFilesState;
+	private transient TreeMap<Long, List<Path>> expiredFiles;
+	private transient List<Path> currentExpiredFiles;
+
+	private transient Set<String> partitions;
+
+	public CompactOperator(
+			SupplierWithException<FileSystem, IOException> fsFactory,
+			CompactReader.Factory<T> readerFactory,
+			CompactWriter.Factory<T> writerFactory) {
+		this.fsFactory = fsFactory;
+		this.readerFactory = readerFactory;
+		this.writerFactory = writerFactory;
+	}
+
+	@Override
+	public void initializeState(StateInitializationContext context) throws Exception {
+		super.initializeState(context);
+		this.partitions = new HashSet<>();
+		this.fileSystem = fsFactory.get();
+
+		ListStateDescriptor<Map<Long, List<Path>>> metaDescriptor =
+				new ListStateDescriptor<>("expired-files", new MapSerializer<>(
+						LongSerializer.INSTANCE,
+						new ListSerializer<>(new KryoSerializer<>(Path.class, getExecutionConfig()))
+				));
+		this.expiredFilesState = context.getOperatorStateStore().getListState(metaDescriptor);
+		this.expiredFiles = new TreeMap<>();
+		this.currentExpiredFiles = new ArrayList<>();
+
+		if (context.isRestored()) {
+			this.expiredFiles.putAll(this.expiredFilesState.get().iterator().next());
+		}
+	}
+
+	@Override
+	public void processElement(StreamRecord<CoordinatorOutput> element) throws Exception {
+		CoordinatorOutput value = element.getValue();
+		if (value instanceof CompactionUnit) {
+			CompactionUnit unit = (CompactionUnit) value;
+			if (unit.isTaskMessage(getRuntimeContext().getNumberOfParallelSubtasks())) {
+				String partition = unit.getPartition();
+				List<Path> paths = unit.getPaths();
+
+				doCompact(paths);
+				this.partitions.add(partition);
+
+				// Only after the current checkpoint is successfully executed can delete
+				// the expired files, so as to ensure the existence of the files.
+				this.currentExpiredFiles.addAll(paths);
+			}
+		} else if (value instanceof EndCompaction) {
+			endCompaction(((EndCompaction) value).getCheckpointId());
+		}
+	}
+
+	private void endCompaction(long checkpoint) {
+		this.output.collect(new StreamRecord<>(new PartitionCommitInfo(
+				checkpoint,
+				getRuntimeContext().getIndexOfThisSubtask(),
+				getRuntimeContext().getNumberOfParallelSubtasks(),
+				new ArrayList<>(this.partitions))));
+		this.partitions.clear();
+	}
+
+	@Override
+	public void snapshotState(StateSnapshotContext context) throws Exception {
+		super.snapshotState(context);
+
+		expiredFilesState.clear();
+		expiredFiles.put(context.getCheckpointId(), new ArrayList<>(currentExpiredFiles));
+		expiredFilesState.add(expiredFiles);
+		currentExpiredFiles.clear();
+	}
+
+	@Override
+	public void notifyCheckpointComplete(long checkpointId) throws Exception {

Review comment:
       If something goes wrong in this method and the job fails over, will this method be called again for the same checkpointId?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 73d36420f9e131efb1ba70053b5ef315f79afd68 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094) 
   * d257594ae6a62374f9727f97dad3254ea7c25ef2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d257594ae6a62374f9727f97dad3254ea7c25ef2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144) 
   * 4d7e601658c0dacc100c572f4fe8878c058e035f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     }, {
       "hash" : "039f49ada096d2f85fc6908618f77c8483a446fb",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "039f49ada096d2f85fc6908618f77c8483a446fb",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a01ecf0bade9f8e4a56052fb5b5d25c5034fe511 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486) 
   * 039f49ada096d2f85fc6908618f77c8483a446fb UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c51d4e8bf5dba50e4cb501fc04a87c924fe27e36 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390) 
   * b4cbace2b682490ac53a4a8cb4438f2361f3cffd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c51d4e8bf5dba50e4cb501fc04a87c924fe27e36 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390) 
   * b4cbace2b682490ac53a4a8cb4438f2361f3cffd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446) 
   * c8f3503c99ec4add43df3d054783f7a48501324c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 244b9004c862573b63e7da7f4226ce5da987edc5 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357) 
   * c51d4e8bf5dba50e4cb501fc04a87c924fe27e36 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot commented on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714352652


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 73d36420f9e131efb1ba70053b5ef315f79afd68 (Thu Oct 22 09:13:15 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 164c8b5b7750ed567813d70f160ef9f064d0a3b0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458) 
   * 322bc2c3c11a0f5735db4a475864f894f38866da Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 074ab07749ff798563e785d2c2fafeee1302ac74 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262) 
   * 22d42a57852d0a240e2abb6bf1a4c2ade682601f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 074ab07749ff798563e785d2c2fafeee1302ac74 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] JingsongLi commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512434732



##########
File path: flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactCoordinatorTest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorInput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndInputFile;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.InputFile;
+import org.apache.flink.util.function.ThrowingConsumer;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * Test for {@link CompactCoordinator}.
+ */
+public class CompactCoordinatorTest extends AbstractCompactTestBase {
+
+	@Test
+	public void testCoordinatorCrossCheckpoints() throws Exception {
+		AtomicReference<OperatorSubtaskState> state = new AtomicReference<>();
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f0", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f1", 2)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f2", 2)), 0);
+
+			harness.processElement(new InputFile("p0", newFile("f3", 5)), 0);
+			harness.processElement(new InputFile("p0", newFile("f4", 1)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f5", 5)), 0);
+			harness.processElement(new InputFile("p1", newFile("f6", 4)), 0);
+
+			state.set(harness.snapshot(1, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f7", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f8", 2)), 0);
+
+			state.set(harness.snapshot(2, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new EndInputFile(2, 0, 1), 0);
+
+			List<CoordinatorOutput> outputs = harness.extractOutputValues();
+
+			Assert.assertEquals(7, outputs.size());
+
+			assertUnit(outputs.get(0), 0, "p0", Arrays.asList("f0", "f1", "f4"));

Review comment:
       You mean we should sort it before assert?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 164c8b5b7750ed567813d70f160ef9f064d0a3b0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458) 
   * 322bc2c3c11a0f5735db4a475864f894f38866da Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466) 
   * a01ecf0bade9f8e4a56052fb5b5d25c5034fe511 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4d7e601658c0dacc100c572f4fe8878c058e035f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156) 
   * 074ab07749ff798563e785d2c2fafeee1302ac74 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c8f3503c99ec4add43df3d054783f7a48501324c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454) 
   * 164c8b5b7750ed567813d70f160ef9f064d0a3b0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8262",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     }, {
       "hash" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8344",
       "triggerID" : "22d42a57852d0a240e2abb6bf1a4c2ade682601f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8357",
       "triggerID" : "244b9004c862573b63e7da7f4226ce5da987edc5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8390",
       "triggerID" : "c51d4e8bf5dba50e4cb501fc04a87c924fe27e36",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8446",
       "triggerID" : "b4cbace2b682490ac53a4a8cb4438f2361f3cffd",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8454",
       "triggerID" : "c8f3503c99ec4add43df3d054783f7a48501324c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8458",
       "triggerID" : "164c8b5b7750ed567813d70f160ef9f064d0a3b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466",
       "triggerID" : "322bc2c3c11a0f5735db4a475864f894f38866da",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486",
       "triggerID" : "a01ecf0bade9f8e4a56052fb5b5d25c5034fe511",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 322bc2c3c11a0f5735db4a475864f894f38866da Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8466) 
   * a01ecf0bade9f8e4a56052fb5b5d25c5034fe511 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8486) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8144",
       "triggerID" : "d257594ae6a62374f9727f97dad3254ea7c25ef2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156",
       "triggerID" : "4d7e601658c0dacc100c572f4fe8878c058e035f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "074ab07749ff798563e785d2c2fafeee1302ac74",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4d7e601658c0dacc100c572f4fe8878c058e035f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8156) 
   * 074ab07749ff798563e785d2c2fafeee1302ac74 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] flinkbot edited a comment on pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13744:
URL: https://github.com/apache/flink/pull/13744#issuecomment-714369975


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094",
       "triggerID" : "73d36420f9e131efb1ba70053b5ef315f79afd68",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 73d36420f9e131efb1ba70053b5ef315f79afd68 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8094) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [flink] JingsongLi commented on a change in pull request #13744: [FLINK-19766][table-runtime] Introduce File streaming compaction operators

Posted by GitBox <gi...@apache.org>.
JingsongLi commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512378461



##########
File path: flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactCoordinatorTest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.filesystem.stream.compact;
+
+import org.apache.flink.core.fs.Path;
+import org.apache.flink.runtime.checkpoint.OperatorSubtaskState;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CompactionUnit;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorInput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.CoordinatorOutput;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndCompaction;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.EndInputFile;
+import org.apache.flink.table.filesystem.stream.compact.CompactMessages.InputFile;
+import org.apache.flink.util.function.ThrowingConsumer;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * Test for {@link CompactCoordinator}.
+ */
+public class CompactCoordinatorTest extends AbstractCompactTestBase {
+
+	@Test
+	public void testCoordinatorCrossCheckpoints() throws Exception {
+		AtomicReference<OperatorSubtaskState> state = new AtomicReference<>();
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f0", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f1", 2)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f2", 2)), 0);
+
+			harness.processElement(new InputFile("p0", newFile("f3", 5)), 0);
+			harness.processElement(new InputFile("p0", newFile("f4", 1)), 0);
+
+			harness.processElement(new InputFile("p1", newFile("f5", 5)), 0);
+			harness.processElement(new InputFile("p1", newFile("f6", 4)), 0);
+
+			state.set(harness.snapshot(1, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new InputFile("p0", newFile("f7", 3)), 0);
+			harness.processElement(new InputFile("p0", newFile("f8", 2)), 0);
+
+			state.set(harness.snapshot(2, 0));
+		});
+
+		runCoordinator(harness -> {
+			harness.setup();
+			harness.initializeState(state.get());
+			harness.open();
+
+			harness.processElement(new EndInputFile(2, 0, 1), 0);
+
+			List<CoordinatorOutput> outputs = harness.extractOutputValues();
+
+			Assert.assertEquals(7, outputs.size());
+
+			assertUnit(outputs.get(0), 0, "p0", Arrays.asList("f0", "f1", "f4"));

Review comment:
       You mean the order of partitions? There is no relationship between partitions, so there is no need to guarantee this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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