Class FullTextIndexer

  • All Implemented Interfaces:
    Executor.LoggedWork, Executor.Work, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    @Deprecated
    public class FullTextIndexer
    extends Executor.SimpleWork
    implements org.springframework.context.ApplicationContextAware
    Deprecated.
    Simple action which can be done in an asynchronous thread in order to index Hibernate entities. Attempts to index each EventLog passed from the EventLogLoader multiple times on failure. Eventually
    Since:
    3.0-Beta3
    • Field Detail

      • DEFAULT_REPORTING_LOOPS

        public static final int DEFAULT_REPORTING_LOOPS
        Deprecated.
        Default number of loops to wait if no external value is set.
        See Also:
        Constant Field Values
      • parserSession

        protected final ParserSession parserSession
        Deprecated.
      • batchTimer

        protected final ome.system.metrics.Timer batchTimer
        Deprecated.
      • completeSlow

        protected final ome.system.metrics.Histogram completeSlow
        Deprecated.
      • completeFast

        protected final ome.system.metrics.Histogram completeFast
        Deprecated.
      • reps

        protected int reps
        Deprecated.
      • batch

        protected long batch
        Deprecated.
      • reportingLoops

        protected int reportingLoops
        Deprecated.
        Frequency with which the percentage done should be calculated.
      • dryRun

        protected boolean dryRun
        Deprecated.
      • context

        protected ome.system.OmeroContext context
        Deprecated.
    • Constructor Detail

      • FullTextIndexer

        public FullTextIndexer​(EventLogLoader ll)
        Deprecated.
      • FullTextIndexer

        public FullTextIndexer​(EventLogLoader ll,
                               ome.system.metrics.Metrics metrics)
        Deprecated.
    • Method Detail

      • setRepetitions

        public void setRepetitions​(int reps)
        Deprecated.
        Spring injector. Sets the number of indexing runs will be made if there is a substantial backlog.
      • setReportingLoops

        public void setReportingLoops​(int loops)
        Deprecated.
      • setDryRun

        public void setDryRun​(boolean dryRun)
        Deprecated.
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext ctx)
        Deprecated.
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
      • setSqlAction

        public void setSqlAction​(ome.util.SqlAction sql)
        Deprecated.
        Since these instances are used repeatedly, we need to check for already set SqlAction
        Overrides:
        setSqlAction in class Executor.SimpleWork
      • doWork

        @Transactional(readOnly=false,
                       isolation=SERIALIZABLE)
        public java.lang.Object doWork​(org.hibernate.Session session,
                                       ome.system.ServiceFactory sf)
        Deprecated.
        Runs doIndexing(FullTextSession) within a Lucene transaction. doIndexing(FullTextSession) will also be called
        Specified by:
        doWork in interface Executor.Work
        Parameters:
        session - non null.
        sf - non null.
        Returns:
        Any results which will be used by non-wrapped code.
      • doIndexing

        public int doIndexing​(org.hibernate.search.FullTextSession session)
        Deprecated.
      • handleEventLog

        protected void handleEventLog​(org.hibernate.search.FullTextSession session,
                                      ome.model.meta.EventLog eventLog)
        Deprecated.
      • doMore

        public boolean doMore​(int count)
        Deprecated.
        Default implementation suggests doing more if fewer than reps runs have been made and if there are still more than EventLogLoader.batchSize x 100 backlog entries. This is based on the assumption that indexing runs roughly 120 times an hour, so if there are more than an hours worth of batches, do extra work to catch up.
      • asClassOrNull

        protected java.lang.Class asClassOrNull​(java.lang.String str)
        Deprecated.
      • get

        protected ome.model.IObject get​(org.hibernate.Session session,
                                        java.lang.Class type,
                                        long id)
        Deprecated.