leaves12138 commented on code in PR #1366:
URL: https://github.com/apache/incubator-paimon/pull/1366#discussion_r1231902103
##########
paimon-core/src/main/java/org/apache/paimon/operation/AppendOnlyFileStoreWrite.java:
##########
@@ -159,7 +161,20 @@ public AppendOnlyCompactManager.CompactRewriter
compactRewriter(
};
}
- public void skipCompaction() {
- skipCompaction = true;
+ public AppendOnlyFileStoreWrite withBucketMode(BucketMode bucketMode) {
+ // AppendOnlyFileStoreWrite is sensitive with bucket mode. It will act
difference in
+ // unaware-bucket mode (no compaction and force empty-writer).
+ this.bucketMode = bucketMode;
+ if (bucketMode == BucketMode.UNAWARE) {
+ super.withIgnorePreviousFiles(true);
+ skipCompaction = true;
+ }
+ return this;
+ }
+
+ @Override
+ public void withIgnorePreviousFiles(boolean emptyWriter) {
+ // in unaware bucket mode, we need all writers to be empty
+ super.withIgnorePreviousFiles(emptyWriter || bucketMode ==
BucketMode.UNAWARE);
Review Comment:
In unaware-bucket mode, AppendOnlyFileStoreWrite no longer compact any
files. The coordinator will scan the whole.
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/compact/UnawareBucketCompactionTopoBuilder.java:
##########
@@ -73,14 +74,22 @@ public void withPartitions(List<Map<String, String>>
partitions) {
}
public void build() {
-
// build source from UnawareSourceFunction
DataStreamSource<AppendOnlyCompactionTask> source = buildSource();
// from source, construct the full flink job
sinkFromSource(source);
}
+ public DataStream<Committable> fetchUncommitted(String commitUser) {
+ DataStreamSource<AppendOnlyCompactionTask> source = buildSource();
+
+ // rebalance input to default or assigned parallelism
+ DataStream<AppendOnlyCompactionTask> rebalanced =
rebalanceInput(source);
+
+ return new UnawareBucketCompactionSink(table).doWrite(rebalanced,
commitUser);
+ }
+
private DataStreamSource<AppendOnlyCompactionTask> buildSource() {
long scanInterval =
table.coreOptions().continuousDiscoveryInterval().toMillis();
UnawareBucketSourceFunction source =
Review Comment:
ok
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]