Class DataAPIClientOptions
java.lang.Object
com.datastax.astra.client.core.options.DataAPIClientOptions
- All Implemented Interfaces:
Cloneable
Options to set up the client for DataApiClient.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default keyspace to use for working with your databases.static final String
API version and path in the URL in the format '/api/${version}'.static final String
Feature Flag Tables.static final int
The maximum number of documents to insert in a single batch operation.static final int
The maximum number of documents allowed for processing before throwing an exception. -
Constructor Summary
ConstructorsConstructorDescriptionA default Client OptionsDataAPIClientOptions
(DataAPIClientOptions options) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddAdminAdditionalHeader
(String key, String value) Add a header to the admin calls.Builder pattern, update caller information.addDatabaseAdditionalHeader
(String key, String value) Add a header to the db calls.addObserver
(CommandObserver observer) Register an observer with its className.addObserver
(String name, CommandObserver observer) Register an observer with its className.clone()
Disable the feature flag tables.embeddingAPIKey
(String embeddingAPIKey) Builder pattern, update http connection TimeoutEnable the feature flag tables.Gets adminAdditionalHeadersGets apiVersioncom.dtsx.astra.sdk.utils.AstraEnvironment
Find the Astra Environment from the destination provided in the initial Optional.Gets databaseAdditionalHeadersGets destinationGets embeddingAuthProviderGets httpClientOptionsGets observersstatic SerdesOptions
Gets serdesOptionsGets timeoutOptionsboolean
isAstra()
Check if the deploying is AstraHelp to enable loggin requests.toString()
-
Field Details
-
DEFAULT_KEYSPACE
The default keyspace to use for working with your databases.This value is the default in Astra but you can create your own keyspaces in your database. Ensure the keyspace matches your database configuration to avoid runtime issues.
- See Also:
-
DEFAULT_VERSION
API version and path in the URL in the format '/api/${version}'.This constant can be used to construct endpoint URLs for making API calls. Modify this value if the backend version changes.
- See Also:
-
MAX_COUNT
public static final int MAX_COUNTThe maximum number of documents allowed for processing before throwing an exception.This is a safeguard to prevent excessive memory or computational load when processing large batches of data. Applications should adhere to this limit for better stability.
- See Also:
-
MAX_CHUNK_SIZE
public static final int MAX_CHUNK_SIZEThe maximum number of documents to insert in a single batch operation.This is used to optimize bulk insertion performance while ensuring the operation doesn't exceed database constraints or memory limits.
- See Also:
-
HEADER_FEATURE_FLAG_TABLES
Feature Flag Tables.- See Also:
-
-
Constructor Details
-
DataAPIClientOptions
public DataAPIClientOptions()A default Client Options -
DataAPIClientOptions
Copy constructor.- Parameters:
options
- options to copy
-
-
Method Details
-
isAstra
public boolean isAstra()Check if the deploying is Astra- Returns:
- true if the destination is Astra
-
getAstraEnvironment
public com.dtsx.astra.sdk.utils.AstraEnvironment getAstraEnvironment()Find the Astra Environment from the destination provided in the initial Optional. It will help shaping the Api endpoint to spawn sub database objects.- Returns:
- astra environment if found
-
getApiVersion
Gets apiVersion- Returns:
- value of apiVersion
-
getDestination
Gets destination- Returns:
- value of destination
-
getEmbeddingAuthProvider
Gets embeddingAuthProvider- Returns:
- value of embeddingAuthProvider
-
getDatabaseAdditionalHeaders
Gets databaseAdditionalHeaders- Returns:
- value of databaseAdditionalHeaders
-
getAdminAdditionalHeaders
Gets adminAdditionalHeaders- Returns:
- value of adminAdditionalHeaders
-
getObservers
Gets observers- Returns:
- value of observers
-
getHttpClientOptions
Gets httpClientOptions- Returns:
- value of httpClientOptions
-
getTimeoutOptions
Gets timeoutOptions- Returns:
- value of timeoutOptions
-
getSerdesOptions
Gets serdesOptions- Returns:
- value of serdesOptions
-
addObserver
Register an observer with its className.- Parameters:
name
- observer nameobserver
- command observer- Returns:
- instance of the command options
-
addObserver
Register an observer with its className.- Parameters:
observer
- command observer- Returns:
- instance of the command options
-
logRequests
Help to enable loggin requests.- Returns:
- current reference
-
embeddingAPIKey
Builder pattern, update http connection Timeout- Parameters:
embeddingAPIKey
- embedding API Key- Returns:
- self reference
-
addCaller
Builder pattern, update caller information. o- Parameters:
name
- caller name in the user agentversion
- caller version in the user agent- Returns:
- self reference
-
addDatabaseAdditionalHeader
Add a header to the db calls.- Parameters:
key
- keyvalue
- value- Returns:
- self reference
-
addAdminAdditionalHeader
Add a header to the admin calls.- Parameters:
key
- keyvalue
- value- Returns:
- self reference
-
enableFeatureFlagTables
Enable the feature flag tables.- Returns:
- self reference
-
disableFeatureFlagTables
Disable the feature flag tables.- Returns:
- self reference
-
toString
-
clone
-