rpuch commented on code in PR #4623: URL: https://github.com/apache/ignite-3/pull/4623#discussion_r1820890653
########## modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/CompactionRevisionUpdateListener.java: ########## @@ -0,0 +1,34 @@ +/* + * 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; + +/** + * Listener which receives and handles the metastorage compaction revision update after start watches. + * + * <p>It is guaranteed that it will <b>not</b> invoked in parallel with the handling of watch events or metastore revision update Review Comment: ```suggestion * <p>It is guaranteed that it will <b>not</b> be invoked in parallel with the handling of watch events or metastore revision update ``` ########## modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/CompactionRevisionUpdateListener.java: ########## @@ -0,0 +1,34 @@ +/* + * 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; + +/** + * Listener which receives and handles the metastorage compaction revision update after start watches. Review Comment: 'After starting watches' / 'after watches have been started'? ########## modules/metastorage-api/src/main/java/org/apache/ignite/internal/metastorage/CompactionRevisionUpdateListener.java: ########## @@ -0,0 +1,34 @@ +/* + * 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; + +/** + * Listener which receives and handles the metastorage compaction revision update after start watches. + * + * <p>It is guaranteed that it will <b>not</b> invoked in parallel with the handling of watch events or metastore revision update + * events.</p> + */ +@FunctionalInterface +public interface CompactionRevisionUpdateListener { + /** + * Invokes when the metastorage compaction revision has been updated in the WatchEvent queue. Review Comment: ```suggestion * Invoked when the metastorage compaction revision has been updated in the WatchEvent queue. ``` ########## modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageCompactionTrigger.java: ########## @@ -92,15 +88,15 @@ class MetaStorageCompactionTrigger implements ManuallyCloseable { /** Guarded by {@link #lock}. */ private boolean isLocalNodeLeader; - private final Lock lock = new ReentrantLock(); - - /** Compaction start interval (in milliseconds). */ - // TODO: IGNITE-23279 Change configuration - private final long startInterval = IgniteSystemProperties.getLong(COMPACTION_INTERVAL_PROPERTY, Long.MAX_VALUE); + /** + * Flag that the component has started. It is expected that the component will be started after the distributed configuration has Review Comment: ```suggestion * Whether the component has started. It is expected that the component will be started after the distributed configuration has ``` ########## modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageCompactionTrigger.java: ########## @@ -258,7 +282,7 @@ private void onCompactionRevisionUpdateBusy(long compactionRevision) { } /** Invokes when a new leader is elected. */ Review Comment: ```suggestion /** Invoked when a new leader is elected. */ ``` ########## modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageCompactionTrigger.java: ########## @@ -230,7 +254,7 @@ private void scheduleNextCompactionBusy() { } /** Invokes when the metastorage compaction revision is updated. */ Review Comment: ```suggestion /** Invoked when the metastorage compaction revision is updated. */ ``` -- 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]
