View Source

h1. Requests

h2. Set With Meta

{code:none}
Byte/ 0 | 1 | 2 | 3 |
/ | | | |
|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
+---------------+---------------+---------------+---------------+
0| 0x80 | 0xa2 | 0x00 | 0x05 |
+---------------+---------------+---------------+---------------+
4| 0x18 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
8| 0x00 | 0x00 | 0x00 | 0x20 |
+---------------+---------------+---------------+---------------+
12| 0xde | 0xad | 0xbe | 0xef |
+---------------+---------------+---------------+---------------+
16| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
20| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
24| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
28| 0x00 | 0x00 | 0x00 | 0x0a |
+---------------+---------------+---------------+---------------+
32| 0xbe | 0xef | 0xca | 0xfe |
+---------------+---------------+---------------+---------------+
36| 0xde | 0xad | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+
40| 0xca | 0xfe | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+
44| 0xde | 0xad | 0xbe | 0xef |
+---------------+---------------+---------------+---------------+
48| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
52| 0x6d ('m') | 0x79 ('y') | 0x6b ('k') | 0x65 ('e') |
+---------------+---------------+---------------+---------------+
56| 0x79 ('y') | 0x6d ('m') | 0x79 ('y') | 0x76 ('v') |
+---------------+---------------+---------------+---------------+
60| 0x61 ('a') | 0x6c ('l') | 0x75 ('u') | 0x65 ('e') |
+---------------+---------------+---------------+---------------+

set with meta command
Field (offset) (value)
Magic (0) : 0x80
Opcode (1) : 0xa2
Key length (2,3) : 0x0005
Extra length (4) : 0x18
Data type (5) : 0x00
Vbucket (6,7) : 0x0000
Total body (8-11) : 0x00000020 == 0x14 + 5 + 7
Opaque (12-15): 0xdeadbeef
CAS (16-23): 0x0000000000000000
Flags (24-27): 0x00000000
Expiration (28-31): 0x0000000a
Seqno (32-39): 0xbeefcafedeadbabe
Remote CAS (40-47): 0xcafebabedeadbeef
Options (48-51): 0x00000000
Key (52-56): mykey
Value (57-63): myvalue
{code}

The options field can be used for specifying different behaviors from the set with meta command. Specifying 0x00 is the default behavior and will enable conflict resolution. To disable conflict resolution specify 0x01.

Note that the format above can be used with different opcodes to define slightly different behavior. These opcodes define setq with meta (0xa3), add with meta (0xa4), and addq with meta (0xa5).

h2. Delete With Meta

{code:none}
Byte/ 0 | 1 | 2 | 3 |
/ | | | |
|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
+---------------+---------------+---------------+---------------+
0| 0x80 | 0xa8 | 0x00 | 0x05 |
+---------------+---------------+---------------+---------------+
4| 0x18 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
8| 0x00 | 0x00 | 0x00 | 0x19 |
+---------------+---------------+---------------+---------------+
12| 0xde | 0xad | 0xbe | 0xef |
+---------------+---------------+---------------+---------------+
16| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
20| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
24| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
28| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
32| 0xbe | 0xef | 0xca | 0xfe |
+---------------+---------------+---------------+---------------+
36| 0xde | 0xad | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+
40| 0xca | 0xfe | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+
44| 0xde | 0xad | 0xbe | 0xef |
+---------------+---------------+---------------+---------------+
48| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
52| 0x6d ('m') | 0x79 ('y') | 0x6b ('k') | 0x65 ('e') |
+---------------+---------------+---------------+---------------+
56| 0x79 ('y') |
+---------------+

delete with meta command
Field (offset) (value)
Magic (0) : 0x80
Opcode (1) : 0xa8
Key length (2,3) : 0x0005
Extra length (4) : 0x18
Data type (5) : 0x00
Vbucket (6,7) : 0x0000
Total body (8-11) : 0x00000019 == 0x14 + 5 + 0
Opaque (12-15): 0xdeadbeef
CAS (16-23): 0x0000000000000000
Flags (24-27): 0x00000000
Expiration (28-31): 0x00000000
Seqno (32-39): 0xbeefcafedeadbabe
Remote CAS (40-47): 0xcafebabedeadbeef
Options (48-51): 0x00000000
Key (52-56): mykey
{code}

The options field can be used for specifying different behaviors from the delete with meta command. Specifying 0x00 is the default behavior and will enable conflict resolution. To disable conflict resolution specify 0x01.

For deleteq with meta use opcode 0xa9.

h2. Get With Meta

{code:none}
Byte/ 0 | 1 | 2 | 3 |
/ | | | |
|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
+---------------+---------------+---------------+---------------+
0| 0x80 | 0xa0 | 0x00 | 0x05 |
+---------------+---------------+---------------+---------------+
4| 0x14 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
8| 0x00 | 0x00 | 0x00 | 0x05 |
+---------------+---------------+---------------+---------------+
12| 0xde | 0xad | 0xbe | 0xef |
+---------------+---------------+---------------+---------------+
16| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
20| 0xca | 0xfe | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+
24| 0xbe | 0xef | 0xca | 0xfe |
+---------------+---------------+---------------+---------------+
48| 0x6d ('m') | 0x79 ('y') | 0x6b ('k') | 0x65 ('e') |
+---------------+---------------+---------------+---------------+
52| 0x79 ('y') |
+---------------+

delete with meta command
Field (offset) (value)
Magic (0) : 0x80
Opcode (1) : 0xa0
Key length (2,3) : 0x0005
Extra length (4) : 0x00
Data type (5) : 0x00
Vbucket (6,7) : 0x0000
Total body (8-11) : 0x00000005
Opaque (12-15): 0xdeadbeef
CAS (16-23): 0xcafebabebeefcafe
Key (48-52): mykey
{code}

For getq with meta use opcode 0xa1.

h1. Responses

h2. Get With Meta

{code:none}
Byte/ 0 | 1 | 2 | 3 |
/ | | | |
|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|0 1 2 3 4 5 6 7|
+---------------+---------------+---------------+---------------+
0| 0x80 | 0xa0 | 0x00 | 0x05 |
+---------------+---------------+---------------+---------------+
4| 0x18 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
8| 0x00 | 0x00 | 0x00 | 0x14 |
+---------------+---------------+---------------+---------------+
12| 0xde | 0xad | 0xbe | 0xef |
+---------------+---------------+---------------+---------------+
16| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
20| 0xca | 0xfe | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+
24| 0xbe | 0xef | 0xca | 0xfe |
+---------------+---------------+---------------+---------------+
28| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
32| 0x00 | 0x00 | 0x00 | 0x00 |
+---------------+---------------+---------------+---------------+
36| 0xbe | 0xef | 0xca | 0xfe |
+---------------+---------------+---------------+---------------+
40| 0xde | 0xad | 0xba | 0xbe |
+---------------+---------------+---------------+---------------+

get with meta response
Field (offset) (value)
Magic (0) : 0x80
Opcode (1) : 0xa0
Key length (2,3) : 0x0000
Extra length (4) : 0x14
Data type (5) : 0x00
Vbucket (6,7) : 0x0000
Total body (8-11) : 0x00000014 == 0x14 + 0 + 0
Opaque (12-15): 0xdeadbeef
CAS (16-23): 0xcafebabebeefcafe
Meta-Data Flags (24-27): 0x00000000
Item Flags (28-21): 0x00000000
Expiration (32-35): 0x00000000
Seqno (36-43): 0xbeefcafedeadbabe
{code}