You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (System.getProperty(SDKGlobalConfiguration.AWS_REGION_SYSTEM_PROPERTY) != null) {
60
-
region = System.getProperty(SDKGlobalConfiguration.AWS_REGION_SYSTEM_PROPERTY);
61
-
} else {
62
-
region = System.getenv(SDKGlobalConfiguration.AWS_REGION_ENV_VAR);
63
-
}
64
-
if (region == null) {
65
-
thrownewIllegalStateException(
66
-
"When specifying contact points you must specify a localdc. In this sample we use the AWS_REGION env variable, or aws.region system property value as localdc"
67
-
);
68
-
}
69
-
70
53
// The CqlSession object is the main entry point of the driver.
71
54
// It holds the known state of the actual Cassandra cluster (notably the Metadata).
72
55
// This class is thread-safe, you should create a single instance (per target Cassandra cluster), and share
73
56
// it throughout your application.
74
57
try (CqlSessionsession = CqlSession.builder()
75
-
.addContactPoints(contactPoints)
76
-
.withAuthProvider(newSigV4AuthProvider())
77
-
.withSslContext(SSLContext.getDefault())
78
-
.withLocalDatacenter(region)
79
-
.build()) {
58
+
.addContactPoints(contactPoints)
59
+
.withAuthProvider(newSigV4AuthProvider())
60
+
.withSslContext(SSLContext.getDefault())
61
+
.withLocalDatacenter("us-west-2")
62
+
.build()) {
80
63
81
64
// We use execute to send a query to Cassandra. This returns a ResultSet, which is essentially a collection
if (System.getProperty(SDKGlobalConfiguration.AWS_REGION_SYSTEM_PROPERTY) != null) {
61
-
region = System.getProperty(SDKGlobalConfiguration.AWS_REGION_SYSTEM_PROPERTY);
62
-
} else {
63
-
region = System.getenv(SDKGlobalConfiguration.AWS_REGION_ENV_VAR);
64
-
}
65
-
if (region == null) {
66
-
thrownewIllegalStateException(
67
-
"When specifying contact points you must specify a localdc. In this sample we use the AWS_REGION env variable, or aws.region system property value as localdc"
68
-
);
69
-
}
70
-
71
55
//By default the reference.conf is loaded by the driver which contains all defaults.
72
56
//You can override this by providing reference.conf on the classpath
73
57
//to isolate test you can load conf with a custom name
0 commit comments