@API(value=UNSTABLE) public class IndexBuildState extends Object
It first contains IndexState
. If the state is IndexState.WRITE_ONLY
, it will also contain the number
of records scanned and the estimated total number of records that need to be scanned.
Note that index build state (especially records scanned) serves an informational purpose only as the number of records scanned is not necessarily 100% of records in total when the index build completes for several reasons:
OnlineIndexer
has been configured to disable tracking progress (by setting
OnlineIndexer.Builder.setTrackProgress(boolean)
to false
), then getRecordsScanned()
will
not include the records scanned by that OnlineIndexer
. Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
IndexState |
getIndexState()
Get the index state.
|
Long |
getRecordsInTotal()
Get the estimated total number of records that need to be scanned to build the index.
|
Long |
getRecordsScanned()
Get the number of records successfully scanned and processed during the online index build process.
|
int |
hashCode() |
static CompletableFuture<IndexBuildState> |
loadIndexBuildStateAsync(FDBRecordStoreBase<?> store,
Index index)
Load the build progress (
IndexBuildState ) of the given index in the given record store asynchronously. |
static CompletableFuture<Long> |
loadRecordsScannedAsync(FDBRecordStoreBase<?> store,
Index index)
Load the number of records successfully scanned and processed during the online index build process
asynchronously.
|
String |
toString() |
@Nonnull public static CompletableFuture<IndexBuildState> loadIndexBuildStateAsync(FDBRecordStoreBase<?> store, Index index)
IndexBuildState
) of the given index in the given record store asynchronously.store
- the record store containing the indexindex
- the index needed to be checked@Nonnull public static CompletableFuture<Long> loadRecordsScannedAsync(FDBRecordStoreBase<?> store, Index index)
If the OnlineIndexer
has been configured to disable tracking progress (by setting
OnlineIndexer.Builder.setTrackProgress(boolean)
to false
), then the number returned will not
include the records scanned by that OnlineIndexer
.
store
- the record store containing the indexindex
- the index needed to be checked@Nonnull public IndexState getIndexState()
@Nullable public Long getRecordsScanned()
If the OnlineIndexer
has been configured to disable tracking progress (by setting
OnlineIndexer.Builder.setTrackProgress(boolean)
to false
), then the number returned will not
include the records scanned by that OnlineIndexer
.
The returned value should be ignored if the index state is not IndexState.WRITE_ONLY
.
See IndexBuildState
if this is used with getRecordsInTotal()
to track the index build progress.
loadRecordsScannedAsync(FDBRecordStoreBase, Index)
@Nullable public Long getRecordsInTotal()
To get the count, there must be a suitably grouped COUNT
type index defined. Otherwise, it returns
null
.
The returned value should be ignored if the index state is not IndexState.WRITE_ONLY
.