Nate,
A follow up question on this:
So if I want to return multiple columns containing different data
types(as a wrapper method over Hector), what data type do I return
from my wrapper method?? I obviously won't know which column will have
which data type & I can't return ByteBuffer as a generic column value
type. Do I have to convert to byte[]??
- Soumik
On Jun 30, 11:22 pm, Nate McCall <
n...@datastax.com> wrote:
> Take a look at the internals of some classes in the template package
> for how we do this. Specifically:
https://github.com/rantav/hector/blob/master/core/src/main/java/me/pr...
>
> We should be adding getRangeSlices and getIndexedSlices to
> ColumnFamilyTemplate in the next week or so as well.
>
>
>
> On Thu, Jun 30, 2011 at 1:20 PM, Nate McCall <
n...@datastax.com> wrote:
> > ByteBuffers cannot be converted to strings directly for any data type.
>
> > Using a long as an example, to convert to a long, you would have to
> > got through the byteBuffer as above, but wrap the column.getValue()
> > call with LongerSerializer.fromByteBuffer.
>
> > On Thu, Jun 30, 2011 at 1:12 PM, soumik <
soum...@gmail.com> wrote:
> >> Hi,
> >> I'm trying out hector 0.7.0-30 with Cassandra 0.7.6-02 & I'm trying
> >> to perform rangleSlicesQuery.
> >> Problem is when I'm usingByteBufferSerializerto get the column
> >> b6a5-42a0-8c56-5532bc2e68c3,ColumnSlice([HColumn(state=java.nio.HeapByteBuffer[pos=109
> >> lim=110 cap=216]),
> >> HColumn(time_created=java.nio.HeapByteBuffer[pos=152 lim=160
> >> cap=216]), HColumn(type=java.nio.HeapByteBuffer[pos=194 lim=201
> >> cap=216])]))
> >> ColName:state
> >> ColVal: € get_range_slices $cd982cb5-b6a5-42a0-8c56-5532bc2e68c3
> >> state 2 time_created t£ type NodeMgr
> >> ColName:time_created
> >> ColVal: € get_range_slices $cd982cb5-b6a5-42a0-8c56-5532bc2e68c3
> >> state 2 time_created t£ type NodeMgr
> >> ColName:type
> >> ColVal: € get_range_slices $cd982cb5-b6a5-42a0-8c56-5532bc2e68c3
> >> state 2 time_created t£ type NodeMgr
> >> ColName:type
> >> -------------------------------
> >> I've indicated spaces for the special characters in the output above.
> >> However, if I use StringSerializer or even BytesArraySerializer I get
> >> the correct output. Can anyone help me out as to why this is behaving
> >> wrong for ByteBuffer return type?Is it the way I'm getting String from
> >> the ByteBuffer(since HeapByteBuffer seems to indicate different
> >> ByteBuffer)??
>
> >> Thanks,