*/
void init() throws SQLException {
try {
// lazy session creation to allow creation of VtoccTransactionHandler via Provider
if (sessionInfo == null) {
Builder sessionParams = SessionParams.newBuilder();
Matcher matcher = Pattern.compile("([^/]*)(?:/(\\d+))?").matcher(vtoccKeyspaceShard);
if (!matcher.matches()) {
throw new IllegalArgumentException("Invalid keyspace/shard " + vtoccKeyspaceShard);
}
sessionParams.setKeyspace(matcher.group(1));
if (matcher.group(2) != null) {
sessionParams.setShard(matcher.group(2));
}
sessionInfo = sqlQueryBlockingInterface
.getSessionId(rpcControllerProvider.get(), sessionParams.build());
}
} catch (ServiceException e) {
throw VtoccSqlExceptionFactory.getSqlException(e);
}
}