Show / Hide Table of Contents

Class TimeSeriesUploadQueue

Upload queue for timeseries datapoints

Inheritance
object
BaseUploadQueue<(Identity id, Datapoint dp)>
TimeSeriesUploadQueue
Implements
IUploadQueue<(Identity id, Datapoint dp)>
IUploadQueue
IDisposable
IAsyncDisposable
Inherited Members
BaseUploadQueue<(Identity id, Datapoint dp)>.Destination
BaseUploadQueue<(Identity id, Datapoint dp)>.Callback
BaseUploadQueue<(Identity id, Datapoint dp)>.DestLogger
BaseUploadQueue<(Identity id, Datapoint dp)>.Enqueue((Identity id, Datapoint dp))
BaseUploadQueue<(Identity id, Datapoint dp)>.Enqueue(IEnumerable<(Identity id, Datapoint dp)>)
BaseUploadQueue<(Identity id, Datapoint dp)>.Dequeue()
BaseUploadQueue<(Identity id, Datapoint dp)>.Trigger(CancellationToken)
BaseUploadQueue<(Identity id, Datapoint dp)>.Start(CancellationToken)
BaseUploadQueue<(Identity id, Datapoint dp)>.UploadEntries(IEnumerable<(Identity id, Datapoint dp)>, CancellationToken)
BaseUploadQueue<(Identity id, Datapoint dp)>.Dispose(bool)
BaseUploadQueue<(Identity id, Datapoint dp)>.DisposeAsyncCore()
BaseUploadQueue<(Identity id, Datapoint dp)>.Dispose()
BaseUploadQueue<(Identity id, Datapoint dp)>.DisposeAsync()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extractor.Utils
Assembly: ExtractorUtils.dll
Syntax
public class TimeSeriesUploadQueue : BaseUploadQueue<(Identity id, Datapoint dp)>, IUploadQueue<(Identity id, Datapoint dp)>, IUploadQueue, IDisposable, IAsyncDisposable

Constructors

| Edit this page View Source

TimeSeriesUploadQueue(CogniteDestination, TimeSpan, int, ILogger<CogniteDestination>, Func<QueueUploadResult<(Identity id, Datapoint dp)>, Task>?, string?, bool, long?)

Upload queue for timeseries datapoints

Declaration
public TimeSeriesUploadQueue(CogniteDestination destination, TimeSpan interval, int maxSize, ILogger<CogniteDestination> logger, Func<QueueUploadResult<(Identity id, Datapoint dp)>, Task>? callback, string? bufferPath, bool createMissingTimeseries = false, long? dataSetId = null)
Parameters
Type Name Description
CogniteDestination destination

CogniteDestination to use for uploading

TimeSpan interval

Interval between each automated push, leave at zero to disable timed pushing

int maxSize

Max size of queue before pushing, set to zero to disable max size

ILogger<CogniteDestination> logger

Logger to use

Func<QueueUploadResult<(Identity id, Datapoint dp)>, Task> callback

Callback after pushing

string bufferPath

Path to local buffer file for binary buffering of datapoints

bool createMissingTimeseries

Create missing timeseries when insert fails, only works if datapoints are inserted by external id.

long? dataSetId

DataSetId to use if creating missing timeseries.

Methods

| Edit this page View Source

AddStateStorage(IDictionary<Identity, BaseExtractionState>, IExtractionStateStore, string)

Add state storage to the queue. States are stored at after each upload.

Declaration
public void AddStateStorage(IDictionary<Identity, BaseExtractionState> states, IExtractionStateStore stateStore, string collection)
Parameters
Type Name Description
IDictionary<Identity, BaseExtractionState> states

Map from timeseries identity to extraction state. Missing states are ignored. Required.

IExtractionStateStore stateStore

Store to store states in. Optional.

string collection

Collection in state store to use for extraction states

| Edit this page View Source

Enqueue(Identity, Datapoint)

Enqueue a datapoint by CogniteSdk Identity

Declaration
public void Enqueue(Identity id, Datapoint dp)
Parameters
Type Name Description
Identity id

Timeseries identity

Datapoint dp

Datapoint to enqueue

| Edit this page View Source

Enqueue(long, Datapoint)

Enqueue a datapoint by internalId

Declaration
public void Enqueue(long id, Datapoint dp)
Parameters
Type Name Description
long id

Timeseries internalId

Datapoint dp

Datapoint to enqueue

| Edit this page View Source

Enqueue(string, Datapoint)

Enqueue a datapoint by externalId

Declaration
public void Enqueue(string id, Datapoint dp)
Parameters
Type Name Description
string id

Timeseries externalId

Datapoint dp

Datapoint to enqueue

| Edit this page View Source

UploadEntries(IEnumerable<(Identity id, Datapoint dp)>, CancellationToken)

Upload datapoints to CDF.

Declaration
protected override Task<QueueUploadResult<(Identity id, Datapoint dp)>> UploadEntries(IEnumerable<(Identity id, Datapoint dp)> dps, CancellationToken token)
Parameters
Type Name Description
IEnumerable<(Identity id, Datapoint dp)> dps

Datapoints to upload

CancellationToken token
Returns
Type Description
Task<QueueUploadResult<(Identity id, Datapoint dp)>>

Uploaded points or an error

Overrides
BaseUploadQueue<(Identity id, Datapoint dp)>.UploadEntries(IEnumerable<(Identity id, Datapoint dp)>, CancellationToken)

Implements

IUploadQueue<T>
IUploadQueue
IDisposable
IAsyncDisposable

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX