Package ch.rswk.meta.engine
Class AbstractEngineWorkQueueService<C,T,R>
java.lang.Object
com.google.common.util.concurrent.AbstractExecutionThreadService
ch.rswk.meta.engine.AbstractEngineExecutionThreadService<C>
ch.rswk.meta.engine.AbstractEngineWorkQueueService<C,T,R>
- All Implemented Interfaces:
EngineServices.ConfigurableService<C>,EngineServices.InfoProvidingService,com.google.common.util.concurrent.Service
- Direct Known Subclasses:
LuceneService
public abstract class AbstractEngineWorkQueueService<C,T,R>
extends AbstractEngineExecutionThreadService<C>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classstatic enumprivate static final recordNested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprivate com.codahale.metrics.Meterprotected final longprivate static final AbstractEngineWorkQueueService.WorkUnitWrapperprivate com.codahale.metrics.Meterprivate com.codahale.metrics.Timerprotected final Stringprotected final AbstractEngineWorkQueueService.ShutdownTypeprivate static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate static final Protocol.ErrorReplyFactoryprivate com.codahale.metrics.TimerFields inherited from class ch.rswk.meta.engine.AbstractEngineExecutionThreadService
runtime -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEngineWorkQueueService(int capacity, C config, long offerTimeout, EngineRuntime runtime, @Nullable String serviceId, AbstractEngineWorkQueueService.ShutdownType shutdownType) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterProcessWorkUnit(T unit) protected voidbeforeProcessWorkUnit(T unit) protected intprotected intprotected com.google.common.util.concurrent.ListenableFuture<R> offerWorkUnit(T unit) protected abstract RprocessWorkUnit(T unit) protected voidrun()protected Stringprotected voidstartUp()protected voidMethods inherited from class ch.rswk.meta.engine.AbstractEngineExecutionThreadService
configClass, configReference, shutDownMethods inherited from class com.google.common.util.concurrent.AbstractExecutionThreadService
addListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, startAsync, state, stopAsync, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.rswk.meta.engine.EngineServices.ConfigurableService
config, onConfigChangedMethods inherited from interface ch.rswk.meta.engine.EngineServices.InfoProvidingService
getServiceInfo
-
Field Details
-
POISON_UNIT
-
WORK_QUEUE_ERROR
-
WORK_QUEUE_FULL_ERROR
-
WORK_UNIT_ERROR
-
capacity
protected final int capacity -
offerTimeout
protected final long offerTimeout -
serviceId
-
shutdownType
-
workQueue
-
offerErrorMeter
private com.codahale.metrics.Meter offerErrorMeter -
processErrorMeter
private com.codahale.metrics.Meter processErrorMeter -
processTimer
private com.codahale.metrics.Timer processTimer -
workUnitTimer
private com.codahale.metrics.Timer workUnitTimer
-
-
Constructor Details
-
AbstractEngineWorkQueueService
public AbstractEngineWorkQueueService(int capacity, C config, long offerTimeout, EngineRuntime runtime, @Nullable String serviceId, AbstractEngineWorkQueueService.ShutdownType shutdownType)
-
-
Method Details
-
startUp
- Overrides:
startUpin classAbstractEngineExecutionThreadService<C>- Throws:
Exception
-
triggerShutdown
protected void triggerShutdown()- Overrides:
triggerShutdownin classcom.google.common.util.concurrent.AbstractExecutionThreadService
-
offerWorkUnit
-
getRemainingCapacity
protected int getRemainingCapacity() -
getCapacityThreshold
protected int getCapacityThreshold() -
run
- Specified by:
runin classcom.google.common.util.concurrent.AbstractExecutionThreadService- Throws:
Exception
-
beforeProcessWorkUnit
-
processWorkUnit
- Throws:
ErrorReplyException
-
afterProcessWorkUnit
-
serviceName
- Overrides:
serviceNamein classAbstractEngineExecutionThreadService<C>
-