tkalkirill commented on code in PR #5654:
URL: https://github.com/apache/ignite-3/pull/5654#discussion_r2048488054
##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/WatchProcessor.java:
##########
@@ -170,19 +167,17 @@ public void
setWatchEventHandlingCallback(WatchEventHandlingCallback callback) {
*
* <p>This method is not thread-safe and must be performed under an
exclusive lock in concurrent scenarios.
*
- * @param updatedEntries Entries that were changed during a Meta Storage
update.
+ * @param newRevision Revision associated with an update.
+ * @param updatedEntries Entries that were changed during a Meta Storage
update, empty if only need to update the revision.
* @param time Timestamp of the Meta Storage update.
* @return Future that gets completed when all registered watches have
been notified of the given event.
*/
- public CompletableFuture<Void> notifyWatches(List<Entry> updatedEntries,
HybridTimestamp time) {
+ public CompletableFuture<Void> notifyWatches(long newRevision, List<Entry>
updatedEntries, HybridTimestamp time) {
assert time != null;
CompletableFuture<Void> newFuture = notificationFuture
.thenComposeAsync(v -> {
- // Revision must be the same for all entries.
- long newRevision = updatedEntries.get(0).revision();
-
- List<Entry> filteredUpdatedEntries =
updatedEntries.stream()
+ List<Entry> filteredUpdatedEntries =
updatedEntries.isEmpty() ? emptyList() : updatedEntries.stream()
Review Comment:
U can use `List.of()`
##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/WatchProcessor.java:
##########
@@ -307,13 +302,20 @@ private void invokeOnRevisionCallback(long revision,
HybridTimestamp time) {
* Advances safe time without notifying watches (as there is no new
revision).
*
* <p>This method is not thread-safe and must be performed under an
exclusive lock in concurrent scenarios.
+ *
+ * @param callback A callback that will be executed in meta-storage watch
thread strictly before advancing safe time.
Review Comment:
```suggestion
* @param callback A callback that will be executed in meta-storage
watch thread strictly before advancing safe time, no-op to just advance the
safe time.
```
--
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]