boolean supports(ProtocolVersion version) { return getCassandraVersion() == null || version.minCassandraVersion().compareTo(getCassandraVersion().nextStable()) <= 0; }
cassandraVersion = cluster.protocolVersion().minCassandraVersion(); logger.warn( "Cannot find Cassandra version for host {} to parse the schema, using {} based on protocol version in use. "
ProtocolVersion.NEWEST_SUPPORTED.minCassandraVersion().toString()) .put("tokens", ImmutableSet.of(Long.toString(Long.MIN_VALUE + i++))) .put("host_id", UUID.randomUUID())
boolean supports(ProtocolVersion version) { return getCassandraVersion() == null || version.minCassandraVersion().compareTo(getCassandraVersion().nextStable()) <= 0; }
static void refreshSchema(Connection connection, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature, Cluster.Manager cluster) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { Host host = cluster.metadata.getHost(connection.address); // Neither host, nor it's version should be null. But instead of dying if there is a race or something, we can kind of try to infer // a Cassandra version from the protocol version (this is not full proof, we can have the protocol 1 against C* 2.0+, but it's worth // a shot, and since we log in this case, it should be relatively easy to debug when if this ever fail). VersionNumber cassandraVersion; if (host == null || host.getCassandraVersion() == null) { cassandraVersion = cluster.protocolVersion().minCassandraVersion(); logger.warn("Cannot find Cassandra version for host {} to parse the schema, using {} based on protocol version in use. " + "If parsing the schema fails, this could be the cause", connection.address, cassandraVersion); } else { cassandraVersion = host.getCassandraVersion(); } SchemaParser.forVersion(cassandraVersion) .refresh(cluster.getCluster(), targetType, targetKeyspace, targetName, targetSignature, connection, cassandraVersion); }
static void refreshSchema(Connection connection, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature, Cluster.Manager cluster) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { Host host = cluster.metadata.getHost(connection.address); // Neither host, nor it's version should be null. But instead of dying if there is a race or something, we can kind of try to infer // a Cassandra version from the protocol version (this is not full proof, we can have the protocol 1 against C* 2.0+, but it's worth // a shot, and since we log in this case, it should be relatively easy to debug when if this ever fail). VersionNumber cassandraVersion; if (host == null || host.getCassandraVersion() == null) { cassandraVersion = cluster.protocolVersion().minCassandraVersion(); logger.warn("Cannot find Cassandra version for host {} to parse the schema, using {} based on protocol version in use. " + "If parsing the schema fails, this could be the cause", connection.address, cassandraVersion); } else { cassandraVersion = host.getCassandraVersion(); } SchemaParser.forVersion(cassandraVersion) .refresh(cluster.getCluster(), targetType, targetKeyspace, targetName, targetSignature, connection, cassandraVersion); }
static void refreshSchema(Connection connection, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature, Cluster.Manager cluster) throws ConnectionException, BusyConnectionException, ExecutionException, InterruptedException { Host host = cluster.metadata.getHost(connection.address); // Neither host, nor it's version should be null. But instead of dying if there is a race or something, we can kind of try to infer // a Cassandra version from the protocol version (this is not full proof, we can have the protocol 1 against C* 2.0+, but it's worth // a shot, and since we log in this case, it should be relatively easy to debug when if this ever fail). VersionNumber cassandraVersion; if (host == null || host.getCassandraVersion() == null) { cassandraVersion = cluster.protocolVersion().minCassandraVersion(); logger.warn("Cannot find Cassandra version for host {} to parse the schema, using {} based on protocol version in use. " + "If parsing the schema fails, this could be the cause", connection.address, cassandraVersion); } else { cassandraVersion = host.getCassandraVersion(); } SchemaParser.forVersion(cassandraVersion) .refresh(cluster.getCluster(), targetType, targetKeyspace, targetName, targetSignature, connection, cassandraVersion); if (targetType == null || targetType == KEYSPACE || targetType == TABLE) { // Refresh the entire partition map because one keyspace or table change may trigger // re-balancing for the entire cluster. refreshPartitionMap(connection, cluster); } // Other change types do not affect the partition map so nothing to do. }
ProtocolVersion.NEWEST_SUPPORTED.minCassandraVersion().toString()) .put("tokens", ImmutableSet.of(Long.toString(Long.MIN_VALUE + i++))) .put("host_id", UUID.randomUUID())