cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hayarobi Park <hayarobip...@gmail.com>
Subject Count of SliceRange in get_slice seems not to work
Date Wed, 17 Nov 2010 08:03:59 GMT
Hello.

I'm using cassandra (currently 0.7.0-beta3) in JAVA; with library
hector. 

It seems that cassandra ignore the count of SliceRange when received
get_slice request. 


I traced cassandra source code, and the part of code that retrieving
columns does not get count as parameter. See, 
getSlice(List<ReadCommand> commands, ConsistencyLevel consistency_level)
method in org.apache.cassandra.thrift.CassandraServer class. (line
224~238 in 0.7.0-beta3)


    private Map<ByteBuffer, List<ColumnOrSuperColumn>>
getSlice(List<ReadCommand> commands, ConsistencyLevel consistency_level)
    throws InvalidRequestException, UnavailableException,
TimedOutException
    {
        Map<DecoratedKey, ColumnFamily> columnFamilies =
readColumnFamily(commands, consistency_level);
        Map<ByteBuffer, List<ColumnOrSuperColumn>> columnFamiliesMap =
new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();
        for (ReadCommand command: commands)
        {
            ColumnFamily cf =
columnFamilies.get(StorageService.getPartitioner().decorateKey(command.key));
            boolean reverseOrder = command instanceof
SliceFromReadCommand && ((SliceFromReadCommand)command).reversed;
            List<ColumnOrSuperColumn> thriftifiedColumns =
thriftifyColumnFamily(cf, command.queryPath.superColumnName != null,
reverseOrder);
            columnFamiliesMap.put(command.key, thriftifiedColumns);
        }

        return columnFamiliesMap;
    }

When I inspected in debug mode, the command variable in for loop has the
valid count value. The thriftifyColumnFamily(cf,
command.queryPath.superColumnName != null, reverseOrder) method actually
get columns but it has no way to get count value, and return all value
that were not limit by the count. 



Mime
View raw message