use of org.apache.cassandra.utils.CassandraVersion in project cassandra by apache.
the class SSTableHeaderFix method fixNonFrozenUDTIfUpgradeFrom30.
public static void fixNonFrozenUDTIfUpgradeFrom30() {
String previousVersionString = FBUtilities.getPreviousReleaseVersionString();
if (previousVersionString == null)
return;
CassandraVersion previousVersion = new CassandraVersion(previousVersionString);
if (previousVersion.major != 3 || previousVersion.minor > 0) {
// Not an upgrade from 3.0 to 3.x, nothing to do here
return;
}
if (SKIP_AUTOMATIC_FIX_ON_UPGRADE) {
logger.warn("Detected upgrade from {} to {}, but -D{}=true, NOT fixing UDT type references in " + "sstable metadata serialization-headers", previousVersionString, FBUtilities.getReleaseVersionString(), SKIPAUTOMATICUDTFIX);
return;
}
logger.info("Detected upgrade from {} to {}, fixing UDT type references in sstable metadata serialization-headers", previousVersionString, FBUtilities.getReleaseVersionString());
SSTableHeaderFix instance = SSTableHeaderFix.builder().schemaCallback(() -> Schema.instance::getTableMetadata).build();
instance.execute();
}
use of org.apache.cassandra.utils.CassandraVersion in project cassandra by apache.
the class Gossiper method computeMinVersion.
private CassandraVersion computeMinVersion() {
CassandraVersion minVersion = null;
for (InetAddressAndPort addr : Iterables.concat(Gossiper.instance.getLiveMembers(), Gossiper.instance.getUnreachableMembers())) {
String versionString = getReleaseVersionString(addr);
// Raced with changes to gossip state, wait until next iteration
if (versionString == null)
return null;
CassandraVersion version;
try {
version = new CassandraVersion(versionString);
} catch (Throwable t) {
JVMStabilityInspector.inspectThrowable(t);
String message = String.format("Can't parse version string %s", versionString);
logger.warn(message);
if (logger.isDebugEnabled())
logger.debug(message, t);
return null;
}
if (minVersion == null || version.compareTo(minVersion) < 0)
minVersion = version;
}
return minVersion;
}
Aggregations