On this page

# DataCaptureThread

DataCaptureThread

This is the class describing the structure of a DCT. Please see the network documentation for a detailed description of the Data Capture Threads.

A DCT is defined by a config object and a set of statistics received from the network node. Use the `make` method for instantiating DCTs to ensure the proper validation of all the assets needed for correct instantiation.

## Constructor

### (private) new DataCaptureThread(config, schema, dirty)

Private constructor. Use the `make()` method for creating new instances of DCTs.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`config` |  |  |
`schema` | SchemaDefinition |  |
`dirty` |  | false |

Source
  - models/data.capture.thread.js, line 17

## Classes

DataCaptureThread

## Members

### config :Object

The Data Capture Thread config.

Type:

- Object

Source
  - models/data.capture.thread.js, line 30

### dps :Object

Data Per Second metrics.

Type:

- Object

Source
  - models/data.capture.thread.js, line 51

### isDirty :boolean

Signals syncronization on network node.

Type:

- boolean

Source
  - models/data.capture.thread.js, line 23

### schema :SchemaDefinition

The config schema used for validation.

Type:

- SchemaDefinition

Source
  - models/data.capture.thread.js, line 58

### stats :Object

Stats.

Type:

- Object

Source
  - models/data.capture.thread.js, line 44

### time :Object

Time.

Type:

- Object

Source
  - models/data.capture.thread.js, line 37

## Methods

### getConfig() → {Object}

Returns the DCT config as stored on the instance. If a schema is provided, any properties missing from the schema will be dropped from the returned object. Any properties missing from the config and present on the schema will be returned with their default values as defined by the schema.

Source
  - models/data.capture.thread.js, line 143

Returns:

Type:
  Object

### getMetadata() → {Object}

Shorthand method for returning the properties stored on the `STREAM_CONFIG_METADATA` config key. Depending on the DCT implementation, this metadata can describe how the data is provided for the pipeline. One such example could be the resolution of the extracted video frames that are fed into the computer vision pipelines.

Source
  - models/data.capture.thread.js, line 191

Returns:

Type:
  Object

### setStats(stats) → {DataCaptureThread}

Sets the statistics for this capture thread, as received from heartbeat.

Parameters:

Name | Type | Description
--- | --- | ---
`stats` |  |

Source
  - models/data.capture.thread.js, line 124

Returns:

Type:
  DataCaptureThread

### updateConfig(update) → {DataCaptureThread}

Updates the config values of a DCT. The update is validated against the stored schema, if the validation fails the errors are thrown.

When updating, the DCT instance will be marked as dirty in order to be synchronized with the edge node by the node manager handling the communication.

Parameters:

Name | Type | Description
--- | --- | ---
`update` |  |

Source
  - models/data.capture.thread.js, line 172

Returns:

Type:
  DataCaptureThread

### updateMetadata(metadata) → {DataCaptureThread}

Shorthand method for updating the DCT metadata stored on the `STREAM_CONFIG_METADATA` config key.

Parameters:

Name | Type | Description
--- | --- | ---
`metadata` | Object |

Source
  - models/data.capture.thread.js, line 201

Returns:

Type:
  DataCaptureThread

### (static) make(candidateConfig, stats, schema, dirty) → {DataCaptureThread}

Static factory to instantiate DataCaptureThreads.

When called, will attempt to validate the config against the schema. Any errors will be thrown. This method is used both internally, when loading pipeline configurations from the heartbeat info, and when creating new pipelines to be deployed on the network node.

Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`candidateConfig` | * |  |
`stats` | * | null |
`schema` | SchemaDefinition | null | null |
`dirty` | boolean | false |

Source
  - models/data.capture.thread.js, line 88

Returns:

Type:
  DataCaptureThread

Type anything to view search result