com.datastax.driver.core.InsightsSupportVerifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cql-shaded Show documentation
Show all versions of driver-cql-shaded Show documentation
A Shaded CQL ActivityType driver for http://nosqlbench.io/
/*
* Copyright DataStax, Inc.
*
* This software can be used solely with DataStax Enterprise. Please consult the license at
* http://www.datastax.com/terms/datastax-dse-driver-license-terms
*/
package com.datastax.driver.core;
import java.util.Set;
class InsightsSupportVerifier {
private static final VersionNumber minDse6Version = VersionNumber.parse("6.0.5");
private static final VersionNumber minDse51Version = VersionNumber.parse("5.1.13");
private static final VersionNumber dse600Version = VersionNumber.parse("6.0.0");
static boolean supportsInsights(Cluster cluster) {
Set allHosts = cluster.getMetadata().getAllHosts();
if (allHosts.isEmpty()) return false;
for (Host host : allHosts) {
VersionNumber dseVersion = host.getDseVersion();
if (dseVersion == null) return false;
if (!(dseVersion.compareTo(minDse6Version) >= 0
|| (dseVersion.compareTo(dse600Version) < 0
&& dseVersion.compareTo(minDse51Version) >= 0))) {
return false;
}
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy