Skip to content

Commit

Permalink
FMWK-245 Use configuration values in schema builder's ScanPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn committed Sep 14, 2023
1 parent 4943611 commit d261ca5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.aerospike.client.policy.ScanPolicy;
import com.aerospike.jdbc.model.DataColumn;
import com.aerospike.jdbc.model.SchemaTableName;
import com.aerospike.jdbc.util.URLParser;

import java.sql.Types;
import java.time.Duration;
Expand Down Expand Up @@ -37,7 +38,7 @@ public static List<DataColumn> getSchema(SchemaTableName schemaTableName, IAeros
return cache.get(schemaTableName).orElseGet(() -> {
logger.info(() -> "Fetching SchemaTableName: " + schemaTableName);
final Map<String, DataColumn> columnHandles = new TreeMap<>(String::compareToIgnoreCase);
ScanPolicy policy = new ScanPolicy();
ScanPolicy policy = new ScanPolicy(URLParser.getScanPolicy());
policy.maxRecords = schemaScanRecords;

// add record key column handler
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/aerospike/jdbc/util/URLParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public final class URLParser {
private static final Pattern AS_JDBC_URL = Pattern.compile("^jdbc:aerospike:(?://)?([^/?]+)");
private static final Pattern AS_JDBC_SCHEMA = Pattern.compile("/([^?]+)");

private static Host[] hosts;
private static String schema;
private static Properties clientInfo;
private static ClientPolicy clientPolicy;
private static WritePolicy writePolicy;
private static ScanPolicy scanPolicy;
private static QueryPolicy queryPolicy;
private static DriverPolicy driverPolicy;
private static volatile Host[] hosts;
private static volatile String schema;
private static volatile Properties clientInfo;
private static volatile ClientPolicy clientPolicy;
private static volatile WritePolicy writePolicy;
private static volatile ScanPolicy scanPolicy;
private static volatile QueryPolicy queryPolicy;
private static volatile DriverPolicy driverPolicy;

private URLParser() {
}
Expand Down

0 comments on commit d261ca5

Please sign in to comment.