Skip to main content

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

Abstract Class: default<T>

Defined in: job-components/src/operations/parallel-slicer.ts:13

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

See [[SlicerCore]] for more informartion

Extends​

Type Parameters​

Type ParameterDefault type
TOpConfig

Constructors​

Constructor​

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

Defined in: job-components/src/operations/core/slicer-core.ts:29

Parameters​

ParameterType
contextContext
opConfigOpConfig & T
executionConfigExecutionConfig

Returns​

ParallelSlicer<T>

Inherited from​

default.constructor

Properties​

PropertyModifierTypeDefault valueInherited fromDefined in
_slicersprotectedSlicerObj[][]-job-components/src/operations/parallel-slicer.ts:14
contextreadonlyReadonly<T>undefineddefault.contextjob-components/src/operations/core/core.ts:10
eventsreadonlyEventEmitterundefineddefault.eventsjob-components/src/operations/core/core.ts:13
executionConfigreadonlyReadonly<ExecutionConfig>undefineddefault.executionConfigjob-components/src/operations/core/core.ts:11
loggerreadonlyLoggerundefineddefault.loggerjob-components/src/operations/core/core.ts:12
opConfigreadonlyReadonly<OpConfig & T>undefineddefault.opConfigjob-components/src/operations/core/slicer-core.ts:26
recoveryDataprotectedSlicerRecoveryData[]undefineddefault.recoveryDatajob-components/src/operations/core/slicer-core.ts:25
statsprotectedExecutionStatsundefineddefault.statsjob-components/src/operations/core/slicer-core.ts:24

Accessors​

isFinished​

Get Signature​

get isFinished(): boolean

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

Returns​

boolean


workersConnected​

Get Signature​

get protected workersConnected(): number

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

Returns​

number

Inherited from​

default.workersConnected

Methods​

canComplete()​

protected canComplete(): boolean

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

Returns​

boolean

Inherited from​

default.canComplete


createAPI()​

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

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

Create an API and add it to the operation lifecycle

Type Parameters​

Type ParameterDefault type
A extends OpAPIOpAPI

Parameters​

ParameterType
namestring
...paramsany[]

Returns​

Promise<A>

Inherited from​

default.createAPI


createSlice()​

createSlice(input, order, id?): void

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

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


getAPI()​

getAPI<A>(name): A

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

Get a reference to an existing API

Type Parameters​

Type ParameterDefault type
A extends OpAPIOpAPI

Parameters​

ParameterType
namestring

Returns​

A

Inherited from​

default.getAPI


getSlice()​

getSlice(): Slice | null

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

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

Returns​

Slice | null

Inherited from​

default.getSlice


getSlices()​

getSlices(max): Slice[]

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

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

Parameters​

ParameterType
maxnumber

Returns​

Slice[]

Inherited from​

default.getSlices


handle()​

handle(): Promise<boolean>

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

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


initialize()​

initialize(recoveryData): Promise<void>

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

Register the different Slicer instances

See [[SlicerCore#initialize]]

Parameters​

ParameterType
recoveryDataSlicerRecoveryData[]

Returns​

Promise<void>

Overrides​

default.initialize


isRecoverable()​

isRecoverable(): boolean

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

Used to indicate whether this slicer is recoverable.

Returns​

boolean

Inherited from​

default.isRecoverable


isRelocatable()​

isRelocatable(): boolean

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

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

Returns​

boolean

Inherited from​

default.isRelocatable


maxQueueLength()​

maxQueueLength(): number

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

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


newSlicer()​

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

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

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

Parameters​

ParameterType
idnumber

Returns​

Promise<SlicerFn | undefined>

a function which will be called in parallel


onExecutionStats()​

onExecutionStats(stats): void

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

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

Parameters​

ParameterType
statsExecutionStats

Returns​

void

Inherited from​

default.onExecutionStats


shutdown()​

shutdown(): Promise<void>

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

Cleanup the slicers functions

See [[SlicerCore#shutdown]]

Returns​

Promise<void>

Overrides​

default.shutdown


sliceCount()​

sliceCount(): number

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

The number of enqueued slices

Returns​

number

Inherited from​

default.sliceCount


slicers()​

slicers(): number

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

Return the number of registered slicers

Returns​

number

Overrides​

default.slicers