in ArgumentExtractor#initSession, instead of eagerly providing the orElse value and left with a dangling open session if user choose to provide a session, the following code:
public static Session initSession(Cluster cluster, ConfigMap configurationMap) {
LOGGER.trace("Extract or init Session from configuration map");
return Optional.<Session>ofNullable(configurationMap.getTyped(NATIVE_SESSION))
.orElse(initKeyspaceName(configurationMap)
.map(cluster::connect)
.orElseGet(cluster::connect)
);
}
should probably be changed to:
public static Session initSession(Cluster cluster, ConfigMap configurationMap) {
LOGGER.trace("Extract or init Session from configuration map");
return Optional.<Session>ofNullable(configurationMap.getTyped(NATIVE_SESSION))
.orElse(()-> initKeyspaceName(configurationMap)
.map(cluster::connect)
.orElseGet(cluster::connect)
);
}
in ArgumentExtractor#initSession, instead of eagerly providing the orElse value and left with a dangling open session if user choose to provide a session, the following code:
should probably be changed to: