Skip to main content

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

Class: SlicerExecutionContext

Defined in: packages/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

new SlicerExecutionContext()

new SlicerExecutionContext(config): SlicerExecutionContext

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

Parameters

ParameterType
configExecutionContextConfig

Returns

SlicerExecutionContext

Overrides

default.constructor

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_loaderreadonlyOperationLoaderundefined-default._loaderpackages/job-components/src/execution-context/base.ts:30
_methodRegistryprotectedMap<keyof SlicerOperationLifeCycle, Set<number>>undefined-default._methodRegistrypackages/job-components/src/execution-context/base.ts:32
_operationsreadonlySet<SlicerOperationLifeCycle>undefined-default._operationspackages/job-components/src/execution-context/base.ts:31
assetIdsreadonlystring[][]-default.assetIdspackages/job-components/src/execution-context/base.ts:20
configreadonlyExecutionConfigundefined-default.configpackages/job-components/src/execution-context/base.ts:17
contextreadonlyContextundefined-default.contextpackages/job-components/src/execution-context/base.ts:18
eventsreadonlyEventEmitterundefinedThe terafoundation EventEmitterdefault.eventspackages/job-components/src/execution-context/base.ts:26
exIdreadonlystringundefined-default.exIdpackages/job-components/src/execution-context/base.ts:22
jobIdreadonlystringundefined-default.jobIdpackages/job-components/src/execution-context/base.ts:23
loggerreadonlyLoggerundefined-default.loggerpackages/job-components/src/execution-context/base.ts:28

Accessors

api

Get Signature

get api(): ExecutionContextAPI

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

Returns

ExecutionContextAPI

Inherited from

default.api


apis

Get Signature

get apis(): JobAPIInstances

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

Returns

JobAPIInstances

Methods

_resetMethodRegistry()

protected _resetMethodRegistry(): void

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

Returns

void

Inherited from

default._resetMethodRegistry


_runMethod()

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

Defined in: packages/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: packages/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: packages/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: packages/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: packages/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: packages/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 satistics

Parameters

ParameterType
statsExecutionStats

Returns

void

Implementation of

SlicerOperationLifeCycle.onExecutionStats


onSliceComplete()

onSliceComplete(result): void

Defined in: packages/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: packages/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 disptached by the execution controller

Parameters

ParameterType
sliceSlice

Returns

void

Implementation of

SlicerOperationLifeCycle.onSliceDispatch


onSliceEnqueued()

onSliceEnqueued(slice): void

Defined in: packages/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: packages/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: packages/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: packages/job-components/src/execution-context/slicer.ts:30

Parameters

ParameterType
configExecutionContextConfig

Returns

Promise<SlicerExecutionContext>