@terascope/job-components / operations/job-observer / default
Class: default
Defined in: packages/job-components/src/operations/job-observer.ts:11
An Observer for monitoring the Slice Analytics
Extends
Constructors
new default()
new default(
context
,apiConfig
,executionConfig
):default
Defined in: packages/job-components/src/operations/job-observer.ts:26
Parameters
Parameter | Type |
---|---|
context | Context |
apiConfig | APIConfig |
executionConfig | ExecutionConfig |
Returns
Overrides
Properties
Methods
defaultAnalytics()
defaultAnalytics():
SliceAnalyticsData
Defined in: packages/job-components/src/operations/job-observer.ts:90
Returns
getAnalytics()
getAnalytics():
undefined
|SliceAnalyticsData
Defined in: packages/job-components/src/operations/job-observer.ts:79
Returns
undefined
| SliceAnalyticsData
initialize()
initialize():
Promise
<void
>
Defined in: packages/job-components/src/operations/core/api-core.ts:37
Called during execution initialization, when this is called perform any async setup.
Returns
Promise
<void
>
Inherited from
onOperationComplete()
onOperationComplete(
sliceId
,index
,processed
):void
Defined in: packages/job-components/src/operations/job-observer.ts:64
Parameters
Parameter | Type |
---|---|
sliceId | string |
index | number |
processed | number |
Returns
void
onOperationStart()
onOperationStart(
sliceId
,index
):void
Defined in: packages/job-components/src/operations/job-observer.ts:52
Parameters
Parameter | Type |
---|---|
sliceId | string |
index | number |
Returns
void
onSliceInitialized()
onSliceInitialized(
sliceId
):Promise
<void
>
Defined in: packages/job-components/src/operations/job-observer.ts:41
Parameters
Parameter | Type |
---|---|
sliceId | string |
Returns
Promise
<void
>
rejectRecord()
rejectRecord(
input
,err
):null
Defined in: packages/job-components/src/operations/core/api-core.ts:79
Reject a record using the dead letter action
Based on OpConfig._dead_letter_action the transformation can be handled any of the following ways:
- "throw": throw the original error
- "log": log the error and the data
- "none": skip the error entirely OR a string to specify the api to use as the dead letter queue
Parameters
Parameter | Type |
---|---|
input | unknown |
err | Error |
Returns
null
null
Inherited from
shutdown()
shutdown():
Promise
<void
>
Defined in: packages/job-components/src/operations/core/api-core.ts:41
Called during execution shutdown, when this is cleanup any open connections or destroy any in-memory state.
Returns
Promise
<void
>
Inherited from
tryRecord()
tryRecord<
I
,R
>(fn
): (input
) =>null
|R
Defined in: packages/job-components/src/operations/core/api-core.ts:54
Try catch a transformation on a record and place any failed records in a dead letter queue
See #rejectRecord for handling
Type Parameters
Type Parameter |
---|
I |
R |
Parameters
Parameter | Type | Description |
---|---|---|
fn | (input ) => R | a function to transform the data with |
Returns
Function
a curried a function that will be called with the data and handle the dead letter action
Parameters
Parameter | Type |
---|---|
input | I |
Returns
null
| R