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 eachEventLog
passed from theEventLogLoader
multiple times on failure. Eventually- Since:
- 3.0-Beta3
-
-
Field Summary
Fields Modifier and Type Field Description protected long
batch
Deprecated.protected ome.system.metrics.Timer
batchTimer
Deprecated.protected ome.system.metrics.Histogram
completeFast
Deprecated.protected ome.system.metrics.Histogram
completeSlow
Deprecated.protected ome.system.OmeroContext
context
Deprecated.static int
DEFAULT_REPORTING_LOOPS
Deprecated.Default number of loops to wait if no external value is set.protected boolean
dryRun
Deprecated.protected EventLogLoader
loader
Deprecated.protected ParserSession
parserSession
Deprecated.protected int
reportingLoops
Deprecated.Frequency with which the percentage done should be calculated.protected int
reps
Deprecated.-
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.Class
asClassOrNull(java.lang.String str)
Deprecated.int
doIndexing(org.hibernate.search.FullTextSession session)
Deprecated.boolean
doMore(int count)
Deprecated.Default implementation suggests doing more if fewer thanreps
runs have been made and if there are still more thanEventLogLoader.batchSize
x 100 backlog entries.java.lang.Object
doWork(org.hibernate.Session session, ome.system.ServiceFactory sf)
Deprecated.RunsdoIndexing(FullTextSession)
within a Lucene transaction.protected ome.model.IObject
get(org.hibernate.Session session, java.lang.Class type, long id)
Deprecated.protected void
handleEventLog(org.hibernate.search.FullTextSession session, ome.model.meta.EventLog eventLog)
Deprecated.void
setApplicationContext(org.springframework.context.ApplicationContext ctx)
Deprecated.void
setDryRun(boolean dryRun)
Deprecated.void
setRepetitions(int reps)
Deprecated.Spring injector.void
setReportingLoops(int loops)
Deprecated.void
setSqlAction(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:
setApplicationContext
in 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:
setSqlAction
in 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:
doWork
in 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 thanreps
runs have been made and if there are still more thanEventLogLoader.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.
-
-