Skip to main content

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

Class: SlicerExecutionContext

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

Parameters

ParameterType
configExecutionContextConfig

Returns

SlicerExecutionContext

Overrides

default.constructor

Source

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

Properties

_loader

protected readonly _loader: OperationLoader

Inherited from

default._loader

Source

packages/job-components/src/execution-context/base.ts:30


_methodRegistry

protected _methodRegistry: Map<keyof SlicerOperationLifeCycle, Set<number>>

Inherited from

default._methodRegistry

Source

packages/job-components/src/execution-context/base.ts:32


_operations

protected readonly _operations: Set<SlicerOperationLifeCycle>

Inherited from

default._operations

Source

packages/job-components/src/execution-context/base.ts:31


assetIds

readonly assetIds: string[] = []

Inherited from

default.assetIds

Source

packages/job-components/src/execution-context/base.ts:20


config

readonly config: ExecutionConfig

Inherited from

default.config

Source

packages/job-components/src/execution-context/base.ts:17


context

readonly context: Context

Inherited from

default.context

Source

packages/job-components/src/execution-context/base.ts:18


events

readonly events: EventEmitter<DefaultEventMap>

The terafoundation EventEmitter

Inherited from

default.events

Source

packages/job-components/src/execution-context/base.ts:26


exId

readonly exId: string

Inherited from

default.exId

Source

packages/job-components/src/execution-context/base.ts:22


jobId

readonly jobId: string

Inherited from

default.jobId

Source

packages/job-components/src/execution-context/base.ts:23


logger

readonly logger: Logger

Inherited from

default.logger

Source

packages/job-components/src/execution-context/base.ts:28

Accessors

api

get api(): ExecutionContextAPI

Returns

ExecutionContextAPI

Source

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


apis

get apis(): JobAPIInstances

Returns

JobAPIInstances

Source

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

Methods

_resetMethodRegistry()

protected _resetMethodRegistry(): void

Returns

void

Inherited from

default._resetMethodRegistry

Source

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


_runMethod()

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

Run an method

Parameters

ParameterType
methodkeyof SlicerOperationLifeCycle
...argsany[]

Returns

void

Inherited from

default._runMethod

Source

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


_runMethodAsync()

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

Run an async method on the operation lifecycle

Parameters

ParameterType
methodkeyof SlicerOperationLifeCycle
...argsany[]

Returns

Promise<any[]>

Inherited from

default._runMethodAsync

Source

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


addOperation()

protected addOperation(op): void

Add an operation to the lifecycle queue

Parameters

ParameterType
opSlicerOperationLifeCycle

Returns

void

Inherited from

default.addOperation

Source

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


getOperations()

getOperations(): SlicerOperationLifeCycle[]

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

Returns

SlicerOperationLifeCycle[]

Inherited from

default.getOperations

Source

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


initialize()

initialize(recoveryData?): Promise<void>

Called during execution initialization

Parameters

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

Returns

Promise<void>

Implementation of

SlicerOperationLifeCycle.initialize

Overrides

default.initialize

Source

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


onExecutionStats()

onExecutionStats(stats): void

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

Source

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


onSliceComplete()

onSliceComplete(result): void

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

Source

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


onSliceDispatch()

onSliceDispatch(slice): void

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

Source

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


onSliceEnqueued()

onSliceEnqueued(slice): void

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

Source

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


shutdown()

shutdown(): Promise<void>

Called to cleanup all of the registered operations

Returns

Promise<void>

Implementation of

SlicerOperationLifeCycle.shutdown

Inherited from

default.shutdown

Source

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


slicer()

slicer<T>(): T

The instance of a "Slicer"

Type parameters

Type parameterValue
T extends default<OpConfig>default<OpConfig>

Returns

T

Source

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


createContext()

static createContext(config): Promise<SlicerExecutionContext>

Parameters

ParameterType
configExecutionContextConfig

Returns

Promise<SlicerExecutionContext>

Source

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