It returned all columns within the range of start and end without regard
to the count. the CF is super column family and I send the range of
super column names of type Long. (and sub column name was UTF8)

I put 2000 super columns in a row, and tried to read the first 50
columns in some range of columns. I inspected
StorageProxy.readProtocol() after read your reply, and got the command
object, of class SliceFromReadCommand, has the 'count' member variable
having int value 50. 

I test get_slice request to super column family of UTF8Type/UTF8Type for
super column name/column name, and this test was successfully return the
columns with requested count.


2010-11-18 (목), 00:35 +1300, aaron morton:
> 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