mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge pull request #1760 from cognitree/warn-scb-not-found
Warn user when scb is provided but there is no file
This commit is contained in:
@@ -37,6 +37,7 @@ import org.apache.logging.log4j.Logger;
|
|||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -97,8 +98,18 @@ public class Cqld4Space implements AutoCloseable {
|
|||||||
// int port = cfg.getOptional(int.class, "port").orElse(9042);
|
// int port = cfg.getOptional(int.class, "port").orElse(9042);
|
||||||
|
|
||||||
Optional<String> scb = cfg.getOptional(String.class, "secureconnectbundle", "scb");
|
Optional<String> scb = cfg.getOptional(String.class, "secureconnectbundle", "scb");
|
||||||
scb.flatMap(s -> NBIO.all().pathname(s).first().map(Content::getInputStream))
|
|
||||||
.map(builder::withCloudSecureConnectBundle);
|
if (scb.isPresent()) {
|
||||||
|
Optional<InputStream> stream =
|
||||||
|
scb.flatMap(s -> NBIO.all().pathname(s).first().map(Content::getInputStream));
|
||||||
|
if (stream.isPresent()) {
|
||||||
|
stream.map(builder::withCloudSecureConnectBundle);
|
||||||
|
} else {
|
||||||
|
String error = String.format("Unable to load Secure Connect Bundle from path %s", scb.get());
|
||||||
|
logger.error(error);
|
||||||
|
throw new RuntimeException(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Optional<List<InetSocketAddress>> contactPointsOption = cfg
|
Optional<List<InetSocketAddress>> contactPointsOption = cfg
|
||||||
.getOptional("host", "hosts")
|
.getOptional("host", "hosts")
|
||||||
|
|||||||
Reference in New Issue
Block a user