You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Mathieu D'Amours <ma...@damours.org> on 2013/10/26 20:07:48 UTC

Implementing a driver for cassandra native protocol v2

Hello,

I'm currently implementing an Erlang driver for Cassandra's binary protocol v2. Most of it is straightforward, but I came across this part in [4.1.4. QUERY]:

> <flags> is a [byte] whose bits define the options for this query and
>     in particular influence what the remainder of the message contains.
>     A flag is set if the bit corresponding to its `mask` is set. Supported
>     flags are, given there mask:
>	0x01 : ...
>	0x02 : ...
>	0x03 : ...
>	0x04 : ...

Does that mean that the 0x01 flag is set if `1 << 0` is set? and 0x03 is set if `1 << 2` is set?

Thanks in advance

Mathieu

Re: Implementing a driver for cassandra native protocol v2

Posted by Jeremy Hanna <je...@gmail.com>.
Also, you might see if you could join efforts with Aleksey on https://github.com/iamaleksey/seestar as well :)  Or at least exchange ideas.

On 28 Oct 2013, at 14:17, Sylvain Lebresne <sy...@datastax.com> wrote:

> On Sat, Oct 26, 2013 at 8:07 PM, Mathieu D'Amours <ma...@damours.org>wrote:
> 
>> Hello,
>> 
>> I'm currently implementing an Erlang driver for Cassandra's binary
>> protocol v2. Most of it is straightforward, but I came across this part in
>> [4.1.4. QUERY]:
>> 
>>> <flags> is a [byte] whose bits define the options for this query and
>>>    in particular influence what the remainder of the message contains.
>>>    A flag is set if the bit corresponding to its `mask` is set.
>> Supported
>>>    flags are, given there mask:
>>>      0x01 : ...
>>>      0x02 : ...
>>>      0x03 : ...
>>>      0x04 : ...
>> 
>> Does that mean that the 0x01 flag is set if `1 << 0` is set? and 0x03 is
>> set if `1 << 2` is set?
>> 
> 
> This is what it means, but really that's a typo. The "mask" values should
> read 0x01, 0x02, 0x04, 0x08 and 0x10. I'll fix the spec.
> 
> --
> Sylvain
> 
> 
>> 
>> Thanks in advance
>> 
>> Mathieu


Re: Implementing a driver for cassandra native protocol v2

Posted by Sylvain Lebresne <sy...@datastax.com>.
Yes (I fixed both in fact).


On Mon, Oct 28, 2013 at 7:10 PM, Mathieu D'Amours <ma...@damours.org>wrote:

> Great, then I guess the same issue applies for [4.2.5.2. Rows].
>
> Le Oct 28, 2013 à 10:17 AM, Sylvain Lebresne <sy...@datastax.com> a
> écrit :
>
> > On Sat, Oct 26, 2013 at 8:07 PM, Mathieu D'Amours <mathieu@damours.org
> >wrote:
> >
> >> Hello,
> >>
> >> I'm currently implementing an Erlang driver for Cassandra's binary
> >> protocol v2. Most of it is straightforward, but I came across this part
> in
> >> [4.1.4. QUERY]:
> >>
> >>> <flags> is a [byte] whose bits define the options for this query and
> >>>    in particular influence what the remainder of the message contains.
> >>>    A flag is set if the bit corresponding to its `mask` is set.
> >> Supported
> >>>    flags are, given there mask:
> >>>      0x01 : ...
> >>>      0x02 : ...
> >>>      0x03 : ...
> >>>      0x04 : ...
> >>
> >> Does that mean that the 0x01 flag is set if `1 << 0` is set? and 0x03 is
> >> set if `1 << 2` is set?
> >>
> >
> > This is what it means, but really that's a typo. The "mask" values should
> > read 0x01, 0x02, 0x04, 0x08 and 0x10. I'll fix the spec.
> >
> > --
> > Sylvain
> >
> >
> >>
> >> Thanks in advance
> >>
> >> Mathieu
>
>

Re: Implementing a driver for cassandra native protocol v2

Posted by Mathieu D'Amours <ma...@damours.org>.
Great, then I guess the same issue applies for [4.2.5.2. Rows].

Le Oct 28, 2013 à 10:17 AM, Sylvain Lebresne <sy...@datastax.com> a écrit :

> On Sat, Oct 26, 2013 at 8:07 PM, Mathieu D'Amours <ma...@damours.org>wrote:
> 
>> Hello,
>> 
>> I'm currently implementing an Erlang driver for Cassandra's binary
>> protocol v2. Most of it is straightforward, but I came across this part in
>> [4.1.4. QUERY]:
>> 
>>> <flags> is a [byte] whose bits define the options for this query and
>>>    in particular influence what the remainder of the message contains.
>>>    A flag is set if the bit corresponding to its `mask` is set.
>> Supported
>>>    flags are, given there mask:
>>>      0x01 : ...
>>>      0x02 : ...
>>>      0x03 : ...
>>>      0x04 : ...
>> 
>> Does that mean that the 0x01 flag is set if `1 << 0` is set? and 0x03 is
>> set if `1 << 2` is set?
>> 
> 
> This is what it means, but really that's a typo. The "mask" values should
> read 0x01, 0x02, 0x04, 0x08 and 0x10. I'll fix the spec.
> 
> --
> Sylvain
> 
> 
>> 
>> Thanks in advance
>> 
>> Mathieu


Re: Implementing a driver for cassandra native protocol v2

Posted by Sylvain Lebresne <sy...@datastax.com>.
On Sat, Oct 26, 2013 at 8:07 PM, Mathieu D'Amours <ma...@damours.org>wrote:

> Hello,
>
> I'm currently implementing an Erlang driver for Cassandra's binary
> protocol v2. Most of it is straightforward, but I came across this part in
> [4.1.4. QUERY]:
>
> > <flags> is a [byte] whose bits define the options for this query and
> >     in particular influence what the remainder of the message contains.
> >     A flag is set if the bit corresponding to its `mask` is set.
> Supported
> >     flags are, given there mask:
> >       0x01 : ...
> >       0x02 : ...
> >       0x03 : ...
> >       0x04 : ...
>
> Does that mean that the 0x01 flag is set if `1 << 0` is set? and 0x03 is
> set if `1 << 2` is set?
>

This is what it means, but really that's a typo. The "mask" values should
read 0x01, 0x02, 0x04, 0x08 and 0x10. I'll fix the spec.

--
Sylvain


>
> Thanks in advance
>
> Mathieu