jt2594838 commented on code in PR #18726:
URL: https://github.com/apache/iotdb/pull/18726#discussion_r4560553233
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/sink/PipeRealtimePriorityBlockingQueue.java:
##########
@@ -443,4 +514,38 @@ private static Path normalizePath(final File file) {
public synchronized void setOfferTsFileCounter(AtomicInteger
offerTsFileCounter) {
this.offerTsFileCounter = offerTsFileCounter;
}
+
+ public void enableTsFileStartupReservation() {
+ reserveTsFileStartupOnPoll = true;
+ }
+
+ public boolean consumeTsFileStartupReservation(final TsFileInsertionEvent
event) {
+ synchronized (offerTsFileCounter) {
+ return reservedTsFileStartupEvents.remove(event);
+ }
+ }
+
+ public boolean cancelTsFileStartupReservation(final TsFileInsertionEvent
event) {
+ synchronized (offerTsFileCounter) {
+ if (!reservedTsFileStartupEvents.remove(event)) {
+ return false;
+ }
+ offerTsFileCounter.decrementAndGet();
+ offerTsFileCounter.notifyAll();
+ return true;
+ }
+ }
+
+ private void clearTsFileStartupReservations(
+ final java.util.function.Predicate<TsFileInsertionEvent> predicate) {
Review Comment:
Mind the import
--
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]