You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/IndexingHeartbeat.java
+26-25Lines changed: 26 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -93,33 +93,34 @@ public CompletableFuture<Void> checkAndUpdateHeartbeat(@Nonnull FDBRecordStore s
Copy file name to clipboardExpand all lines: fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/OnlineIndexer.java
* This {@link Exception} can be thrown in the case that one calls one of the methods
319
320
* that explicitly state that they are building an unbuilt range, i.e., a range of keys
320
321
* that contains no keys which have yet been processed by the {@link OnlineIndexer}
321
322
* during an index build.
322
-
* <em>Deprecated</em> and unused.
323
323
*/
324
324
@API(API.Status.DEPRECATED)
325
325
@SuppressWarnings("serial")
@@ -480,7 +480,7 @@ public boolean checkAnyOngoingOnlineIndexBuilds() {
480
480
}
481
481
482
482
/**
483
-
* Check if the main index is being built. Note that with shared heartbeats, this function will now return true for any active session - mutual or exclusive.
483
+
* Check if the provided index is being built. Note that with shared heartbeats, this function will now return true for any active session - mutual or exclusive.
484
484
* @return a future that will complete to <code>true</code> if the index is being built and <code>false</code> otherwise
@@ -490,7 +490,7 @@ public CompletableFuture<Boolean> checkAnyOngoingOnlineIndexBuildsAsync() {
490
490
}
491
491
492
492
/**
493
-
* Check if the main index is being built. Note that with shared heartbeats, this function will now return true for any active session - mutual or exclusive.
493
+
* Check if the provided index is being built. Note that with shared heartbeats, this function will now return true for any active session - mutual or exclusive.
494
494
* Where "active session" is determined by an indexing heartbeat that is less than {@link OnlineIndexOperationConfig#DEFAULT_LEASE_LENGTH_MILLIS} old.
495
495
* @param recordStore record store whose index builds need to be checked
496
496
* @param index the index to check for ongoing index builds
@@ -501,7 +501,7 @@ public static CompletableFuture<Boolean> checkAnyOngoingOnlineIndexBuildsAsync(@
501
501
}
502
502
503
503
/**
504
-
* Check if the main index is being built. Note that with shared heartbeats, this function will now return true for any active session - mutual or exclusive.
504
+
* Check if the provided index is being built. Note that with shared heartbeats, this function will now return true for any active session - mutual or exclusive.
505
505
* @param recordStore record store whose index builds need to be checked
506
506
* @param index the index to check for ongoing index builds
507
507
* @param leasingMilliseconds max heartbeat age to be considered an "active session"
@@ -517,7 +517,14 @@ public static CompletableFuture<Boolean> checkAnyOngoingOnlineIndexBuildsAsync(@
517
517
518
518
/**
519
519
* Builds an index across multiple transactions.
520
-
* This is a slow and retrying operation that is intended to be executed by background processes.
520
+
* <p>
521
+
* If the indexing session is not mutual, it will stop with {@link com.apple.foundationdb.synchronizedsession.SynchronizedSessionLockedException}
522
+
* if there is another active indexing session on the same index. It first checks and updates index states and
523
+
* clear index data respecting the {@link IndexStatePrecondition} being set. It then builds the index across
524
+
* multiple transactions honoring the rate-limiting parameters set in the constructor of this class. It also retries
525
+
* any retriable errors that it encounters while it runs the build. At the end, it marks the index readable in the
526
+
* store.
527
+
* </p>
521
528
* @return a future that will be ready when the build has completed
522
529
* @throws com.apple.foundationdb.synchronizedsession.SynchronizedSessionLockedException the build is stopped
523
530
* because there may be another build running actively on this index.
@@ -586,9 +593,10 @@ public Map<String, IndexBuildProto.IndexBuildIndexingStamp> queryIndexingStamps(
586
593
587
594
/**
588
595
* Block partly built indexes, preventing continuation.
589
-
* Active indexing sessions will check for this block according to {@link IndexingPolicy.Builder#checkIndexingStampFrequencyMilliseconds(long)}.}
590
-
* @param id if non null, will be added to the "indexing stamp" as an id/hint for the blocking reason.
591
-
* @param ttlSeconds if non null, the block will automatically expire after this value (in seconds).
596
+
* Active indexing sessions will check for this block during every iterating transaction, which still requires the caller to
597
+
* wait a few seconds before assuming that all indexing had stopped.
598
+
* @param id if non-null, will be added to the "indexing stamp" as an id/hint for the blocking reason.
599
+
* @param ttlSeconds if non-null, the block will automatically expire after this value (in seconds).
592
600
* @return a map of target indexes and their "indexing stamps" after the change.
593
601
*/
594
602
@API(API.Status.EXPERIMENTAL)
@@ -635,7 +643,7 @@ public Map<UUID, IndexBuildProto.IndexBuildHeartbeat> getIndexingHeartbeats(int
635
643
* Clear old indexing heartbeats for a given index (single target or primary index).
636
644
* Typically, heartbeats are deleted either at the end of an indexing sessions or when the index becomes readable. This
637
645
* cleanup function can be used if, for any reason, the heartbeats could not be deleted from the database at the end of a session.
638
-
* @param minAgeMilliseconds minimum heartbeat age (time elapsed since heartbeat creation, in milliseconds) to clear.
646
+
* @param minAgeMilliseconds minimum heartbeat age (time elapsed since the last heartbeat, in milliseconds) to clear.
639
647
* @param maxIteration safety valve to limit number of items to check. Typically set to zero to keep unlimited
640
648
* @return number of cleared heartbeats
641
649
*/
@@ -956,7 +964,6 @@ public static class IndexingPolicy {
0 commit comments