// @SuppressWarnings("deprecation")
public static synchronized Cluster cluster(Env env, String prefix) throws APIException, IOException {
// @SuppressWarnings("deprecation")
public static synchronized Cluster cluster(Env env, String prefix) throws APIException, IOException {
}
cb = Cluster.builder();
String str = env.getProperty(pre+CASSANDRA_CLUSTERS_PORT,env.getProperty(CASSANDRA_CLUSTERS_PORT,"9042"));
}
cb = Cluster.builder();
String str = env.getProperty(pre+CASSANDRA_CLUSTERS_PORT,env.getProperty(CASSANDRA_CLUSTERS_PORT,"9042"));
env.init().log("Cass Port = ",str );
cb.withPort(Integer.parseInt(str));
}
str = env.getProperty(pre+CASSANDRA_CLUSTERS_USER_NAME,env.getProperty(CASSANDRA_CLUSTERS_USER_NAME,null));
env.init().log("Cass Port = ",str );
cb.withPort(Integer.parseInt(str));
}
str = env.getProperty(pre+CASSANDRA_CLUSTERS_USER_NAME,env.getProperty(CASSANDRA_CLUSTERS_USER_NAME,null));
env.init().log("Cass User = ",str );
String epass = env.getProperty(pre + CASSANDRA_CLUSTERS_PASSWORD,env.getProperty(CASSANDRA_CLUSTERS_PASSWORD,null));
env.init().log("Cass User = ",str );
String epass = env.getProperty(pre + CASSANDRA_CLUSTERS_PASSWORD,env.getProperty(CASSANDRA_CLUSTERS_PASSWORD,null));
throw new APIException("No Password configured for " + str);
}
//TODO Figure out way to ensure Decryptor setting in AuthzEnv
throw new APIException("No Password configured for " + str);
}
//TODO Figure out way to ensure Decryptor setting in AuthzEnv
cb.withCredentials(str,((AuthzEnv)env).decrypt(epass,true));
} else {
cb.withCredentials(str, env.decryptor().decrypt(epass));
cb.withCredentials(str,((AuthzEnv)env).decrypt(epass,true));
} else {
cb.withCredentials(str, env.decryptor().decrypt(epass));
}
str = env.getProperty(pre+CASSANDRA_RESET_EXCEPTIONS,env.getProperty(CASSANDRA_RESET_EXCEPTIONS,null));
}
str = env.getProperty(pre+CASSANDRA_RESET_EXCEPTIONS,env.getProperty(CASSANDRA_RESET_EXCEPTIONS,null));
Double lat = str!=null?Double.parseDouble(str):null;
str = env.getProperty(Config.CADI_LONGITUDE);
Double lon = str!=null?Double.parseDouble(str):null;
Double lat = str!=null?Double.parseDouble(str):null;
str = env.getProperty(Config.CADI_LONGITUDE);
Double lon = str!=null?Double.parseDouble(str):null;
String bestDC = null;
int numInBestDC = 1;
double mlat, mlon,temp,distance = Double.MAX_VALUE;
String bestDC = null;
int numInBestDC = 1;
double mlat, mlon,temp,distance = Double.MAX_VALUE;
++numInBestDC;
} else {
// Calc closest DC with Great Circle
mlat = Double.parseDouble(minfo[2]);
mlon = Double.parseDouble(minfo[3]);
// Note: GreatCircle Distance is always >= 0.0 (not negative)
++numInBestDC;
} else {
// Calc closest DC with Great Circle
mlat = Double.parseDouble(minfo[2]);
mlon = Double.parseDouble(minfo[3]);
// Note: GreatCircle Distance is always >= 0.0 (not negative)
- if((temp=GreatCircle.calc(lat, lon, mlat, mlon)) < distance) {
+ if ((temp=GreatCircle.calc(lat, lon, mlat, mlon)) < distance) {
// 8/26/2016 Management has determined that Accuracy is preferred over speed in bad situations
// Local DC Aware Load Balancing appears to have the highest normal performance, with the best
// Degraded Accuracy
// 8/26/2016 Management has determined that Accuracy is preferred over speed in bad situations
// Local DC Aware Load Balancing appears to have the highest normal performance, with the best
// Degraded Accuracy
@SuppressWarnings("unchecked")
public Resettable(Env env, String propData) throws APIException {
@SuppressWarnings("unchecked")
public Resettable(Env env, String propData) throws APIException {
try {
cls = (Class<? extends Exception>)Class.forName(split[0]);
} catch (ClassNotFoundException e) {
throw new APIException("Declared Cassandra Reset Exception, " + propData + ", cannot be ClassLoaded");
}
}
try {
cls = (Class<? extends Exception>)Class.forName(split[0]);
} catch (ClassNotFoundException e) {
throw new APIException("Declared Cassandra Reset Exception, " + propData + ", cannot be ClassLoaded");
}
}