Merge branch 'cassandra-2.0' into cassandra-2.1

This commit is contained in:
Dave Brosius 2014-05-17 12:48:58 -04:00
commit 3b8482a016
2 changed files with 5 additions and 3 deletions

View File

@ -34,6 +34,7 @@ Merged from 2.0:
* Fix IllegalStateException in CqlPagingRecordReader (CASSANDRA-7198)
* Fix the InvertedIndex trigger example (CASSANDRA-7211)
* Add --resolve-ip option to 'nodetool ring' (CASSANDRA-7210)
* reduce garbage on codec flag deserialization (CASSANDRA-7244)
Merged from 1.2:
* Add Cloudstack snitch (CASSANDRA-7147)
* Update system.peers correctly when relocating tokens (CASSANDRA-7126)

View File

@ -278,14 +278,15 @@ public abstract class QueryOptions
TIMESTAMP,
NAMES_FOR_VALUES;
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 < values.length; 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;
}