mirror of https://github.com/apache/cassandra
Swap all references to 3.0 with 2.2
patch by Sam Tunnicliffe; reviewed by Aleksey Yeschenko for CASSANDRA-9352
This commit is contained in:
parent
1e44d2bd8b
commit
79e1e80627
|
|
@ -1,4 +1,4 @@
|
|||
3.0
|
||||
2.2
|
||||
* Allow roles cache to be invalidated (CASSANDRA-8967)
|
||||
* Upgrade Snappy (CASSANDRA-9063)
|
||||
* Don't start Thrift rpc by default (CASSANDRA-9319)
|
||||
|
|
|
|||
2
NEWS.txt
2
NEWS.txt
|
|
@ -13,7 +13,7 @@ restore snapshots created with the previous major version using the
|
|||
'sstableloader' tool. You can upgrade the file format of your snapshots
|
||||
using the provided 'sstableupgrade' tool.
|
||||
|
||||
3.0
|
||||
2.2
|
||||
===
|
||||
|
||||
New features
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<property name="debuglevel" value="source,lines,vars"/>
|
||||
|
||||
<!-- default version and SCM information -->
|
||||
<property name="base.version" value="3.0.0"/>
|
||||
<property name="base.version" value="2.2.0"/>
|
||||
<property name="scm.connection" value="scm:git://git.apache.org/cassandra.git"/>
|
||||
<property name="scm.developerConnection" value="scm:git://git.apache.org/cassandra.git"/>
|
||||
<property name="scm.url" value="http://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=tree"/>
|
||||
|
|
|
|||
|
|
@ -884,7 +884,7 @@ service Cassandra {
|
|||
|
||||
|
||||
/**
|
||||
* @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead.
|
||||
* @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead.
|
||||
*/
|
||||
CqlResult execute_cql_query(1:required binary query, 2:required Compression compression)
|
||||
throws (1:InvalidRequestException ire,
|
||||
|
|
@ -904,7 +904,7 @@ service Cassandra {
|
|||
|
||||
|
||||
/**
|
||||
* @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead.
|
||||
* @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead.
|
||||
*/
|
||||
CqlPreparedResult prepare_cql_query(1:required binary query, 2:required Compression compression)
|
||||
throws (1:InvalidRequestException ire)
|
||||
|
|
@ -920,7 +920,7 @@ service Cassandra {
|
|||
|
||||
|
||||
/**
|
||||
* @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead.
|
||||
* @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead.
|
||||
*/
|
||||
CqlResult execute_prepared_cql_query(1:required i32 itemId, 2:required list<binary> values)
|
||||
throws (1:InvalidRequestException ire,
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ public class Cassandra {
|
|||
public String system_update_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException;
|
||||
|
||||
/**
|
||||
* @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead.
|
||||
* @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead.
|
||||
*
|
||||
* @param query
|
||||
* @param compression
|
||||
|
|
@ -404,7 +404,7 @@ public class Cassandra {
|
|||
public CqlResult execute_cql3_query(ByteBuffer query, Compression compression, ConsistencyLevel consistency) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, org.apache.thrift.TException;
|
||||
|
||||
/**
|
||||
* @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead.
|
||||
* @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead.
|
||||
*
|
||||
* @param query
|
||||
* @param compression
|
||||
|
|
@ -423,7 +423,7 @@ public class Cassandra {
|
|||
public CqlPreparedResult prepare_cql3_query(ByteBuffer query, Compression compression) throws InvalidRequestException, org.apache.thrift.TException;
|
||||
|
||||
/**
|
||||
* @deprecated Throws InvalidRequestException since 3.0. Please use the CQL3 version instead.
|
||||
* @deprecated Throws InvalidRequestException since 2.2. Please use the CQL3 version instead.
|
||||
*
|
||||
* @param itemId
|
||||
* @param values
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public interface IAuthorizer
|
|||
{
|
||||
/**
|
||||
* Returns a set of permissions of a user on a resource.
|
||||
* Since Roles were introduced in version 3.0, Cassandra does not distinguish in any
|
||||
* Since Roles were introduced in version 2.2, Cassandra does not distinguish in any
|
||||
* meaningful way between users and roles. A role may or may not have login privileges
|
||||
* and roles may be granted to other roles. In fact, Cassandra does not really have the
|
||||
* concept of a user, except to link a client session to role. AuthenticatedUser can be
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import static org.apache.cassandra.auth.CassandraRoleManager.consistencyForRole;
|
|||
* PasswordAuthenticator is an IAuthenticator implementation
|
||||
* that keeps credentials (rolenames and bcrypt-hashed passwords)
|
||||
* internally in C* - in system_auth.roles CQL3 table.
|
||||
* Since 3.0, the management of roles (creation, modification,
|
||||
* Since 2.2, the management of roles (creation, modification,
|
||||
* querying etc is the responsibility of IRoleManager. Use of
|
||||
* PasswordAuthenticator requires the use of CassandraRoleManager
|
||||
* for storage and retrieval of encrypted passwords.
|
||||
|
|
|
|||
|
|
@ -1119,7 +1119,7 @@ public final class SystemKeyspace
|
|||
try
|
||||
{
|
||||
DataOutputBuffer out = new DataOutputBuffer();
|
||||
Range.tokenSerializer.serialize(range, out, MessagingService.VERSION_30);
|
||||
Range.tokenSerializer.serialize(range, out, MessagingService.VERSION_22);
|
||||
return out.buffer();
|
||||
}
|
||||
catch (IOException e)
|
||||
|
|
@ -1135,7 +1135,7 @@ public final class SystemKeyspace
|
|||
{
|
||||
return (Range<Token>) Range.tokenSerializer.deserialize(ByteStreams.newDataInput(ByteBufferUtil.getArray(rawRange)),
|
||||
partitioner,
|
||||
MessagingService.VERSION_30);
|
||||
MessagingService.VERSION_22);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ public class CommitLogArchiver
|
|||
descriptor = fromHeader;
|
||||
else descriptor = fromName;
|
||||
|
||||
if (descriptor.version > CommitLogDescriptor.VERSION_30)
|
||||
if (descriptor.version > CommitLogDescriptor.VERSION_22)
|
||||
throw new IllegalStateException("Unsupported commit log version: " + descriptor.version);
|
||||
|
||||
if (descriptor.compression != null) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ import com.google.common.annotations.VisibleForTesting;
|
|||
import com.google.common.base.Objects;
|
||||
import com.github.tjake.ICRC32;
|
||||
|
||||
import org.apache.cassandra.config.DatabaseDescriptor;
|
||||
import org.apache.cassandra.config.ParameterizedClass;
|
||||
import org.apache.cassandra.exceptions.ConfigurationException;
|
||||
import org.apache.cassandra.io.FSReadError;
|
||||
|
|
@ -57,13 +56,13 @@ public class CommitLogDescriptor
|
|||
public static final int VERSION_12 = 2;
|
||||
public static final int VERSION_20 = 3;
|
||||
public static final int VERSION_21 = 4;
|
||||
public static final int VERSION_30 = 5;
|
||||
public static final int VERSION_22 = 5;
|
||||
/**
|
||||
* Increment this number if there is a changes in the commit log disc layout or MessagingVersion changes.
|
||||
* Note: make sure to handle {@link #getMessagingVersion()}
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public static final int current_version = VERSION_30;
|
||||
public static final int current_version = VERSION_22;
|
||||
|
||||
final int version;
|
||||
public final long id;
|
||||
|
|
@ -89,7 +88,7 @@ public class CommitLogDescriptor
|
|||
out.putLong(descriptor.id);
|
||||
crc.updateInt((int) (descriptor.id & 0xFFFFFFFFL));
|
||||
crc.updateInt((int) (descriptor.id >>> 32));
|
||||
if (descriptor.version >= VERSION_30) {
|
||||
if (descriptor.version >= VERSION_22) {
|
||||
String parametersString = constructParametersString(descriptor);
|
||||
byte[] parametersBytes = parametersString.getBytes(StandardCharsets.UTF_8);
|
||||
if (parametersBytes.length != (((short) parametersBytes.length) & 0xFFFF))
|
||||
|
|
@ -142,7 +141,7 @@ public class CommitLogDescriptor
|
|||
checkcrc.updateInt((int) (id & 0xFFFFFFFFL));
|
||||
checkcrc.updateInt((int) (id >>> 32));
|
||||
int parametersLength = 0;
|
||||
if (version >= VERSION_30) {
|
||||
if (version >= VERSION_22) {
|
||||
parametersLength = input.readShort() & 0xFFFF;
|
||||
checkcrc.updateInt(parametersLength);
|
||||
}
|
||||
|
|
@ -194,8 +193,8 @@ public class CommitLogDescriptor
|
|||
return MessagingService.VERSION_20;
|
||||
case VERSION_21:
|
||||
return MessagingService.VERSION_21;
|
||||
case VERSION_30:
|
||||
return MessagingService.VERSION_30;
|
||||
case VERSION_22:
|
||||
return MessagingService.VERSION_22;
|
||||
default:
|
||||
throw new IllegalStateException("Unknown commitlog version " + version);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public class BigFormat implements SSTableFormat
|
|||
// index summaries can be downsampled and the sampling level is persisted
|
||||
// switch uncompressed checksums to adler32
|
||||
// tracks presense of legacy (local and remote) counter shards
|
||||
// la (3.0.0): new file name format
|
||||
// la (2.2.0): new file name format
|
||||
|
||||
private final boolean isLatestVersion;
|
||||
private final boolean hasSamplingLevel;
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ public final class MessagingService implements MessagingServiceMBean
|
|||
public static final int VERSION_12 = 6;
|
||||
public static final int VERSION_20 = 7;
|
||||
public static final int VERSION_21 = 8;
|
||||
public static final int VERSION_30 = 9;
|
||||
public static final int current_version = VERSION_30;
|
||||
public static final int VERSION_22 = 9;
|
||||
public static final int current_version = VERSION_22;
|
||||
|
||||
public static final String FAILURE_CALLBACK_PARAM = "CAL_BAC";
|
||||
public static final byte[] ONE_BYTE = new byte[1];
|
||||
|
|
|
|||
|
|
@ -1758,7 +1758,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
|
|||
|
||||
private boolean isRpcReady(InetAddress endpoint)
|
||||
{
|
||||
return MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_30 ||
|
||||
return MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_22 ||
|
||||
Gossiper.instance.getEndpointStateForEndpoint(endpoint).isRpcReady();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,10 +137,10 @@ public class FileMessageHeader
|
|||
out.writeUTF(header.version);
|
||||
|
||||
//We can't stream to a node that doesn't understand a new sstable format
|
||||
if (version < StreamMessage.VERSION_30 && header.format != SSTableFormat.Type.LEGACY && header.format != SSTableFormat.Type.BIG)
|
||||
throw new UnsupportedOperationException("Can't stream non-legacy sstables to nodes < 3.0");
|
||||
if (version < StreamMessage.VERSION_22 && header.format != SSTableFormat.Type.LEGACY && header.format != SSTableFormat.Type.BIG)
|
||||
throw new UnsupportedOperationException("Can't stream non-legacy sstables to nodes < 2.2");
|
||||
|
||||
if (version >= StreamMessage.VERSION_30)
|
||||
if (version >= StreamMessage.VERSION_22)
|
||||
out.writeUTF(header.format.name);
|
||||
|
||||
out.writeLong(header.estimatedKeys);
|
||||
|
|
@ -162,7 +162,7 @@ public class FileMessageHeader
|
|||
String sstableVersion = in.readUTF();
|
||||
|
||||
SSTableFormat.Type format = SSTableFormat.Type.LEGACY;
|
||||
if (version >= StreamMessage.VERSION_30)
|
||||
if (version >= StreamMessage.VERSION_22)
|
||||
format = SSTableFormat.Type.validate(in.readUTF());
|
||||
|
||||
long estimatedKeys = in.readLong();
|
||||
|
|
@ -182,7 +182,7 @@ public class FileMessageHeader
|
|||
size += TypeSizes.NATIVE.sizeof(header.sequenceNumber);
|
||||
size += TypeSizes.NATIVE.sizeof(header.version);
|
||||
|
||||
if (version >= StreamMessage.VERSION_30)
|
||||
if (version >= StreamMessage.VERSION_22)
|
||||
size += TypeSizes.NATIVE.sizeof(header.format.name);
|
||||
|
||||
size += TypeSizes.NATIVE.sizeof(header.estimatedKeys);
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ public abstract class StreamMessage
|
|||
{
|
||||
/** Streaming protocol version */
|
||||
public static final int VERSION_20 = 2;
|
||||
public static final int VERSION_30 = 3;
|
||||
public static final int CURRENT_VERSION = VERSION_30;
|
||||
public static final int VERSION_22 = 3;
|
||||
public static final int CURRENT_VERSION = VERSION_22;
|
||||
|
||||
public static void serialize(StreamMessage message, DataOutputStreamPlus out, int version, StreamSession session) throws IOException
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1869,7 +1869,7 @@ public class CassandraServer implements Cassandra.Iface
|
|||
|
||||
public CqlResult execute_cql_query(ByteBuffer query, Compression compression) throws TException
|
||||
{
|
||||
throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead");
|
||||
throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please use CQL3 instead");
|
||||
}
|
||||
|
||||
public CqlResult execute_cql3_query(ByteBuffer query, Compression compression, ConsistencyLevel cLevel) throws TException
|
||||
|
|
@ -1909,7 +1909,7 @@ public class CassandraServer implements Cassandra.Iface
|
|||
|
||||
public CqlPreparedResult prepare_cql_query(ByteBuffer query, Compression compression) throws TException
|
||||
{
|
||||
throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead");
|
||||
throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please use CQL3 instead");
|
||||
}
|
||||
|
||||
public CqlPreparedResult prepare_cql3_query(ByteBuffer query, Compression compression) throws TException
|
||||
|
|
@ -1934,7 +1934,7 @@ public class CassandraServer implements Cassandra.Iface
|
|||
|
||||
public CqlResult execute_prepared_cql_query(int itemId, List<ByteBuffer> bindVariables) throws TException
|
||||
{
|
||||
throw new InvalidRequestException("CQL2 has been removed in Cassandra 3.0. Please use CQL3 instead");
|
||||
throw new InvalidRequestException("CQL2 has been removed in Cassandra 2.2. Please use CQL3 instead");
|
||||
}
|
||||
|
||||
public CqlResult execute_prepared_cql3_query(int itemId, List<ByteBuffer> bindVariables, ConsistencyLevel cLevel) throws TException
|
||||
|
|
@ -2053,7 +2053,7 @@ public class CassandraServer implements Cassandra.Iface
|
|||
}
|
||||
|
||||
/*
|
||||
* No-op since 3.0.
|
||||
* No-op since 2.2.
|
||||
*/
|
||||
public void set_cql_version(String version)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -386,9 +386,9 @@ public class CommitLogTest
|
|||
{
|
||||
testDescriptorPersistence(new CommitLogDescriptor(11, null));
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_21, 13, null));
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, 15, null));
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, 17, new ParameterizedClass("LZ4Compressor", null)));
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_30, 19,
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 15, null));
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 17, new ParameterizedClass("LZ4Compressor", null)));
|
||||
testDescriptorPersistence(new CommitLogDescriptor(CommitLogDescriptor.VERSION_22, 19,
|
||||
new ParameterizedClass("StubbyCompressor", ImmutableMap.of("parameter1", "value1", "flag2", "55", "argument3", "null"))));
|
||||
}
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ public class CommitLogTest
|
|||
for (int i=0; i<65535; ++i)
|
||||
params.put("key"+i, Integer.toString(i, 16));
|
||||
try {
|
||||
CommitLogDescriptor desc = new CommitLogDescriptor(CommitLogDescriptor.VERSION_30,
|
||||
CommitLogDescriptor desc = new CommitLogDescriptor(CommitLogDescriptor.VERSION_22,
|
||||
21,
|
||||
new ParameterizedClass("LZ4Compressor", params));
|
||||
ByteBuffer buf = ByteBuffer.allocate(1024000);
|
||||
|
|
|
|||
Loading…
Reference in New Issue