cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r955758 - /cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java
Date Thu, 17 Jun 2010 21:57:43 GMT
Author: eevans
Date: Thu Jun 17 21:57:43 2010
New Revision: 955758

URL: http://svn.apache.org/viewvc?rev=955758&view=rev
Log:
return ByteBuffer instead of byte[] from internal methods

Patch by eevans

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java?rev=955758&r1=955757&r2=955758&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java Thu Jun 17 21:57:43
2010
@@ -261,10 +261,10 @@ public class CassandraServer implements 
         if (logger.isDebugEnabled())
             logger.debug("get_slice");
         
-        return multigetSliceInternal(curKeyspace.get(), Arrays.asList(key.array()), columnParent,
predicate, consistencyLevel).get(key.array());
+        return multigetSliceInternal(curKeyspace.get(), Arrays.asList(key.array()), columnParent,
predicate, consistencyLevel).get(key);
     }
     
-    private Map<byte[], GenericArray<ColumnOrSuperColumn>> multigetSliceInternal(String
keyspace, List<byte[]> keys,
+    private Map<ByteBuffer, GenericArray<ColumnOrSuperColumn>> multigetSliceInternal(String
keyspace, List<byte[]> keys,
             ColumnParent columnParent, SlicePredicate predicate, ConsistencyLevel consistencyLevel)
     throws InvalidRequestException, UnavailableException, TimedOutException
     {
@@ -302,18 +302,18 @@ public class CassandraServer implements 
         return getSlice(commands, consistencyLevel);
     }
     
-    private Map<byte[], GenericArray<ColumnOrSuperColumn>> getSlice(List<ReadCommand>
commands, ConsistencyLevel consistencyLevel)
+    private Map<ByteBuffer, GenericArray<ColumnOrSuperColumn>> getSlice(List<ReadCommand>
commands, ConsistencyLevel consistencyLevel)
     throws InvalidRequestException, UnavailableException, TimedOutException
     {
         Map<DecoratedKey<?>, ColumnFamily> columnFamilies = readColumnFamily(commands,
consistencyLevel);
-        Map<byte[], GenericArray<ColumnOrSuperColumn>> columnFamiliesMap = new
HashMap<byte[], GenericArray<ColumnOrSuperColumn>>();
+        Map<ByteBuffer, GenericArray<ColumnOrSuperColumn>> columnFamiliesMap
= new HashMap<ByteBuffer, GenericArray<ColumnOrSuperColumn>>();
         
         for (ReadCommand cmd : commands)
         {
             ColumnFamily cf = columnFamilies.get(StorageService.getPartitioner().decorateKey(cmd.key));
             boolean reverseOrder = cmd instanceof SliceFromReadCommand && ((SliceFromReadCommand)cmd).reversed;
             GenericArray<ColumnOrSuperColumn> avroColumns = avronateColumnFamily(cf,
cmd.queryPath.superColumnName != null, reverseOrder);
-            columnFamiliesMap.put(cmd.key, avroColumns);
+            columnFamiliesMap.put(ByteBuffer.wrap(cmd.key), avroColumns);
         }
         
         return columnFamiliesMap;



Mime
View raw message