Skip to main content

@terascope/job-components / execution-context/slicer / SlicerExecutionContext

Class: SlicerExecutionContext

Defined in: job-components/src/execution-context/slicer.ts:15

SlicerExecutionContext is designed to add more functionality to interface with the Execution Configuration and any Operation.

Extends​

Implements​

Constructors​

Constructor​

new SlicerExecutionContext(config): SlicerExecutionContext

Defined in: job-components/src/execution-context/slicer.ts:21

Parameters​

ParameterType
configExecutionContextConfig

Returns​

SlicerExecutionContext

Overrides​

default.constructor

Properties​

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_loaderreadonlyOperationLoaderundefined-default._loaderjob-components/src/execution-context/base.ts:30
_methodRegistryprotectedMap<keyof SlicerOperationLifeCycle, Set<number>>undefined-default._methodRegistryjob-components/src/execution-context/base.ts:32
_operationsreadonlySet<SlicerOperationLifeCycle>undefined-default._operationsjob-components/src/execution-context/base.ts:31
assetIdsreadonlystring[][]-default.assetIdsjob-components/src/execution-context/base.ts:20
configreadonlyExecutionConfigundefined-default.configjob-components/src/execution-context/base.ts:17
contextreadonlyContextundefined-default.contextjob-components/src/execution-context/base.ts:18
eventsreadonlyEventEmitterundefinedThe terafoundation EventEmitterdefault.eventsjob-components/src/execution-context/base.ts:26
exIdreadonlystringundefined-default.exIdjob-components/src/execution-context/base.ts:22
jobIdreadonlystringundefined-default.jobIdjob-components/src/execution-context/base.ts:23
loggerreadonlyLoggerundefined-default.loggerjob-components/src/execution-context/base.ts:28

Accessors​

api​

Get Signature​

get api(): ExecutionContextAPI

Defined in: job-components/src/execution-context/base.ts:130

Returns​

ExecutionContextAPI

Inherited from​

default.api


apis​

Get Signature​

get apis(): JobAPIInstances

Defined in: job-components/src/execution-context/slicer.ts:66

Returns​

JobAPIInstances

Methods​

_resetMethodRegistry()​

protected _resetMethodRegistry(): void

Defined in: job-components/src/execution-context/base.ts:182

Returns​

void

Inherited from​

default._resetMethodRegistry


_runMethod()​

protected _runMethod(method, ...args): void

Defined in: job-components/src/execution-context/base.ts:168

Run an method

Parameters​

ParameterType
methodkeyof SlicerOperationLifeCycle
...argsany[]

Returns​

void

Inherited from​

default._runMethod


_runMethodAsync()​

protected _runMethodAsync(method, ...args): Promise<any[]>

Defined in: job-components/src/execution-context/base.ts:150

Run an async method on the operation lifecycle

Parameters​

ParameterType
methodkeyof SlicerOperationLifeCycle
...argsany[]

Returns​

Promise<any[]>

Inherited from​

default._runMethodAsync


addOperation()​

protected addOperation(op): void

Defined in: job-components/src/execution-context/base.ts:143

Add an operation to the lifecycle queue

Parameters​

ParameterType
opSlicerOperationLifeCycle

Returns​

void

Inherited from​

default.addOperation


getOperations()​

getOperations(): SlicerOperationLifeCycle[]

Defined in: job-components/src/execution-context/base.ts:138

Returns a list of any registered Operation that has been initialized.

Returns​

SlicerOperationLifeCycle[]

Inherited from​

default.getOperations


initialize()​

initialize(recoveryData?): Promise<void>

Defined in: job-components/src/execution-context/slicer.ts:62

Called during execution initialization

Parameters​

ParameterTypeDescription
recoveryData?SlicerRecoveryData[]is the data to recover from

Returns​

Promise<void>

Implementation of​

SlicerOperationLifeCycle.initialize

Overrides​

default.initialize


onExecutionStats()​

onExecutionStats(stats): void

Defined in: job-components/src/execution-context/slicer.ts:75

A method called by the "Execution Controller" to give a "Slicer" the opportunity to track various slicer statistics

Parameters​

ParameterType
statsExecutionStats

Returns​

void

Implementation of​

SlicerOperationLifeCycle.onExecutionStats


onSliceComplete()​

onSliceComplete(result): void

Defined in: job-components/src/execution-context/slicer.ts:87

A method called by the "Execution Controller" to give a "Slicer" the opportunity to track the slices completed by the execution controller

Parameters​

ParameterType
resultSliceResult

Returns​

void

Implementation of​

SlicerOperationLifeCycle.onSliceComplete


onSliceDispatch()​

onSliceDispatch(slice): void

Defined in: job-components/src/execution-context/slicer.ts:83

A method called by the "Execution Controller" to give a "Slicer" the opportunity to track the slices dispatched by the execution controller

Parameters​

ParameterType
sliceSlice

Returns​

void

Implementation of​

SlicerOperationLifeCycle.onSliceDispatch


onSliceEnqueued()​

onSliceEnqueued(slice): void

Defined in: job-components/src/execution-context/slicer.ts:79

A method called by the "Execution Controller" to give a "Slicer" the opportunity to track the slices enqueued by the execution controller

Parameters​

ParameterType
sliceSlice

Returns​

void

Implementation of​

SlicerOperationLifeCycle.onSliceEnqueued


shutdown()​

shutdown(): Promise<void>

Defined in: job-components/src/execution-context/base.ts:103

Called to cleanup all of the registered operations

Returns​

Promise<void>

Implementation of​

SlicerOperationLifeCycle.shutdown

Inherited from​

default.shutdown


slicer()​

slicer<T>(): T

Defined in: job-components/src/execution-context/slicer.ts:71

The instance of a "Slicer"

Type Parameters​

Type ParameterDefault type
T extends default<OpConfig>default<OpConfig>

Returns​

T


createContext()​

static createContext(config): Promise<SlicerExecutionContext>

Defined in: job-components/src/execution-context/slicer.ts:30

Parameters​

ParameterType
configExecutionContextConfig

Returns​

Promise<SlicerExecutionContext>