The CassandraServer is not doing the read, step through the code from the call 
to readColumnFamily() in getSlice().

The read is passed to the StorageProxy.readProtocol() which looks at the CL and 
determines if its a weak or strong read, sends it out to all the replicas and 
manages everything. Eventually the request ends up as the ReadVerbHandler() 
where it will deserialise an instance of the SliceFromReadCommand and call it's 
getRow(). From there you can trace through how the count is used. 

Do you have a case where a call to the API returned more or less data than 
expected?

Hope that helps.
Aaron

On 17 Nov 2010, at 21:03, Hayarobi Park wrote:

> 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. 
> 
> 

Reply via email to