Package com.cognite.client.config
Class ClientConfig
java.lang.Object
com.cognite.client.config.ClientConfig
- All Implemented Interfaces:
Serializable
This class captures the client configuration parameters.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientConfigcreate()Returns aClientConfigobject with default settings.abstract Stringabstract Durationabstract intabstract ClientConfig.FeatureFlagabstract intabstract intabstract intabstract intabstract ProxyConfigabstract Stringabstract Stringabstract UpsertModewithAppIdentifier(String identifier) Set the app identifier.withAsyncApiJobTimeout(Duration timeout) Sets the timeout for waiting for async api jobs to finish.withEntityMatchingMaxBatchSize(int batchSize) Sets the max batch size when executing entity matching operations.withExperimental(ClientConfig.FeatureFlag experimentalFeatures) Enable/disable experimental features.withMaxRetries(int retries) Sets the maximum number of retries when sending requests to the Cognite API.withNoListPartitions(int noPartitions) Specifies the number of partitions to use for (read) list requests.withNoTsWorkers(int noTsWorkers) Specifies the maximum number of workers to use for the Cognite API requests towards the time series service.withNoWorkers(int noWorkers) Specifies the maximum number of workers to use for the Cognite API requests.withProxyConfig(ProxyConfig proxyConfig) Specifies the proxy server configuration.withSessionIdentifier(String identifier) Set the session identifier.withUpsertMode(UpsertMode mode) Sets the upsert mode.
-
Constructor Details
-
ClientConfig
public ClientConfig()
-
-
Method Details
-
create
Returns aClientConfigobject with default settings.- Returns:
- the
ClientConfigobject.
-
getSdkIdentifier
-
getAppIdentifier
-
getSessionIdentifier
-
getMaxRetries
public abstract int getMaxRetries() -
getNoWorkers
public abstract int getNoWorkers() -
getNoTsWorkers
public abstract int getNoTsWorkers() -
getNoListPartitions
public abstract int getNoListPartitions() -
getUpsertMode
-
getEntityMatchingMaxBatchSize
public abstract int getEntityMatchingMaxBatchSize() -
getAsyncApiJobTimeout
-
getProxyConfig
-
getExperimental
-
withAppIdentifier
Set the app identifier. The identifier is encoded in the api calls to the Cognite instance and can be used for tracing and statistics.- Parameters:
identifier- the application identifier.- Returns:
- the
ClientConfigwith the setting applied.
-
withSessionIdentifier
Set the session identifier. The identifier is encoded in the api calls to the Cognite instance and can be used for tracing and statistics.- Parameters:
identifier- the session identifier.- Returns:
- the
ClientConfigwith the setting applied.
-
withMaxRetries
Sets the maximum number of retries when sending requests to the Cognite API. The default setting is 5. This should be sufficient for most scenarios.- Parameters:
retries- the maximum number of retries before failing a request.- Returns:
- the
ClientConfigwith the setting applied.
-
withNoWorkers
Specifies the maximum number of workers to use for the Cognite API requests. The default setting is eight workers.- Parameters:
noWorkers- max number of workers.- Returns:
- the
ClientConfigwith the setting applied.
-
withNoListPartitions
Specifies the number of partitions to use for (read) list requests. This represents the number of parallel streams to use for reading the results of list requests. The default setting is eight partitions.- Parameters:
noPartitions- the number of partitions for list requests.- Returns:
- the
ClientConfigwith the setting applied.
-
withNoTsWorkers
Specifies the maximum number of workers to use for the Cognite API requests towards the time series service. This is a high-capacity service optimized for a higher number of workers than the other API services. The default setting is 16 workers.- Parameters:
noTsWorkers- max number of workers.- Returns:
- the
ClientConfigwith the setting applied.
-
withUpsertMode
Sets the upsert mode. When the data object to write does not exist, the writer will always create it. But, if the object already exist, the writer can update the the existing object in one of two ways: update or replace.UpsertMode.UPDATEwill update the provided fields in the target object--all other fields will remain unchanged.UpsertMode.REPLACEwill replace the entire target object with the provided fields (idandexternalIdwill remain unchanged).- Parameters:
mode- the upsert mode.- Returns:
- the
ClientConfigwith the setting applied
-
withEntityMatchingMaxBatchSize
Sets the max batch size when executing entity matching operations.- Parameters:
batchSize- the max batch size.- Returns:
- the
ClientConfigwith the setting applied.
-
withAsyncApiJobTimeout
Sets the timeout for waiting for async api jobs to finish. Async api jobs includes the CDF context api endpoints like entity matching and engineering diagram parsing. The default timeout is 20 minutes.- Parameters:
timeout- The async timeout expressed asDuration.- Returns:
- the
ClientConfigwith the setting applied.
-
withProxyConfig
Specifies the proxy server configuration. The default setting is no proxy server configuration. If you need to specify a proxy server configuration, you supply aProxyConfigobject with the appropriate specification.- Parameters:
proxyConfig- the proxy server configuration to use.- Returns:
- the
ClientConfigwith the setting applied. - See Also:
-
withExperimental
Enable/disable experimental features. Experimental features are not fully tested and does not offer future compatibility guarantees.- Parameters:
experimentalFeatures- the experimental feature flags.- Returns:
- the
ClientConfigwith the setting applied.
-