tkalkirill commented on code in PR #4602:
URL: https://github.com/apache/ignite-3/pull/4602#discussion_r1808677051


##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/CompactionListener.java:
##########
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.metastorage.server;
+
+/** Listener of the metastorage compaction. */
+@FunctionalInterface
+public interface CompactionListener {
+    /** Callback on completion of metastore compaction locally. */
+    void onCompleteLocally(long compactionRevision);

Review Comment:
   I'll leave it as is.



##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/ReadOperationForCompactionTracker.java:
##########
@@ -36,17 +36,23 @@
  * <p>Expected usage:</p>
  * <ul>
  *     <li>Before starting execution, the reading command invoke {@link 
#track} with its ID and the compaction revision that is currently
- *     set ({@link 
MetaStorageCompactionManager#setCompactionRevisionLocally}/{@link 
KeyValueStorage#setCompactionRevision}).</li>
+ *     set ({@link KeyValueStorage#setCompactionRevision}).</li>
  *     <li>After completion, the reading command will invoke {@link #untrack} 
with the same arguments as when calling {@link #track},
  *     regardless of whether the operation was successful or not.</li>
  *     <li>{@link #collect} will be invoked only after a new compaction 
revision has been set
- *     ({@link 
MetaStorageCompactionManager#setCompactionRevisionLocally}/{@link 
KeyValueStorage#setCompactionRevision}) for a new
- *     compaction revision.</li>
+ *     ({@link KeyValueStorage#setCompactionRevision}) for a new compaction 
revision.</li>
  * </ul>
  */
 public class ReadOperationForCompactionTracker {
     private final Map<ReadOperationKey, CompletableFuture<Void>> 
readOperationFutureByKey = new ConcurrentHashMap<>();
 
+    private final AtomicLong longOperationIdGenerator = new AtomicLong();
+
+    /** Generates the next read operation ID. Thread-safe. */
+    public long generateLongReadOperationId() {

Review Comment:
   Fix it



##########
modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/MetaStorageManager.java:
##########
@@ -423,4 +423,11 @@ public interface MetaStorageManager extends 
IgniteComponent {
 
     /** Unregisters a Meta Storage revision update listener. */
     void unregisterRevisionUpdateListener(RevisionUpdateListener listener);
+
+    /**
+     * Returns the local compaction revision that was set or restored from a 
metastorage snapshot, {@code -1} if not changed.

Review Comment:
   thanks



-- 
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]

Reply via email to