Namespace Cognite.Extractor.Common
Classes
BasicTimeSpanProvider
Implementation of ITimeSpanProvider that just exposes a constant TimeSpan.
BlockingResourceCounter
Simple construct to count number of available instances of some shared resource.
Chunking
Support for splitting sequences into sequences of sequences subject to various constraints, as well as running a sequence of tasks in parallel.
CogniteTime
DateTime utility functions.
CommonUtils
Various utility functions
ConfigurationException
Exception produced by the configuration utils
CronTimeSpanWrapper
Utility for containing a string converted to timespan in config objects. Also supports cron expresions.
To use: public string MyIntervalValue { get; } = new CronTimeSpanWrapper(false, "s", "0"); public string MyInterval { get => MyIntervalValue.RawValue; set => MyIntervalValue.RawValue = value; }
Access MyIntervalValue.Value in your code, and MyInterval is the config option.
ExtractorState
Class used to store the state of the extractors.
FailureThresholdManager<T, T2>
Simple threshold manager, tracks failed jobs and executes callback if budget is exhausted. The callback is executed on every failure reported, as long as the failure budget is not expanded, or failed items removed from the internal collection using the Success method.
OperationScheduler<T>
Abstraction for handling some kind of recursive exploration. Option for shared, asynchronous limits, and using a shared TaskThrottler.
PeriodicScheduler
Utility to schedule and manage periodic tasks
RetryUtil
Utilities for retries.
RetryUtilConfig
Configuration for utility methods in the RetryUtil class. This can be used in config files for user-configured retries.
SharedResourceScheduler<T>
Abstraction for handling some kind of recursive exploration. Simply a small extension to OperationScheduler<T> that uses an instance of a IResourceCounter for shared capacity.
TaskResult
Result of an executed task
TaskThrottler
Tool to throttle the execution of tasks based on max perallelism, and max number of tasks scheduled per time unit.
Maximum parallelism simply limits the number of parallel tasks.
Per unit sets the maximum number of tasks scheduled per time unit.
Tasks are enqueued and scheduled for execution in order.
TimeRange
Represents a range of time from First to Last. First and Last are both considered to be included in the range. The legal range of values is from the unix epoch, midnight 1/1/1970, to DateTime.MaxValue.
TimeSpanWrapper
Utility for containing a string converted to timespan in config objects. To use: public string MyIntervalValue { get; } = new TimeSpanWrapper(false, "s", "0"); public string MyInterval { get => MyIntervalValue.RawValue; set => MyIntervalValue.RawValue = value; }
Access MyIntervalValue.Value in your code, and MyInterval is the config option.
Interfaces
IChunk<T>
Interface representing a chunk of items in TaskScheduler
IExtractorInstance
Interface for the instance of an extractor.
IHighAvailabilityManager
Interface for a manager used to add high availability.
IResourceCounter
Interface for generic common resource counter, which allows instant freeing, and asynchronous taking.
ITimeSpanProvider
Interface for time span providers used in the periodic scheduler. Allows flexible scheduling.