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

  Fields
  Modifier and Type
  Field
  Description
  `protected final boolean`
  `ackingEnabled`
  `protected final String`
  `componentId`
  `protected final Map<String,Object>`
  `conf`
  `protected final Map<String,String>`
  `credentials`
  `protected final List<Long>`
  `executorId`
  `protected ExecutorTransfer`
  `executorTransfer`
  `protected final List<LoadAwareCustomStreamGrouping>`
  `groupers`
  `protected final Boolean`
  `hasEventLoggers`
  `protected String`
  `hostname`
  `protected ArrayList<Task>`
  `idToTask`
  `protected int`
  `idToTaskBase`
  `protected final Map<Integer,Map<Integer,Map<String,IMetric>>>`
  `intervalToTaskToMetricToRegistry`
  `protected final Boolean`
  `isDebug`
  `protected final AtomicBoolean`
  `openOrPrepareWasCalled`
  `protected final org.apache.storm.shade.org.jctools.queues.MpscChunkedArrayQueue<AddressedTuple>`
  `pendingEmits`
  `protected final Random`
  `rand`
  `protected final JCQueue`
  `receiveQueue`
  `protected final IReportError`
  `reportError`
  `protected final ReportErrorAndDie`
  `reportErrorDie`
  `protected final BooleanSupplier`
  `sampler`
  `protected final HashMap`
  `sharedExecutorData`
  `protected final AtomicBoolean`
  `stormActive`
  `protected final IStormClusterState`
  `stormClusterState`
  `protected final AtomicReference<Map<String,DebugOptions>>`
  `stormComponentDebug`
  `protected final String`
  `stormId`
  `protected final Map<String,Map<String,LoadAwareCustomStreamGrouping>>`
  `streamToComponentToGrouper`
  `protected final Runnable`
  `suicideFn`
  `protected final List<Integer>`
  `taskIds`
  `protected final Map<Integer,String>`
  `taskToComponent`
  `protected final Map<String,Object>`
  `topoConf`
  `protected final String`
  `type`
  `protected final WorkerState`
  `workerData`
  `protected final CountDownLatch`
  `workerReady`
  `protected final WorkerTopologyContext`
  `workerTopologyContext`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Executor(WorkerState workerData, List<Long> executorId, Map<String,String> credentials, String type)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(Object event)`
  `protected void`
  `acceptTupleAction(int taskId, TupleImpl tuple)`
  `ExecutorShutdown`
  `execute()`
  separated from mkExecutor in order to replace executor transfer in executor data for testing.
  `void`
  `flush()`
  `String`
  `getComponentId()`
  `List<Long>`
  `getExecutorId()`
  `ExecutorTransfer`
  `getExecutorTransfer()`
  `Map<Integer,Map<Integer,Map<String,IMetric>>>`
  `getIntervalToTaskToMetricToRegistry()`
  `Boolean`
  `getIsDebug()`
  `AtomicBoolean`
  `getOpenOrPrepareWasCalled()`
  `Queue<AddressedTuple>`
  `getPendingEmits()`
  `JCQueue`
  `getReceiveQueue()`
  `IReportError`
  `getReportError()`
  `HashMap`
  `getSharedExecutorData()`
  `abstract CommonStats`
  `getStats()`
  `IStormClusterState`
  `getStormClusterState()`
  `AtomicReference<Map<String,DebugOptions>>`
  `getStormComponentDebug()`
  `String`
  `getStormId()`
  `Map<String,Map<String,LoadAwareCustomStreamGrouping>>`
  `getStreamToComponentToGrouper()`
  `List<Integer>`
  `getTaskIds()`
  `Map<String,Object>`
  `getTopoConf()`
  `String`
  `getType()`
  `WorkerState`
  `getWorkerData()`
  `WorkerTopologyContext`
  `getWorkerTopologyContext()`
  `void`
  `incrementReportedErrorCount()`
  `void`
  `metricsTick(Task task, TupleImpl tuple)`
  `static Executor`
  `mkExecutor(WorkerState workerState, List<Long> executorId, Map<String,String> credentials)`
  `boolean`
  `publishFlushTuple()`
  `void`
  `reflectNewLoadMapping(LoadMapping loadMapping)`
  `boolean`
  `samplerCheck()`
  `void`
  `setLocalExecutorTransfer(ExecutorTransfer executorTransfer)`
  `void`
  `setNeedToRefreshCreds()`
  `protected void`
  `setupMetrics()`
  `protected void`
  `setupTicks(boolean isSpout)`
  `abstract void`
  `tupleActionFn(int taskId, TupleImpl tuple)`
  `protected void`
  `updateExecCredsIfRequired()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.concurrent.Callable

  `call`

- ## Field Details

  - ### workerData

    protected final WorkerState workerData

  - ### workerTopologyContext

    protected final WorkerTopologyContext workerTopologyContext

  - ### executorId

    protected final List<Long> executorId

  - ### taskIds

    protected final List<Integer> taskIds

  - ### componentId

    protected final String componentId

  - ### openOrPrepareWasCalled

    protected final AtomicBoolean openOrPrepareWasCalled

  - ### topoConf

    protected final Map<String,Object> topoConf

  - ### conf

    protected final Map<String,Object> conf

  - ### 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

  - ### taskToComponent

    protected final Map<Integer,String> taskToComponent

  - ### 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

  - ### credentials

    protected final Map<String,String> credentials

  - ### 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

  - ### idToTask

    protected ArrayList<Task> idToTask

  - ### idToTaskBase

    protected int idToTaskBase

  - ### hostname

    protected String hostname

- ## Constructor Details

  - ### Executor

    protected Executor(WorkerState workerData, List<Long> executorId, Map<String,String> credentials, String type)

- ## Method Details

  - ### 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 interface `JCQueue.Consumer`
    Specified by:
      `accept` in interface `org.apache.storm.shade.org.jctools.queues.MessagePassingQueue.Consumer<Object>`

  - ### acceptTupleAction

    protected void acceptTupleAction(int taskId, TupleImpl tuple)

  - ### setNeedToRefreshCreds

    public void setNeedToRefreshCreds()

  - ### updateExecCredsIfRequired

    protected void updateExecCredsIfRequired()

  - ### flush

    public void flush()
    Specified by:
      `flush` in interface `JCQueue.Consumer`

  - ### metricsTick

    public void metricsTick(Task task, TupleImpl tuple)

  - ### setupMetrics

    protected void setupMetrics()

  - ### setupTicks

    protected void setupTicks(boolean isSpout)

  - ### reflectNewLoadMapping

    public void reflectNewLoadMapping(LoadMapping loadMapping)

  - ### publishFlushTuple

    public boolean publishFlushTuple()

  - ### getExecutorId

    public List<Long> getExecutorId()

  - ### getTaskIds

    public List<Integer> getTaskIds()

  - ### getComponentId

    public String getComponentId()

  - ### getOpenOrPrepareWasCalled

    public AtomicBoolean getOpenOrPrepareWasCalled()

  - ### getTopoConf

    public Map<String,Object> getTopoConf()

  - ### 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()