Class 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 the UpdateImpl.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 database
        countKey - 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 unloaded
        userId - the user to record for the reindexing request
        groupId - the group to record for the reindexing request
        sessionId - the session to record for the reindexing request
        Returns:
        a semaphore that is released only after the indexer has processed the request