Skip to main content

@terascope/job-components / operations/parallel-slicer / default

Class: abstract default<T>

A varient of a "Slicer" for running a parallel stream of slicers.

See [[SlicerCore]] for more informartion

Extends

Type parameters

Type parameterValue
TOpConfig

Constructors

new default()

new default<T>(context, opConfig, executionConfig): default<T>

Parameters

ParameterType
contextContext
opConfigOpConfig & T
executionConfigExecutionConfig

Returns

default<T>

Inherited from

default.constructor

Source

packages/job-components/src/operations/core/slicer-core.ts:30

Properties

_slicers

protected _slicers: SlicerObj[] = []

Source

packages/job-components/src/operations/parallel-slicer.ts:14


context

readonly context: Readonly<Context>

Inherited from

default.context

Source

packages/job-components/src/operations/core/core.ts:10


events

readonly events: EventEmitter<DefaultEventMap>

Inherited from

default.events

Source

packages/job-components/src/operations/core/core.ts:13


executionConfig

readonly executionConfig: Readonly<ExecutionConfig>

Inherited from

default.executionConfig

Source

packages/job-components/src/operations/core/core.ts:11


logger

readonly logger: Logger

Inherited from

default.logger

Source

packages/job-components/src/operations/core/core.ts:12


opConfig

protected readonly opConfig: Readonly<OpConfig & T>

Inherited from

default.opConfig

Source

packages/job-components/src/operations/core/slicer-core.ts:27


recoveryData

protected recoveryData: SlicerRecoveryData[]

Inherited from

default.recoveryData

Source

packages/job-components/src/operations/core/slicer-core.ts:26


stats

protected stats: ExecutionStats

Inherited from

default.stats

Source

packages/job-components/src/operations/core/slicer-core.ts:25

Accessors

isFinished

get isFinished(): boolean

Returns

boolean

Source

packages/job-components/src/operations/parallel-slicer.ts:81


workersConnected

get protected workersConnected(): number

Returns

number

Source

packages/job-components/src/operations/core/slicer-core.ts:176

Methods

canComplete()

protected canComplete(): boolean

Returns

boolean

Inherited from

default.canComplete

Source

packages/job-components/src/operations/core/slicer-core.ts:172


createAPI()

createAPI<A>(name, ...params): Promise<A>

Create an API and add it to the operation lifecycle

Type parameters

Type parameterValue
A extends OpAPIOpAPI

Parameters

ParameterType
namestring
...paramsany[]

Returns

Promise<A>

Inherited from

default.createAPI

Source

packages/job-components/src/operations/core/slicer-core.ts:67


createSlice()

createSlice(input, order, id): void

Create a Slice object from a slice request. In the case of recovery the "Slice" already has the required This will be enqueued and dequeued by the "Execution Controller"

Parameters

ParameterTypeDefault value
inputSliceRequest | Sliceundefined
ordernumberundefined
idnumber0

Returns

void

Inherited from

default.createSlice

Source

packages/job-components/src/operations/core/slicer-core.ts:95


getAPI()

getAPI<A>(name): A

Get a reference to an existing API

Type parameters

Type parameterValue
A extends OpAPIOpAPI

Parameters

ParameterType
namestring

Returns

A

Inherited from

default.getAPI

Source

packages/job-components/src/operations/core/slicer-core.ts:74


getSlice()

getSlice(): null | Slice

A method called by the "Execution Controller" to dequeue a created "Slice"

Returns

null | Slice

Inherited from

default.getSlice

Source

packages/job-components/src/operations/core/slicer-core.ts:112


getSlices()

getSlices(max): Slice[]

A method called by the "Execution Controller" to dequeue many created slices

Parameters

ParameterType
maxnumber

Returns

Slice[]

Inherited from

default.getSlices

Source

packages/job-components/src/operations/core/slicer-core.ts:121


handle()

handle(): Promise<boolean>

A generic method called by the Teraslice framework to a give a "Slicer" the ability to handle creating slices.

Returns

Promise<boolean>

a boolean depending on whether the slicer is done

Overrides

default.handle

Source

packages/job-components/src/operations/parallel-slicer.ts:61


initialize()

initialize(recoveryData): Promise<void>

Register the different Slicer instances

See [[SlicerCore#initialize]]

Parameters

ParameterType
recoveryDataSlicerRecoveryData[]

Returns

Promise<void>

Overrides

default.initialize

Source

packages/job-components/src/operations/parallel-slicer.ts:21


isRecoverable()

isRecoverable(): boolean

Used to indicate whether this slicer is recoverable.

Returns

boolean

Inherited from

default.isRecoverable

Source

packages/job-components/src/operations/core/slicer-core.ts:146


isRelocatable()

isRelocatable(): boolean

Used to indicate whether this slicer is relocatable. Only relevant for kubernetesV2 backend

Returns

boolean

Inherited from

default.isRelocatable

Source

packages/job-components/src/operations/core/slicer-core.ts:154


maxQueueLength()

maxQueueLength(): number

Used to determine the maximum number of slices queued. Defaults to 10000 NOTE: if you want to base of the number of workers use #workersConnected

Returns

number

Inherited from

default.maxQueueLength

Source

packages/job-components/src/operations/core/slicer-core.ts:164


newSlicer()

abstract newSlicer(id): Promise<undefined | SlicerFn>

Called by ParallelSlicer#handle for every count of slicers in the ExecutionConfig

Parameters

ParameterType
idnumber

Returns

Promise<undefined | SlicerFn>

a function which will be called in parallel

Source

packages/job-components/src/operations/parallel-slicer.ts:55


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

Inherited from

default.onExecutionStats

Source

packages/job-components/src/operations/core/slicer-core.ts:168


shutdown()

shutdown(): Promise<void>

Cleanup the slicers functions

See [[SlicerCore#shutdown]]

Returns

Promise<void>

Overrides

default.shutdown

Source

packages/job-components/src/operations/parallel-slicer.ts:46


sliceCount()

sliceCount(): number

The number of enqueued slices

Returns

number

Inherited from

default.sliceCount

Source

packages/job-components/src/operations/core/slicer-core.ts:139


slicers()

slicers(): number

Return the number of registered slicers

Returns

number

Overrides

default.slicers

Source

packages/job-components/src/operations/parallel-slicer.ts:57