Merge branch 'cassandra-2.0' into cassandra-2.1.0

This commit is contained in:
Jonathan Ellis 2014-06-27 10:27:03 -05:00
commit bd6a766f98
4 changed files with 11 additions and 3 deletions

View File

@ -6,6 +6,8 @@ Merged from 2.0:
* Fix race in FileCacheService RemovalListener (CASSANDRA-7278)
* Fix inconsistent use of consistencyForCommit that allowed LOCAL_QUORUM
operations to incorrect become full QUORUM (CASSANDRA-7345)
* Properly handle unrecognized opcodes and flags (CASSANDRA-7440)
* (Hadoop) close CqlRecordWriter clients when finished (CASSANDRA-7459)
2.1.0-rc2

View File

@ -279,6 +279,9 @@ class CqlRecordWriter extends AbstractColumnFamilyRecordWriter<Map<String, ByteB
}
}
}
// close all our connections once we are done.
closeInternal();
}
/** get prepared statement id from cache, otherwise prepare it from Cassandra server*/

View File

@ -114,14 +114,15 @@ public class Frame
COMPRESSED,
TRACING;
private static final Flag[] ALL_VALUES = values();
public static EnumSet<Flag> deserialize(int flags)
{
EnumSet<Flag> set = EnumSet.noneOf(Flag.class);
Flag[] values = Flag.values();
for (int n = 0; n < 8; n++)
for (int n = 0; n < ALL_VALUES.length; n++)
{
if ((flags & (1 << n)) != 0)
set.add(values[n]);
set.add(ALL_VALUES[n]);
}
return set;
}

View File

@ -110,6 +110,8 @@ public abstract class Message
public static Type fromOpcode(int opcode, Direction direction)
{
if (opcode >= opcodeIdx.length)
throw new ProtocolException(String.format("Unknown opcode %d", opcode));
Type t = opcodeIdx[opcode];
if (t == null)
throw new ProtocolException(String.format("Unknown opcode %d", opcode));