Caideyipi commented on code in PR #11532:
URL: https://github.com/apache/iotdb/pull/11532#discussion_r1396629228
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/pipe/PipeTaskInfo.java:
##########
@@ -80,12 +84,51 @@ private void releaseReadLock() {
private void acquireWriteLock() {
pipeMetaKeeper.acquireWriteLock();
+ pipeTaskInfoVersion.increaseLatestVersion();
}
private void releaseWriteLock() {
pipeMetaKeeper.releaseWriteLock();
}
+ /////////////////////////////// Version ///////////////////////////////
+
+ private class PipeTaskInfoVersion {
+
+ private final AtomicLong latestVersion;
+ private long lastSyncedVersion;
+ private boolean isLastSyncedPipeTaskInfoEmpty;
+
+ public PipeTaskInfoVersion() {
+ this.latestVersion = new AtomicLong(0);
+ this.lastSyncedVersion = 0;
+ this.isLastSyncedPipeTaskInfoEmpty = false;
+ }
+
+ public void increaseLatestVersion() {
+ latestVersion.incrementAndGet();
+ }
+
+ public void updateLastSyncedVersion() {
+ lastSyncedVersion = latestVersion.get();
+ isLastSyncedPipeTaskInfoEmpty = pipeMetaKeeper.isEmpty();
+ }
+
+ public boolean isEmptySynced() {
Review Comment:
isEmptySynced infers not only the very last empty sync, but the empty
pipeMeta now. Maybe simply call it "canSkipNextSync"?
--
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]