JingsongLi commented on code in PR #1351:
URL: https://github.com/apache/incubator-paimon/pull/1351#discussion_r1233501522
##########
paimon-core/src/main/java/org/apache/paimon/compact/CompactFutureManager.java:
##########
@@ -48,15 +51,24 @@ protected final Optional<CompactResult>
innerGetCompactionResult(boolean blockin
if (blocking || taskFuture.isDone()) {
CompactResult result;
try {
- result = taskFuture.get();
+ result = obtainCompactResult();
} catch (CancellationException e) {
taskFuture = null;
return Optional.empty();
+ } catch (ExecutionException e) {
Review Comment:
We don't need to copy exception here.
We can just:
```
try {
return Optional.of(taskFuture.get());
} catch (CancellationException e) {
return Optional.empty();
} finally {
taskFuture = null;
}
```
##########
paimon-core/pom.xml:
##########
@@ -161,6 +161,14 @@ under the License.
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
Review Comment:
It is better to not introduce mockito. Mockito is not good test framework,
we should not introduce it until it is absolutely necessary, we introduce our
own abstraction.
##########
paimon-core/src/main/java/org/apache/paimon/compact/CompactManager.java:
##########
@@ -31,6 +31,8 @@ public interface CompactManager extends Closeable {
/** Should wait compaction finish. */
boolean shouldWaitCompaction();
+ boolean shouldWaitWhenPreparingCheckpoint();
Review Comment:
`boolean shouldWaitForPrepareCommit`
##########
paimon-core/src/main/java/org/apache/paimon/compact/CompactManager.java:
##########
@@ -31,6 +31,8 @@ public interface CompactManager extends Closeable {
/** Should wait compaction finish. */
boolean shouldWaitCompaction();
Review Comment:
`boolean shouldWaitForLatestCompaction`
##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/MergeTreeCompactManager.java:
##########
@@ -75,6 +75,15 @@ public boolean shouldWaitCompaction() {
return levels.numberOfSortedRuns() > numSortedRunStopTrigger;
}
+ @Override
+ public boolean shouldWaitWhenPreparingCheckpoint() {
+ return levels.numberOfSortedRuns() > numSortedRunStopTrigger + 1;
+ }
+
+ private boolean checkSortedRuns(int extra) {
Review Comment:
remove 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]