|
2 | 2 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
|
3 | 3 | <reference id="reference_cyd_jql_ns">
|
4 | 4 | <title><cmdname>vkey</cmdname></title>
|
5 |
| - <shortdesc>Provides information on keys.</shortdesc> |
| 5 | + <shortdesc>Provides verification for keys.</shortdesc> |
6 | 6 | <refbody>
|
7 | 7 | <section><title>Syntax</title>
|
8 | 8 | <p>Request syntax:</p>
|
9 |
| - <codeblock>cbstats [hostname]:11210 vkey [keyname] [vbid] </codeblock> |
| 9 | + <codeblock>cbstats <varname>host</varname>:11210 [common options] vkey <varname>keyname</varname> <varname>vbid</varname></codeblock> |
10 | 10 | </section>
|
11 | 11 | <section><title>Description</title>
|
12 | 12 | <p>The following key information is available.</p>
|
13 | 13 | <table>
|
14 |
| - <tgroup cols="3"> |
| 14 | + <tgroup cols="3"> |
15 | 15 | <colspec colname="col1" colwidth="1.5*"/>
|
16 | 16 | <colspec colname="col2" colwidth="3*"/>
|
17 | 17 | <colspec colname="col3" colwidth="1*"/>
|
|
25 | 25 | <tbody>
|
26 | 26 | <row>
|
27 | 27 | <entry><codeph>key_cas</codeph></entry>
|
28 |
| - <entry>The keys current cas value</entry> |
29 |
| - <entry>KV</entry> |
30 |
| - </row> |
31 |
| - <row> |
32 |
| - <entry><codeph>key_data_age</codeph></entry> |
33 |
| - <entry>How long the key has waited for its value to be persisted (0 if |
34 |
| - clean)</entry> |
| 28 | + <entry>The key’s current cas value, as a decimal integer.</entry> |
35 | 29 | <entry>KV</entry>
|
36 | 30 | </row>
|
37 | 31 | <row>
|
38 | 32 | <entry><codeph>key_exptime</codeph></entry>
|
39 |
| - <entry>Expiration time from the epoch</entry> |
| 33 | + <entry>Expiration time from the epoch, as a decimal integer.</entry> |
40 | 34 | <entry>KV</entry>
|
41 | 35 | </row>
|
42 | 36 | <row>
|
43 | 37 | <entry><codeph>key_flags</codeph></entry>
|
44 |
| - <entry>Flags for this key</entry> |
| 38 | + <entry>Flags for this key, as a decimal integer.</entry> |
45 | 39 | <entry>KV</entry>
|
46 | 40 | </row>
|
47 | 41 | <row>
|
48 | 42 | <entry><codeph>key_is_dirty</codeph></entry>
|
49 |
| - <entry>If the value is not yet persisted</entry> |
| 43 | + <entry>If the value is not yet persisted.</entry> |
| 44 | + <entry>KV</entry> |
| 45 | + </row> |
| 46 | + <row> |
| 47 | + <entry><codeph>key_is_resident</codeph></entry> |
| 48 | + <entry>If the value is resident in memory.</entry> |
50 | 49 | <entry>KV</entry>
|
51 | 50 | </row>
|
52 | 51 | <row>
|
53 | 52 | <entry><codeph>key_valid</codeph></entry>
|
54 |
| - <entry>See description below</entry> |
| 53 | + <entry>See description below. <b>*</b></entry> |
55 | 54 | <entry>V</entry>
|
56 | 55 | </row>
|
57 | 56 | <row>
|
58 | 57 | <entry><codeph>key_vb_state</codeph></entry>
|
59 |
| - <entry>The vbucket state of this key</entry> |
| 58 | + <entry>The vBucket state of this key.</entry> |
60 | 59 | <entry>KV</entry>
|
61 | 60 | </row>
|
62 | 61 | </tbody>
|
63 | 62 | </tgroup>
|
64 | 63 | </table>
|
65 |
| - <p><codeph>key_valid</codeph>= can have the following responses:</p> |
66 |
| - <ul> |
67 |
| - <li><codeph>this_is_a_bug</codeph>: Some case we didn’t take care of.</li> |
68 |
| - <li><codeph>dirty</codeph>:The value in memory has not been persisted yet.</li> |
69 |
| - <li><codeph>length_mismatch</codeph>: The key length in memory doesn’t match the length on the disk.</li> |
70 |
| - <li><codeph>data_mismatch</codeph>: The data in memory doesn’t match the data on disk.</li> |
71 |
| - <li><codeph>flags_mismatch</codeph>: The flags in memory don’t match the flags on disk.</li> |
72 |
| - <li><codeph>valid</codeph>: The key is both on disk and in memory</li> |
73 |
| - <li><codeph>ram_but_not_disk:</codeph> The value doesn’t exist yet on disk.</li> |
74 |
| - <li><codeph>item_deleted</codeph>: The item has been deleted.</li> |
75 |
| - </ul> |
| 64 | + <p><b>*</b> <codeph>key_valid</codeph> can have the following responses:</p> |
| 65 | + <dl> |
| 66 | + <dlentry> |
| 67 | + <dt><codeph>this_is_a_bug</codeph></dt> |
| 68 | + <dd>Some case we didn’t take care of.</dd> |
| 69 | + </dlentry> |
| 70 | + <dlentry> |
| 71 | + <dt><codeph>dirty</codeph></dt> |
| 72 | + <dd>The value in memory has not been persisted yet.</dd> |
| 73 | + </dlentry> |
| 74 | + <dlentry> |
| 75 | + <dt><codeph>length_mismatch</codeph></dt> |
| 76 | + <dd>The key length in memory doesn’t match the length on the disk.</dd> |
| 77 | + </dlentry> |
| 78 | + <dlentry> |
| 79 | + <dt><codeph>data_mismatch</codeph></dt> |
| 80 | + <dd>The data in memory doesn’t match the data on disk.</dd> |
| 81 | + </dlentry> |
| 82 | + <dlentry> |
| 83 | + <dt><codeph>flags_mismatch</codeph></dt> |
| 84 | + <dd>The flags in memory don’t match the flags on disk.</dd> |
| 85 | + </dlentry> |
| 86 | + <dlentry> |
| 87 | + <dt><codeph>valid</codeph></dt> |
| 88 | + <dd>The key is both on disk and in memory.</dd> |
| 89 | + </dlentry> |
| 90 | + <dlentry> |
| 91 | + <dt><codeph>ram_but_not_disk</codeph></dt> |
| 92 | + <dd>The value doesn’t exist yet on disk.</dd> |
| 93 | + </dlentry> |
| 94 | + <dlentry> |
| 95 | + <dt><codeph>item_deleted</codeph></dt> |
| 96 | + <dd>The item has been deleted.</dd> |
| 97 | + </dlentry> |
| 98 | + </dl> |
76 | 99 | </section>
|
77 | 100 |
|
78 | 101 | <section><title>Options</title>
|
|
88 | 111 | </thead>
|
89 | 112 | <tbody>
|
90 | 113 | <row>
|
91 |
| - <entry>KEYNAME</entry> |
| 114 | + <entry><varname>keyname</varname></entry> |
92 | 115 | <entry>Name of the key.</entry>
|
93 | 116 | </row>
|
94 | 117 | <row>
|
95 |
| - <entry>VBID</entry> |
96 |
| - <entry>vBucket ID.</entry> |
| 118 | + <entry><varname>vbid</varname></entry> |
| 119 | + <entry>vBucket ID. <b>†</b></entry> |
97 | 120 | </row>
|
98 | 121 | </tbody>
|
99 | 122 | </tgroup>
|
100 | 123 | </table>
|
101 | 124 |
|
| 125 | + <sectiondiv> |
| 126 | + <p><b>†</b> To find the vBucket ID associated with a given key, you can use the <cmdname>cbc-hash</cmdname> |
| 127 | + command, which is available as part of the Couchbase C SDK (<apiname>libcouchbase</apiname>).</p> |
| 128 | + <ul> |
| 129 | + <li>For more information on the Couchbase C SDK, see <xref href="../../sdk/c/start-using-sdk.dita" />.</li> |
| 130 | + <li>For more information on the <cmdname>cbc-hash</cmdname> command, see |
| 131 | + <xref href="http://docs.couchbase.com/sdk-api/couchbase-c-client-2.8.5/md_doc_cbc.html">Couchbase C Client: |
| 132 | + cbc(1) - Couchbase Client Commandline Utility</xref>.</li> |
| 133 | + </ul> |
| 134 | + </sectiondiv> |
| 135 | + |
| 136 | + <p>For common <cmdname>cbstats</cmdname> options, see <xref href="../cbstats-intro.dita#cbstats-intro"/>.</p> |
| 137 | + |
102 | 138 | </section>
|
103 |
| - <section><title>Example</title> |
| 139 | + |
| 140 | + <section> |
| 141 | + <title>Example 1: Find the vBucket ID associated with a given key</title> |
| 142 | + |
104 | 143 | <p><b>Request</b></p>
|
105 |
| - <codeblock>cbstats 10.5.2.54:11210 vkey foo 115</codeblock> |
| 144 | + <codeblock>cbc-hash 21st_amendment_brewery_cafe -U couchbase://localhost/beer-sample -u Administrator -P password</codeblock> |
| 145 | + |
| 146 | + <p><b>Response</b></p> |
| 147 | + <codeblock>21st_amendment_brewery_cafe: [vBucket=553, Index=1] Server: 10.142.180.102:11210, CouchAPI: http://10.142.180.102:8092/beer-sample |
| 148 | +Replica #0: Index=0, Host=10.142.180.101:11210</codeblock> |
| 149 | + </section> |
106 | 150 |
|
| 151 | + <section> |
| 152 | + <title>Example 2: Get vkey information</title> |
| 153 | + |
| 154 | + <p><b>Request</b></p> |
| 155 | + <codeblock>cbstats localhost:11210 -u Administrator -p password -b beer-sample vkey 21st_amendment_brewery_cafe 553</codeblock> |
| 156 | + |
| 157 | + <p><b>Response</b></p> |
| 158 | + <codeblock>verification for key 21st_amendment_brewery_cafe |
| 159 | + key_cas: 1532081261254082560 |
| 160 | + key_exptime: 0 |
| 161 | + key_flags: 2 |
| 162 | + key_is_dirty: false |
| 163 | + key_is_resident: true |
| 164 | + key_valid: data_mismatch |
| 165 | + key_vb_state: replica</codeblock> |
107 | 166 | </section>
|
| 167 | + |
108 | 168 | </refbody>
|
109 | 169 | </reference>
|
0 commit comments