Interface MassIdentifierLoader
- All Superinterfaces:
AutoCloseable
A loader for mass loading of entity identifiers, used in particular during mass indexing.
If the total count of identifiers to load is unknown, totalCount()
should remain unimplemented,
i.e. return an empty optional. This will let the mass indexer know to increment the total on each new batch loaded instead
of relying on the total being provided before the indexing starts.
The loading of the identifiers is considered as finished when MassIdentifierSink.complete()
is called
from the loadNext()
.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes thisMassIdentifierLoader
.void
loadNext()
Loads one batch of identifiers and adds them to the sink, or callsMassIdentifierSink.complete()
to notify the caller that there are no more identifiers to load.default OptionalLong
-
Method Details
-
close
void close()Closes thisMassIdentifierLoader
.- Specified by:
close
in interfaceAutoCloseable
-
loadNext
Loads one batch of identifiers and adds them to the sink, or callsMassIdentifierSink.complete()
to notify the caller that there are no more identifiers to load.Calls to the sink must be performed synchronously (before this method returns).
- Throws:
InterruptedException
- If the thread was interrupted while performing I/O operations. This will lead to aborting mass indexing completely.
-
totalCount
- Returns:
- The total count of identifiers expected to be loaded.
-