Package org.apache.storm.executor
Class Executor
- java.lang.Object
-
- org.apache.storm.executor.Executor
-
- All Implemented Interfaces:
Callable
,org.apache.storm.shade.org.jctools.queues.MessagePassingQueue.Consumer<Object>
,JCQueue.Consumer
- Direct Known Subclasses:
BoltExecutor
,SpoutExecutor
public abstract class Executor extends Object implements Callable, JCQueue.Consumer
-
-
Field Summary
-
Method Summary
-
-
-
Field Detail
-
workerData
protected final WorkerState workerData
-
workerTopologyContext
protected final WorkerTopologyContext workerTopologyContext
-
componentId
protected final String componentId
-
openOrPrepareWasCalled
protected final AtomicBoolean openOrPrepareWasCalled
-
stormId
protected final String stormId
-
sharedExecutorData
protected final HashMap sharedExecutorData
-
workerReady
protected final CountDownLatch workerReady
-
stormActive
protected final AtomicBoolean stormActive
-
stormComponentDebug
protected final AtomicReference<Map<String,DebugOptions>> stormComponentDebug
-
suicideFn
protected final Runnable suicideFn
-
stormClusterState
protected final IStormClusterState stormClusterState
-
intervalToTaskToMetricToRegistry
protected final Map<Integer,Map<Integer,Map<String,IMetric>>> intervalToTaskToMetricToRegistry
-
streamToComponentToGrouper
protected final Map<String,Map<String,LoadAwareCustomStreamGrouping>> streamToComponentToGrouper
-
groupers
protected final List<LoadAwareCustomStreamGrouping> groupers
-
reportErrorDie
protected final ReportErrorAndDie reportErrorDie
-
sampler
protected final BooleanSupplier sampler
-
type
protected final String type
-
reportError
protected final IReportError reportError
-
rand
protected final Random rand
-
receiveQueue
protected final JCQueue receiveQueue
-
isDebug
protected final Boolean isDebug
-
hasEventLoggers
protected final Boolean hasEventLoggers
-
ackingEnabled
protected final boolean ackingEnabled
-
pendingEmits
protected final org.apache.storm.shade.org.jctools.queues.MpscChunkedArrayQueue<AddressedTuple> pendingEmits
-
executorTransfer
protected ExecutorTransfer executorTransfer
-
idToTaskBase
protected int idToTaskBase
-
hostname
protected String hostname
-
-
Method Detail
-
mkExecutor
public static Executor mkExecutor(WorkerState workerState, List<Long> executorId, Map<String,String> credentials)
-
getPendingEmits
public Queue<AddressedTuple> getPendingEmits()
-
execute
public ExecutorShutdown execute() throws Exception
separated from mkExecutor in order to replace executor transfer in executor data for testing.- Throws:
Exception
-
tupleActionFn
public abstract void tupleActionFn(int taskId, TupleImpl tuple) throws Exception
- Throws:
Exception
-
accept
public void accept(Object event)
- Specified by:
accept
in interfaceJCQueue.Consumer
- Specified by:
accept
in interfaceorg.apache.storm.shade.org.jctools.queues.MessagePassingQueue.Consumer<Object>
-
setNeedToRefreshCreds
public void setNeedToRefreshCreds()
-
updateExecCredsIfRequired
protected void updateExecCredsIfRequired()
-
flush
public void flush()
- Specified by:
flush
in interfaceJCQueue.Consumer
-
setupMetrics
protected void setupMetrics()
-
setupTicks
protected void setupTicks(boolean isSpout)
-
reflectNewLoadMapping
public void reflectNewLoadMapping(LoadMapping loadMapping)
-
publishFlushTuple
public boolean publishFlushTuple()
-
getComponentId
public String getComponentId()
-
getOpenOrPrepareWasCalled
public AtomicBoolean getOpenOrPrepareWasCalled()
-
getStormId
public String getStormId()
-
getStats
public abstract CommonStats getStats()
-
getType
public String getType()
-
getIsDebug
public Boolean getIsDebug()
-
getExecutorTransfer
public ExecutorTransfer getExecutorTransfer()
-
getReportError
public IReportError getReportError()
-
getWorkerTopologyContext
public WorkerTopologyContext getWorkerTopologyContext()
-
samplerCheck
public boolean samplerCheck()
-
getStormComponentDebug
public AtomicReference<Map<String,DebugOptions>> getStormComponentDebug()
-
getReceiveQueue
public JCQueue getReceiveQueue()
-
getStormClusterState
public IStormClusterState getStormClusterState()
-
getWorkerData
public WorkerState getWorkerData()
-
getStreamToComponentToGrouper
public Map<String,Map<String,LoadAwareCustomStreamGrouping>> getStreamToComponentToGrouper()
-
getSharedExecutorData
public HashMap getSharedExecutorData()
-
getIntervalToTaskToMetricToRegistry
public Map<Integer,Map<Integer,Map<String,IMetric>>> getIntervalToTaskToMetricToRegistry()
-
setLocalExecutorTransfer
public void setLocalExecutorTransfer(ExecutorTransfer executorTransfer)
-
incrementReportedErrorCount
public void incrementReportedErrorCount()
-
-