Skip to content

Commit 15d5c63

Browse files
committed
Add option to enable detector of full scans
1 parent e46c943 commit 15d5c63

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

jdbc/src/main/java/tech/ydb/jdbc/settings/YdbClientProperties.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,4 @@ public boolean applyToTableClient(TableClient.Builder table, QueryClient.Builder
8181
query.sessionPoolMaxSize(maxSize).sessionPoolMinSize(minSize);
8282
return false;
8383
}
84-
8584
}

jdbc/src/main/java/tech/ydb/jdbc/settings/YdbConfig.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public class YdbConfig {
4040
static final YdbProperty<Boolean> USE_QUERY_SERVICE = YdbProperty.bool("useQueryService",
4141
"Use QueryService intead of TableService", false
4242
);
43+
static final YdbProperty<Boolean> FULLSCAN_DETECTOR_ENABLED = YdbProperty.bool(
44+
"jdbc.ydb.fullscan_analyze", "Enable analizator for collecting query stats", false
45+
);
4346

4447

4548
private final String url;
@@ -53,6 +56,7 @@ public class YdbConfig {
5356
private final boolean isCacheConnectionsInDriver;
5457
private final int preparedStatementsCacheSize;
5558
private final boolean useQueryService;
59+
private final boolean fullScanDetectorEnabled;
5660

5761
private YdbConfig(
5862
String url, String safeUrl, String connectionString, String username, String password, Properties props
@@ -66,6 +70,7 @@ private YdbConfig(
6670
this.isCacheConnectionsInDriver = CACHE_CONNECTIONS_IN_DRIVER.readValue(props).getValue();
6771
this.preparedStatementsCacheSize = Math.max(0, PREPARED_STATEMENT_CACHE_SIZE.readValue(props).getValue());
6872
this.useQueryService = USE_QUERY_SERVICE.readValue(props).getValue();
73+
this.fullScanDetectorEnabled = FULLSCAN_DETECTOR_ENABLED.readValue(props).getValue();
6974
}
7075

7176
public Properties getSafeProps() {
@@ -96,6 +101,10 @@ public boolean isUseQueryService() {
96101
return this.useQueryService;
97102
}
98103

104+
public boolean isFullScanDetectorEnabled() {
105+
return fullScanDetectorEnabled;
106+
}
107+
99108
static boolean isSensetive(String key) {
100109
return TOKEN_KEY.equalsIgnoreCase(key) || PASSWORD_KEY.equalsIgnoreCase(key);
101110
}

0 commit comments

Comments
 (0)