public class MassIndexerImpl extends Object implements MassIndexerWithTenant
Modifier and Type | Field and Description |
---|---|
protected Set<Class<?>> |
rootEntities |
Modifier | Constructor and Description |
---|---|
protected |
MassIndexerImpl(org.hibernate.search.spi.SearchIntegrator searchIntegrator,
SessionFactoryImplementor sessionFactory,
Class<?>... entities) |
Modifier and Type | Method and Description |
---|---|
MassIndexer |
batchSizeToLoadObjects(int batchSize)
Sets the batch size used to load the root entities.
|
MassIndexer |
cacheMode(CacheMode cacheMode)
Sets the cache interaction mode for the data loading tasks.
|
protected BatchCoordinator |
createCoordinator() |
MassIndexer |
idFetchSize(int idFetchSize)
Specifies the fetch size to be used when loading primary keys
if objects to be indexed.
|
MassIndexer |
limitIndexedObjectsTo(long maximum)
EXPERIMENTAL method: will probably change
Will stop indexing after having indexed a set amount of objects.
|
MassIndexer |
optimizeAfterPurge(boolean optimize)
If index optimization should be run before starting,
after the purgeAll.
|
MassIndexer |
optimizeOnFinish(boolean optimize)
If index optimization has to be started at the end of the indexing process.
|
MassIndexer |
progressMonitor(org.hibernate.search.batchindexing.MassIndexerProgressMonitor monitor)
Override the default
MassIndexerProgressMonitor . |
MassIndexer |
purgeAllOnStart(boolean purgeAll)
If all entities should be removed from the index before starting
using purgeAll.
|
Future<?> |
start()
Starts the indexing process in background (asynchronous).
|
void |
startAndWait()
Starts the indexing process, and then block until it's finished.
|
MassIndexerWithTenant |
tenantIdentifier(String tenantIdentifier)
Set the tenant that is associated to this
MassIndexer . |
MassIndexer |
threadsForSubsequentFetching(int numberOfThreads)
Deprecated.
|
MassIndexer |
threadsToLoadObjects(int numberOfThreads)
Set the number of threads to be used to load
the root entities.
|
MassIndexer |
transactionTimeout(int timeoutInSeconds)
Timeout of transactions for loading ids and entities to be re-indexed.
|
MassIndexer |
typesToIndexInParallel(int numberOfThreads)
Sets the number of entity types to be indexed in parallel.
|
protected MassIndexerImpl(org.hibernate.search.spi.SearchIntegrator searchIntegrator, SessionFactoryImplementor sessionFactory, Class<?>... entities)
public MassIndexer typesToIndexInParallel(int numberOfThreads)
MassIndexer
typesToIndexInParallel
in interface MassIndexer
numberOfThreads
- number of entity types to be indexed in parallelpublic MassIndexer cacheMode(CacheMode cacheMode)
MassIndexer
cacheMode
in interface MassIndexer
cacheMode
- the cache interaction modepublic MassIndexer threadsToLoadObjects(int numberOfThreads)
MassIndexer
threadsToLoadObjects
in interface MassIndexer
numberOfThreads
- the number of threadspublic MassIndexer batchSizeToLoadObjects(int batchSize)
MassIndexer
batchSizeToLoadObjects
in interface MassIndexer
batchSize
- the batch size@Deprecated public MassIndexer threadsForSubsequentFetching(int numberOfThreads)
MassIndexer
threadsForSubsequentFetching
in interface MassIndexer
numberOfThreads
- the number of threadspublic MassIndexer progressMonitor(org.hibernate.search.batchindexing.MassIndexerProgressMonitor monitor)
MassIndexer
MassIndexerProgressMonitor
.progressMonitor
in interface MassIndexer
monitor
- this instance will receive updates about the massindexing progress.public MassIndexer optimizeOnFinish(boolean optimize)
MassIndexer
optimizeOnFinish
in interface MassIndexer
optimize
- true
to enable the index optimization at the end of the indexing processpublic MassIndexer optimizeAfterPurge(boolean optimize)
MassIndexer
optimizeAfterPurge
in interface MassIndexer
optimize
- true
to enable the index optimization after purgepublic MassIndexer purgeAllOnStart(boolean purgeAll)
MassIndexer
purgeAllOnStart
in interface MassIndexer
purgeAll
- if true
all entities will be removed from the index before starting the indexingpublic MassIndexer transactionTimeout(int timeoutInSeconds)
MassIndexer
Only supported in JTA-compatible environments.
transactionTimeout
in interface MassIndexer
timeoutInSeconds
- the transaction timeout in seconds; If no value is given, the global default timeout of
the JTA environment applies.this
for method chainingpublic MassIndexerWithTenant tenantIdentifier(String tenantIdentifier)
MassIndexerWithTenant
MassIndexer
.tenantIdentifier
in interface MassIndexerWithTenant
tenantIdentifier
- the identifier of the tenant associated this MassIndexer
public Future<?> start()
MassIndexer
start
in interface MassIndexer
public void startAndWait() throws InterruptedException
MassIndexer
startAndWait
in interface MassIndexer
InterruptedException
- if the current thread is interrupted
while waiting.protected BatchCoordinator createCoordinator()
public MassIndexer limitIndexedObjectsTo(long maximum)
MassIndexer
limitIndexedObjectsTo
in interface MassIndexer
maximum
- the maximum number of objects to indexpublic MassIndexer idFetchSize(int idFetchSize)
MassIndexer
Integer.MIN_VALUE
otherwise it will attempt to preload everything in memory.idFetchSize
in interface MassIndexer
idFetchSize
- the fetch size to be used when loading primary keysCopyright © 2016 JBoss by Red Hat. All rights reserved.