forked from databricks/databricks-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIDatabricksConnectionContext.java
More file actions
356 lines (242 loc) · 10.2 KB
/
IDatabricksConnectionContext.java
File metadata and controls
356 lines (242 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
package com.databricks.jdbc.api.internal;
import com.databricks.jdbc.common.*;
import com.databricks.jdbc.exception.DatabricksParsingException;
import com.databricks.sdk.core.ProxyConfig;
import com.databricks.sdk.core.utils.Cloud;
import java.util.List;
import java.util.Map;
public interface IDatabricksConnectionContext {
/**
* Returns host-Url for Databricks server as parsed from JDBC connection in format <code>
* https://server:port</code>
*
* @return Databricks host-Url
*/
String getHostUrl() throws DatabricksParsingException;
/**
* Returns warehouse-Id as parsed from JDBC connection Url
*
* @return warehouse-Id
*/
IDatabricksComputeResource getComputeResource();
/**
* Returns the auth token (personal access token)
*
* @return auth token
*/
String getToken();
/**
* Returns the pass through access token
*
* @return access token
*/
String getPassThroughAccessToken();
String getHostForOAuth();
String getClientId() throws DatabricksParsingException;
String getNullableClientId();
String getClientSecret();
List<String> getOAuthScopesForU2M() throws DatabricksParsingException;
AuthMech getAuthMech();
AuthFlow getAuthFlow();
boolean isPropertyPresent(DatabricksJdbcUrlParams urlParam);
LogLevel getLogLevel();
String getLogPathString();
int getLogFileSize();
int getLogFileCount();
/** Returns the userAgent string specific to client used to fetch results. */
String getClientUserAgent();
CompressionCodec getCompressionCodec();
/** Returns the userAgent string specified as part of the JDBC connection string */
String getCustomerUserAgent();
String getCatalog();
String getSchema();
Map<String, String> getSessionConfigs();
Map<String, String> getClientInfoProperties();
/**
* Returns the custom headers set in the JDBC connection string.
*
* @return Map of custom headers
*/
Map<String, String> getCustomHeaders();
boolean isAllPurposeCluster();
String getHttpPath();
/** Returns the value of the EnableSQLValidationForIsValid connection property. */
boolean getEnableSQLValidationForIsValid();
String getProxyHost();
int getProxyPort();
String getProxyUser();
String getProxyPassword();
Boolean getUseProxy();
ProxyConfig.ProxyAuthType getProxyAuthType();
Boolean getUseSystemProxy();
Boolean getUseCloudFetchProxy();
Cloud getCloud() throws DatabricksParsingException;
String getCloudFetchProxyHost();
int getCloudFetchProxyPort();
String getCloudFetchProxyUser();
String getCloudFetchProxyPassword();
ProxyConfig.ProxyAuthType getCloudFetchProxyAuthType();
String getEndpointURL() throws DatabricksParsingException;
int getAsyncExecPollInterval();
Boolean shouldEnableArrow();
DatabricksClientType getClientType();
void setClientType(DatabricksClientType clientType);
Boolean getUseEmptyMetadata();
/** Returns the number of threads to be used for fetching data from cloud storage */
int getCloudFetchThreadPoolSize();
/** Returns the minimum expected download speed threshold in MB/s for CloudFetch operations */
double getCloudFetchSpeedThreshold();
Boolean getDirectResultMode();
Boolean shouldRetryTemporarilyUnavailableError();
Boolean shouldRetryRateLimitError();
int getTemporarilyUnavailableRetryTimeout();
int getRateLimitRetryTimeout();
int getIdleHttpConnectionExpiry();
boolean supportManyParameters();
String getConnectionURL();
boolean checkCertificateRevocation();
boolean acceptUndeterminedCertificateRevocation();
/** Returns the file path to the JWT private key used for signing the JWT. */
String getJWTKeyFile();
/** Returns the Key ID (KID) used in the JWT header, identifying the key. */
String getKID();
/** Returns the passphrase to decrypt the private key if the key is encrypted. */
String getJWTPassphrase();
/** Returns the algorithm used for signing the JWT (e.g., RS256, ES256). */
String getJWTAlgorithm();
/** Returns whether JWT assertion should be used for OAuth2 authentication. */
boolean useJWTAssertion();
/** Returns the OAuth2 token endpoint URL for retrieving tokens. */
String getTokenEndpoint();
/** Returns the OAuth2 authorization endpoint URL for the authorization code flow. */
String getAuthEndpoint();
/** Returns whether OAuth2 discovery mode is enabled, which fetches endpoints dynamically. */
boolean isOAuthDiscoveryModeEnabled();
/**
* OAuth Client Id for identity federation which is used in exchanging the access token with
* Databricks in-house token
*/
String getIdentityFederationClientId();
/** Returns the discovery URL used to obtain the OAuth2 token and authorization endpoints. */
String getOAuthDiscoveryURL();
/** Returns the OAuth2 authentication scope used in the request. */
String getAuthScope();
/**
* Returns the OAuth2 refresh token used to obtain a new access token when the current one
* expires.
*/
String getOAuthRefreshToken();
/** Returns the list of OAuth2 redirect URL ports used for OAuth authentication. */
List<Integer> getOAuth2RedirectUrlPorts();
String getGcpAuthType() throws DatabricksParsingException;
String getGoogleServiceAccount();
String getGoogleCredentials();
/** Returns the non-proxy hosts that should be excluded from proxying. */
String getNonProxyHosts();
/** Returns the SSL trust store file path used for SSL connections. */
String getSSLTrustStore();
/** Returns the SSL trust store password of the trust store file. */
String getSSLTrustStorePassword();
/** Returns the SSL trust store type of the trust store file. */
String getSSLTrustStoreType();
/** Returns the SSL key store file path used for SSL connections. */
String getSSLKeyStore();
/** Returns the SSL key store password of the key store file. */
String getSSLKeyStorePassword();
/** Returns the SSL key store type of the key store file. */
String getSSLKeyStoreType();
/** Returns the SSL key store provider for the key store. */
String getSSLKeyStoreProvider();
/** Returns the SSL trust store provider for the trust store. */
String getSSLTrustStoreProvider();
/** Returns the maximum number of commands that can be executed in a single batch. */
int getMaxBatchSize();
/** Checks if Telemetry is enabled */
boolean isTelemetryEnabled();
/** Returns the batch size for Telemetry logs processing */
int getTelemetryBatchSize();
/**
* Returns a unique identifier for this connection context.
*
* <p>This UUID is generated when the connection context is instantiated and serves as a unique
* internal identifier for each JDBC connection.
*/
String getConnectionUuid();
/** Returns allowlisted local file paths for UC Volume operations */
String getVolumeOperationAllowedPaths();
/** Returns true if driver should use hybrid results in SQL_EXEC API. */
boolean isSqlExecHybridResultsEnabled();
/** Returns the Azure tenant ID for the Azure Databricks workspace. */
String getAzureTenantId();
/** Returns true if request tracing should be enabled. */
boolean isRequestTracingEnabled();
/** Returns maximum number of characters that can be contained in STRING columns. */
int getDefaultStringColumnLength();
/** Returns true if driver return complex data type java objects natively as opposed to string */
boolean isComplexDatatypeSupportEnabled();
/** Returns the size for HTTP connection pool */
int getHttpConnectionPoolSize();
/** Returns the list of HTTP codes to retry for UC Volume Ingestion */
List<Integer> getUCIngestionRetriableHttpCodes();
/** Returns retry timeout in seconds for UC Volume Ingestion */
int getUCIngestionRetryTimeoutSeconds();
String getAzureWorkspaceResourceId();
/** Returns maximum number of rows that a query returns at a time. */
int getRowsFetchedPerBlock();
/** Returns the socket timeout in seconds for HTTP connections. */
int getSocketTimeout();
/**
* Returns whether self-signed certificates are allowed for SSL connections.
*
* <p>When true, the driver will accept any certificate, including self-signed certificates. This
* option is insecure and should only be used in non-production environments.
*
* @return true if self-signed certificates are allowed, false otherwise
*/
boolean allowSelfSignedCerts();
/**
* Returns whether the system property trust store should be used for SSL certificate validation.
*
* <p>When true, the driver will use either:
*
* <ol>
* <li>The trust store specified by the Java system property <code>javax.net.ssl.trustStore
* </code> if set
* <li>Or the JDK's default trust store (cacerts) if no system property is set
* </ol>
*
* <p>When false, the driver will:
*
* <ol>
* <li>Use the custom trust store specified by the SSLTrustStore parameter if provided
* <li>Or use the JDK's default trust store (cacerts) but ignore any javax.net.ssl.trustStore
* system property
* </ol>
*
* @return true if the system property trust store should be used, false otherwise
*/
boolean useSystemTrustStore();
/** Returns the passphrase used for encrypting/decrypting token cache */
String getTokenCachePassPhrase();
/** Returns whether token caching is enabled for OAuth authentication */
boolean isTokenCacheEnabled();
/*
* Returns maximum number of concurrent pre-signed requests sent to Databricks File System (DBFS)
* Ensures rate-limit when uploading multiple files to DBFS in parallel.
*/
int getMaxDBFSConcurrentPresignedRequests();
/** Returns the application name using JDBC Connection */
String getApplicationName();
/** Returns the timeout in seconds for waiting for a chunk to be ready. */
int getChunkReadyTimeoutSeconds();
/** Returns whether telemetry is enabled for all connections */
boolean forceEnableTelemetry();
/** Returns the flush interval in milliseconds for telemetry */
int getTelemetryFlushIntervalInMilliseconds();
/** Returns whether circuit breaker is enabled for telemetry */
boolean isTelemetryCircuitBreakerEnabled();
/** Returns the maximum number of HTTP connections per route */
int getHttpMaxConnectionsPerRoute();
/** Returns the HTTP connection request timeout in seconds */
Integer getHttpConnectionRequestTimeout();
}