Package ome.services.fulltext
Class FullTextIndexer2
- java.lang.Object
-
- ome.services.fulltext.FullTextIndexer2
-
public class FullTextIndexer2 extends java.lang.Object
An indexer bean replacing the 5.4 full-text threadFullTextIndexer
with adequate functionality. Exists as a stand-in while Hibernate / Spring upgrade issues remain unresolved.Ignores the 5.4 full-text thread's configuration properties:
omero.search.repetitions
omero.search.reporting_loops
In not using the the 5.4 event log loader also ignores:
omero.search.batch
omero.search.event_log_loader
omero.search.excludes
omero.search.max_partition_size
Further, the value of
omero.search.cron
is ignored except for that a blank value still disables the indexing thread.The
start()
andstop()
methods are the means by which Spring controls the indexing thread's lifecycle. Thestart()
method schedules the OPTMIIZE Quartz job. Interplay among the Quartz jobs is:- PREPARE
- From the event log note a batch of new activity.
- Then if there are new objects to index then trigger INDEX.
- Else if objects were deleted then trigger PURGE.
- Else if new event log entries were reviewed then trigger NOTE.
- Else if much purging has been done of some object type since its previous OPTIMIZE then trigger another.
- Else schedule PREPARE for delayed execution.
- INDEX
- If locking the field bridge fails then schedule INDEX for delayed execution then finish.
- Index a batch of objects all in the same transaction.
- If a field bridge fails then trigger INDEX_RETRY to retry one object at a time.
- Then if objects were deleted then trigger PURGE.
- Else trigger NOTE.
- INDEX_RETRY
- If locking the field bridge fails then schedule INDEX_RETRY for delayed execution then finish.
- Index a batch of objects each in its own transaction.
- Then if objects were deleted then trigger PURGE.
- Else trigger NOTE.
- PURGE
- If locking the field bridge fails then schedule PURGE for delayed execution then finish.
- Purge a batch of objects.
- Then trigger NOTE.
- NOTE
- Write a note of progress through the event log back to the database.
- Then trigger PREPARE.
- OPTIMIZE
- If much purging has been done of some object type since the previous OPTIMIZE then optimize its index.
- Else optimize the whole search index.
- Then trigger PREPARE.
- Since:
- 5.5.0
-
-
Constructor Summary
Constructors Constructor Description FullTextIndexer2(org.quartz.Scheduler scheduler, org.hibernate.SessionFactory sessionFactory, org.hibernate.search.bridge.FieldBridge bridge, java.lang.String countKey, java.lang.String actionsList, java.lang.String includeTypesList)
Construct a new indexer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
index()
Index a batch of model objects all at once.void
indexRetry()
Index a batch of model objects one by one.void
note()
Note which event log entries were processed.void
optimize()
Defragment the search index.void
prepare()
Query the database for new event log entries indicating model objects to process.void
purge()
Purge a batch of model objects.void
setCronExpression(java.lang.String cronExpression)
void
start()
Start the indexer.void
stop()
Stop the indexer.
-
-
-
Constructor Detail
-
FullTextIndexer2
public FullTextIndexer2(org.quartz.Scheduler scheduler, org.hibernate.SessionFactory sessionFactory, org.hibernate.search.bridge.FieldBridge bridge, java.lang.String countKey, java.lang.String actionsList, java.lang.String includeTypesList)
Construct a new indexer.- Parameters:
scheduler
- the Quartz scheduler for the indexing jobssessionFactory
- the Hibernate session factorybridge
- the field bridge to set when indexingcountKey
- the name of the configuration key for tracking progress through the event logactionsList
- the event log actions to take note of, comma-separatedincludeTypesList
- the names of the model object classes to index, comma-separated
-
-
Method Detail
-
setCronExpression
public void setCronExpression(java.lang.String cronExpression)
- Parameters:
cronExpression
- the cron expression configured for triggering indexing
-
start
public void start()
Start the indexer. Ongoing operation occurs via Quartz.
-
stop
public void stop()
Stop the indexer.
-
prepare
public void prepare()
Query the database for new event log entries indicating model objects to process.
-
index
public void index()
Index a batch of model objects all at once.
-
indexRetry
public void indexRetry()
Index a batch of model objects one by one.
-
purge
public void purge()
Purge a batch of model objects.
-
note
public void note()
Note which event log entries were processed.
-
optimize
public void optimize()
Defragment the search index.
-
-