Package ome.services.search
Class IndexWatcher
- java.lang.Object
-
- ome.services.search.IndexWatcher
-
public class IndexWatcher extends java.lang.Object
The index watcher writes REINDEX entries to the event log and waits for the indexing thread to process them. It operates within Blitz but outside its transaction handling so that the communication with the Indexer thread can occur while the update service waits inside theUpdateImpl.indexObject(IObject)
transaction.- Since:
- 5.5.0
-
-
Constructor Summary
Constructors Constructor Description IndexWatcher(javax.sql.DataSource dataSource, java.lang.String countKey)
Construct a new index watcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.Semaphore
indexObject(ome.model.IObject object, long userId, long groupId, long sessionId)
Index the given object.void
poll()
Check for new objects to index and for progress with indexing past objects.
-
-
-
Constructor Detail
-
IndexWatcher
public IndexWatcher(javax.sql.DataSource dataSource, java.lang.String countKey)
Construct a new index watcher.- Parameters:
dataSource
- the data source to be used for JDBC access to the databasecountKey
- the name of the configuration key for tracking progress through the event log
-
-
Method Detail
-
poll
public void poll()
Check for new objects to index and for progress with indexing past objects.
-
indexObject
public java.util.concurrent.Semaphore indexObject(ome.model.IObject object, long userId, long groupId, long sessionId)
Index the given object.- Parameters:
object
- the object to index, may be unloadeduserId
- the user to record for the reindexing requestgroupId
- the group to record for the reindexing requestsessionId
- the session to record for the reindexing request- Returns:
- a semaphore that is released only after the indexer has processed the request
-
-