Skip to content

Commit

Permalink
remove H2 prefix usage in OSHDB(Application|Driver)
Browse files Browse the repository at this point in the history
  • Loading branch information
joker234 committed Nov 11, 2022
1 parent 50629e7 commit c2cdf35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static class ConfigOrUrl {
@Option(names = {"--keytables"}, description = "keytablesUrl jdbc:...")
protected String keytableUrl;

@Option(names = {"--prefix"}, description = "prefix to use")
@Option(names = {"--prefix"}, description = "prefix to use for ignite")
protected String prefix;

@Option(names = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,17 @@ private static int connectToH2(Properties props, Execute connect)
var multithreading =
getInterpolated(props, MULTITHREADING_PROPERTY_NAME).filter("true"::equalsIgnoreCase)
.isPresent();
return connectToH2(h2, prefix, multithreading, connect);
return connectToH2(h2, multithreading, connect);
}

// OSHDBJdbc throws "Exception"
@SuppressWarnings("java:S112")
private static int connectToH2(String h2, String prefix, boolean multithreading,
private static int connectToH2(String h2, boolean multithreading,
Execute connect) throws Exception {
try (final var oshdb = new OSHDBH2(h2)) {
oshdb.prefix(prefix);
oshdb.multithreading(multithreading);
var props = new Properties();
props.setProperty(OSHDBDriver.OSHDB_PROPERTY_NAME, h2);
props.setProperty(PREFIX_PROPERTY_NAME, prefix);
final var connection = new OSHDBConnection(props, oshdb);
return connect.apply(connection);
}
Expand All @@ -117,8 +115,7 @@ private static int connectToIgnite(Properties props, Execute connect)
var hcKeytables = new HikariConfig();
hcKeytables.setJdbcUrl(keyTablesUrl);
try (var dsKeytables = new HikariDataSource(hcKeytables);
var oshdb = new OSHDBIgnite(ignite, dsKeytables)) {
oshdb.prefix(prefix);
var oshdb = new OSHDBIgnite(ignite, prefix, dsKeytables)) {
var connection = new OSHDBConnection(props, oshdb);
return connect.apply(connection);
}
Expand Down

0 comments on commit c2cdf35

Please sign in to comment.