Package ome.services.fulltext
Class FullTextIndexer
- java.lang.Object
-
- ome.services.util.Executor.Descriptive
-
- ome.services.util.Executor.SimpleWork
-
- ome.services.fulltext.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 eachEventLogpassed from theEventLogLoadermultiple times on failure. Eventually- Since:
- 3.0-Beta3
-
-
Field Summary
Fields Modifier and Type Field Description protected longbatchDeprecated.protected ome.system.metrics.TimerbatchTimerDeprecated.protected ome.system.metrics.HistogramcompleteFastDeprecated.protected ome.system.metrics.HistogramcompleteSlowDeprecated.protected ome.system.OmeroContextcontextDeprecated.static intDEFAULT_REPORTING_LOOPSDeprecated.Default number of loops to wait if no external value is set.protected booleandryRunDeprecated.protected EventLogLoaderloaderDeprecated.protected ParserSessionparserSessionDeprecated.protected intreportingLoopsDeprecated.Frequency with which the percentage done should be calculated.protected intrepsDeprecated.-
Fields inherited from class ome.services.util.Executor.Descriptive
description
-
-
Constructor Summary
Constructors Constructor Description FullTextIndexer(EventLogLoader ll)Deprecated.FullTextIndexer(EventLogLoader ll, ome.system.metrics.Metrics metrics)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.ClassasClassOrNull(java.lang.String str)Deprecated.intdoIndexing(org.hibernate.search.FullTextSession session)Deprecated.booleandoMore(int count)Deprecated.Default implementation suggests doing more if fewer thanrepsruns have been made and if there are still more thanEventLogLoader.batchSizex 100 backlog entries.java.lang.ObjectdoWork(org.hibernate.Session session, ome.system.ServiceFactory sf)Deprecated.RunsdoIndexing(FullTextSession)within a Lucene transaction.protected ome.model.IObjectget(org.hibernate.Session session, java.lang.Class type, long id)Deprecated.protected voidhandleEventLog(org.hibernate.search.FullTextSession session, ome.model.meta.EventLog eventLog)Deprecated.voidsetApplicationContext(org.springframework.context.ApplicationContext ctx)Deprecated.voidsetDryRun(boolean dryRun)Deprecated.voidsetRepetitions(int reps)Deprecated.Spring injector.voidsetReportingLoops(int loops)Deprecated.voidsetSqlAction(ome.util.SqlAction sql)Deprecated.Since these instances are used repeatedly, we need to check for already set SqlAction-
Methods inherited from class ome.services.util.Executor.SimpleWork
getSqlAction
-
Methods inherited from class ome.services.util.Executor.Descriptive
description
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ome.services.util.Executor.LoggedWork
description
-
-
-
-
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
-
loader
protected final EventLogLoader loader
Deprecated.
-
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:
setApplicationContextin interfaceorg.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:
setSqlActionin classExecutor.SimpleWork
-
doWork
@Transactional(readOnly=false, isolation=SERIALIZABLE) public java.lang.Object doWork(org.hibernate.Session session, ome.system.ServiceFactory sf)Deprecated.RunsdoIndexing(FullTextSession)within a Lucene transaction.doIndexing(FullTextSession)will also be called- Specified by:
doWorkin interfaceExecutor.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 thanrepsruns have been made and if there are still more thanEventLogLoader.batchSizex 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.
-
-