Package org.fcrepo.persistence.ocfl.impl
Class ReindexManager
- java.lang.Object
-
- org.fcrepo.persistence.ocfl.impl.ReindexManager
-
public class ReindexManager extends Object
Class to coordinate the index rebuilding tasks.- Since:
- 6.0.0
- Author:
- whikloj
-
-
Constructor Summary
Constructors Constructor Description ReindexManager(Stream<String> ids, ReindexService reindexService, OcflPropsConfig config, TransactionManager manager, DbTransactionExecutor dbTransactionExecutor)
Basic constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCompletedCount()
int
getErrorCount()
List<String>
getIds()
Return a batch of OCFL ids to reindex.void
shutdown()
Close stream.void
start()
Start reindexing.void
stop()
Stop all threads.void
updateComplete(int batchSuccessful, int batchErrors)
Update the master list of reindexing states.
-
-
-
Constructor Detail
-
ReindexManager
public ReindexManager(Stream<String> ids, ReindexService reindexService, OcflPropsConfig config, TransactionManager manager, DbTransactionExecutor dbTransactionExecutor)
Basic constructor- Parameters:
ids
- stream of ocfl ids.reindexService
- the reindexing service.config
- OCFL property config object.manager
- the transaction manager object.dbTransactionExecutor
- manages db transactions
-
-
Method Detail
-
start
public void start() throws InterruptedException
Start reindexing.- Throws:
InterruptedException
- on an indexing error in a thread.
-
stop
public void stop()
Stop all threads.
-
getIds
public List<String> getIds()
Return a batch of OCFL ids to reindex.- Returns:
- list of OCFL ids.
-
updateComplete
public void updateComplete(int batchSuccessful, int batchErrors)
Update the master list of reindexing states.- Parameters:
batchSuccessful
- how many items were completed successfully in the last batch.batchErrors
- how many items had an error in the last batch.
-
getCompletedCount
public int getCompletedCount()
- Returns:
- the count of items that completed successfully.
-
getErrorCount
public int getErrorCount()
- Returns:
- the count of items that had errors.
-
shutdown
public void shutdown()
Close stream.
-
-