[HUDI-3576] Configuring timeline refreshes based on latest commit (#4973)
This commit is contained in:
committed by
GitHub
parent
53826d69e4
commit
29040762fa
@@ -136,9 +136,9 @@ public class RequestHandler {
|
||||
}
|
||||
|
||||
String localTimelineHash = localTimeline.getTimelineHash();
|
||||
// refresh if timeline hash mismatches and if local's last known instant < client's last known instant
|
||||
// refresh if timeline hash mismatches and if local's last known instant < client's last known instant (if config is enabled)
|
||||
if (!localTimelineHash.equals(timelineHashFromClient)
|
||||
&& HoodieTimeline.compareTimestamps(localLastKnownInstant, HoodieTimeline.LESSER_THAN, lastKnownInstantFromClient)) {
|
||||
&& (!timelineServiceConfig.refreshTimelineBasedOnLatestCommit || HoodieTimeline.compareTimestamps(localLastKnownInstant, HoodieTimeline.LESSER_THAN, lastKnownInstantFromClient))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,9 @@ public class TimelineService {
|
||||
@Parameter(names = {"--marker-parallelism", "-mdp"}, description = "Parallelism to use for reading and deleting marker files")
|
||||
public int markerParallelism = 100;
|
||||
|
||||
@Parameter(names = {"--refreshTimelineBasedOnLatestCommit"}, description = "Refresh local timeline based on latest commit in addition to timeline hash value")
|
||||
public boolean refreshTimelineBasedOnLatestCommit = true;
|
||||
|
||||
@Parameter(names = {"--help", "-h"})
|
||||
public Boolean help = false;
|
||||
|
||||
@@ -147,6 +150,7 @@ public class TimelineService {
|
||||
private int markerBatchNumThreads = 20;
|
||||
private long markerBatchIntervalMs = 50L;
|
||||
private int markerParallelism = 100;
|
||||
private boolean refreshTimelineBasedOnLatestCommit = false;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
@@ -196,6 +200,11 @@ public class TimelineService {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder refreshTimelineBasedOnLatestCommit(boolean refreshTimelineBasedOnLatestCommit) {
|
||||
this.refreshTimelineBasedOnLatestCommit = refreshTimelineBasedOnLatestCommit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder enableMarkerRequests(boolean enableMarkerRequests) {
|
||||
this.enableMarkerRequests = enableMarkerRequests;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user