@terascope/job-components / builtin/test-reader/slicer / default
Class: default
Defined in: packages/job-components/src/builtin/test-reader/slicer.ts:9
The simpliest form a "Slicer"
See [[SlicerCore]]
Extends
Constructors
Constructor
new default(
context,opConfig,executionConfig):TestSlicer
Defined in: packages/job-components/src/operations/core/slicer-core.ts:30
Parameters
| Parameter | Type | 
|---|---|
| context | Context | 
| opConfig | OpConfig&TestReaderConfig | 
| executionConfig | ExecutionConfig | 
Returns
TestSlicer
Inherited from
Properties
Accessors
workersConnected
Get Signature
get
protectedworkersConnected():number
Defined in: packages/job-components/src/operations/core/slicer-core.ts:176
Returns
number
Inherited from
Methods
canComplete()
protectedcanComplete():boolean
Defined in: packages/job-components/src/operations/core/slicer-core.ts:172
Returns
boolean
Inherited from
createAPI()
createAPI<
A>(name, ...params):Promise<A>
Defined in: packages/job-components/src/operations/core/slicer-core.ts:67
Create an API and add it to the operation lifecycle
Type Parameters
| Type Parameter | Default type | 
|---|---|
| AextendsOpAPI | OpAPI | 
Parameters
| Parameter | Type | 
|---|---|
| name | string | 
| ... params | any[] | 
Returns
Promise<A>
Inherited from
createSlice()
createSlice(
input,order,id):void
Defined in: packages/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
| Parameter | Type | Default value | 
|---|---|---|
| input | SliceRequest|Slice | undefined | 
| order | number | undefined | 
| id | number | 0 | 
Returns
void
Inherited from
getAPI()
getAPI<
A>(name):A
Defined in: packages/job-components/src/operations/core/slicer-core.ts:74
Get a reference to an existing API
Type Parameters
| Type Parameter | Default type | 
|---|---|
| AextendsOpAPI | OpAPI | 
Parameters
| Parameter | Type | 
|---|---|
| name | string | 
Returns
A
Inherited from
getSlice()
getSlice():
null|Slice
Defined in: packages/job-components/src/operations/core/slicer-core.ts:112
A method called by the "Execution Controller" to dequeue a created "Slice"
Returns
null | Slice
Inherited from
getSlices()
getSlices(
max):Slice[]
Defined in: packages/job-components/src/operations/core/slicer-core.ts:121
A method called by the "Execution Controller" to dequeue many created slices
Parameters
| Parameter | Type | 
|---|---|
| max | number | 
Returns
Slice[]
Inherited from
handle()
handle():
Promise<boolean>
Defined in: packages/job-components/src/operations/slicer.ts:28
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
Inherited from
initialize()
initialize(
recoveryData):Promise<void>
Defined in: packages/job-components/src/builtin/test-reader/slicer.ts:13
Called during execution initialization
Parameters
| Parameter | Type | Description | 
|---|---|---|
| recoveryData | SlicerRecoveryData[] | is the data to recover from | 
Returns
Promise<void>
Overrides
isRecoverable()
isRecoverable():
boolean
Defined in: packages/job-components/src/operations/core/slicer-core.ts:146
Used to indicate whether this slicer is recoverable.
Returns
boolean
Inherited from
isRelocatable()
isRelocatable():
boolean
Defined in: packages/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
maxQueueLength()
maxQueueLength():
number
Defined in: packages/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
onExecutionStats()
onExecutionStats(
stats):void
Defined in: packages/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 satistics
Parameters
| Parameter | Type | 
|---|---|
| stats | ExecutionStats | 
Returns
void
Inherited from
shutdown()
shutdown():
Promise<void>
Defined in: packages/job-components/src/builtin/test-reader/slicer.ts:29
Called during execution shutdown, when this is cleanup any open connections or destroy any in-memory state.
Returns
Promise<void>
Overrides
slice()
slice():
Promise<any>
Defined in: packages/job-components/src/builtin/test-reader/slicer.ts:34
A method called by Slicer#handle
Returns
Promise<any>
a Slice, or SliceRequest
Overrides
sliceCount()
sliceCount():
number
Defined in: packages/job-components/src/operations/core/slicer-core.ts:139
The number of enqueued slices
Returns
number
Inherited from
slicers()
slicers():
number
Defined in: packages/job-components/src/operations/slicer.ts:24
Return the number of registered slicers
Returns
number