Skip to content

Commit ab5dc68

Browse files
authored
DOC-1885: providing the vbucket id (#2778)
Updated cbstats-key and cbstats-vkey: * Request syntax formatting * Updated key information * Add note and example on cbc-hash * Update response examples
1 parent 1a086ce commit ab5dc68

File tree

2 files changed

+179
-64
lines changed

2 files changed

+179
-64
lines changed

content/cli/cbstats/cbstats-key.dita

Lines changed: 88 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<refbody>
77
<section><title>Syntax</title>
88
<p>Request syntax:</p>
9-
<codeblock>cbstats [hostname]:11210 key [keyname] [vbid] </codeblock>
9+
<codeblock>cbstats <varname>host</varname>:11210 [common options] key <varname>keyname</varname> <varname>vbid</varname></codeblock>
1010
</section>
1111
<section><title>Description</title>
1212
<p>The following key information is available.</p>
@@ -25,53 +25,77 @@
2525
<tbody>
2626
<row>
2727
<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 clean).</entry>
28+
<entry>The key’s current cas value, as a decimal integer.</entry>
3429
<entry>KV</entry>
3530
</row>
3631
<row>
3732
<entry><codeph>key_exptime</codeph></entry>
38-
<entry>Expiration time from the epoch.</entry>
33+
<entry>Expiration time from the epoch, as a decimal integer.</entry>
3934
<entry>KV</entry>
4035
</row>
4136
<row>
4237
<entry><codeph>key_flags</codeph></entry>
43-
<entry>Flags for this key.</entry>
38+
<entry>Flags for this key, as a decimal integer.</entry>
4439
<entry>KV</entry>
4540
</row>
4641
<row>
4742
<entry><codeph>key_is_dirty</codeph></entry>
4843
<entry>If the value is not yet persisted.</entry>
4944
<entry>KV</entry>
5045
</row>
46+
<row>
47+
<entry><codeph>key_is_resident</codeph></entry>
48+
<entry>If the value is resident in memory.</entry>
49+
<entry>KV</entry>
50+
</row>
5151
<row>
5252
<entry><codeph>key_valid</codeph></entry>
53-
<entry>See description below<b>*</b>.</entry>
53+
<entry>See description below. <b>*</b></entry>
5454
<entry>V</entry>
5555
</row>
5656
<row>
5757
<entry><codeph>key_vb_state</codeph></entry>
58-
<entry>The vbucket state of this key.</entry>
58+
<entry>The vBucket state of this key.</entry>
5959
<entry>KV</entry>
6060
</row>
6161
</tbody>
6262
</tgroup>
6363
</table>
64-
<p><codeph><b>*</b>key_valid</codeph>= can have the following responses:</p>
65-
<ul>
66-
<li><codeph>this_is_a_bug</codeph>: Some case we didn’t take care of.</li>
67-
<li><codeph>dirty</codeph>:The value in memory has not been persisted yet.</li>
68-
<li><codeph>length_mismatch</codeph>: The key length in memory doesn’t match the length on the disk.</li>
69-
<li><codeph>data_mismatch</codeph>: The data in memory doesn’t match the data on disk.</li>
70-
<li><codeph>flags_mismatch</codeph>: The flags in memory don’t match the flags on disk.</li>
71-
<li><codeph>valid</codeph>: The key is both on disk and in memory</li>
72-
<li><codeph>ram_but_not_disk:</codeph> The value doesn’t exist yet on disk.</li>
73-
<li><codeph>item_deleted</codeph>: The item has been deleted.</li>
74-
</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>
7599
</section>
76100

77101

@@ -88,27 +112,58 @@
88112
</thead>
89113
<tbody>
90114
<row>
91-
<entry>KEYNAME</entry>
115+
<entry><varname>keyname</varname></entry>
92116
<entry>Name of the key.</entry>
93117
</row>
94118
<row>
95-
<entry>VBID</entry>
96-
<entry>vBucket ID.</entry>
119+
<entry><varname>vbid</varname></entry>
120+
<entry>vBucket ID. <b>†</b></entry>
97121
</row>
98122
</tbody>
99123
</tgroup>
100124
</table>
125+
126+
<sectiondiv>
127+
<p><b>†</b> To find the vBucket ID associated with a given key, you can use the <cmdname>cbc-hash</cmdname>
128+
command, which is available as part of the Couchbase C SDK (<apiname>libcouchbase</apiname>).</p>
129+
<ul>
130+
<li>For more information on the Couchbase C SDK, see <xref href="../../sdk/c/start-using-sdk.dita" />.</li>
131+
<li>For more information on the <cmdname>cbc-hash</cmdname> command, see
132+
<xref href="http://docs.couchbase.com/sdk-api/couchbase-c-client-2.8.5/md_doc_cbc.html">Couchbase C Client:
133+
cbc(1) - Couchbase Client Commandline Utility</xref>.</li>
134+
</ul>
135+
</sectiondiv>
136+
137+
<p>For common <cmdname>cbstats</cmdname> options, see <xref href="../cbstats-intro.dita#cbstats-intro"/>.</p>
101138

102139
</section>
103-
<section><title>Example</title>
140+
141+
<section>
142+
<title>Example 1: Find the vBucket ID associated with a given key</title>
143+
144+
<p><b>Request</b></p>
145+
<codeblock>cbc-hash 21st_amendment_brewery_cafe -U couchbase://localhost/beer-sample -u Administrator -P password</codeblock>
146+
147+
<p><b>Response</b></p>
148+
<codeblock>21st_amendment_brewery_cafe: [vBucket=553, Index=1] Server: 10.142.180.102:11210, CouchAPI: http://10.142.180.102:8092/beer-sample
149+
Replica #0: Index=0, Host=10.142.180.101:11210</codeblock>
150+
</section>
151+
152+
<section>
153+
<title>Example 2: Get key information</title>
154+
104155
<p><b>Request</b></p>
105-
<codeblock>cbstats 10.5.2.54:11210 key foo 115</codeblock>
106-
<p><b>Response</b></p>
107-
<p>Example response for the key <codeph>foo</codeph>:</p>
108-
<codeblock> key_cas: 41206791218746
109-
key_exptime: 0
110-
key_flags: 0
111-
key_is_dirty: 0 </codeblock>
156+
<codeblock>cbstats localhost:11210 -u Administrator -p password -b beer-sample key 21st_amendment_brewery_cafe 553</codeblock>
157+
158+
<p><b>Response</b></p>
159+
<codeblock>stats for key 21st_amendment_brewery_cafe
160+
key_cas: 1532081261254082560
161+
key_exptime: 0
162+
key_flags: 2
163+
key_is_dirty: false
164+
key_is_resident: true
165+
key_vb_state: replica</codeblock>
112166
</section>
167+
113168
</refbody>
114169
</reference>

content/cli/cbstats/cbstats-vkey.dita

Lines changed: 91 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
33
<reference id="reference_cyd_jql_ns">
44
<title><cmdname>vkey</cmdname></title>
5-
<shortdesc>Provides information on keys.</shortdesc>
5+
<shortdesc>Provides verification for keys.</shortdesc>
66
<refbody>
77
<section><title>Syntax</title>
88
<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>
1010
</section>
1111
<section><title>Description</title>
1212
<p>The following key information is available.</p>
1313
<table>
14-
<tgroup cols="3">
14+
<tgroup cols="3">
1515
<colspec colname="col1" colwidth="1.5*"/>
1616
<colspec colname="col2" colwidth="3*"/>
1717
<colspec colname="col3" colwidth="1*"/>
@@ -25,54 +25,77 @@
2525
<tbody>
2626
<row>
2727
<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>
3529
<entry>KV</entry>
3630
</row>
3731
<row>
3832
<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>
4034
<entry>KV</entry>
4135
</row>
4236
<row>
4337
<entry><codeph>key_flags</codeph></entry>
44-
<entry>Flags for this key</entry>
38+
<entry>Flags for this key, as a decimal integer.</entry>
4539
<entry>KV</entry>
4640
</row>
4741
<row>
4842
<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>
5049
<entry>KV</entry>
5150
</row>
5251
<row>
5352
<entry><codeph>key_valid</codeph></entry>
54-
<entry>See description below</entry>
53+
<entry>See description below. <b>*</b></entry>
5554
<entry>V</entry>
5655
</row>
5756
<row>
5857
<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>
6059
<entry>KV</entry>
6160
</row>
6261
</tbody>
6362
</tgroup>
6463
</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>
7699
</section>
77100

78101
<section><title>Options</title>
@@ -88,22 +111,59 @@
88111
</thead>
89112
<tbody>
90113
<row>
91-
<entry>KEYNAME</entry>
114+
<entry><varname>keyname</varname></entry>
92115
<entry>Name of the key.</entry>
93116
</row>
94117
<row>
95-
<entry>VBID</entry>
96-
<entry>vBucket ID.</entry>
118+
<entry><varname>vbid</varname></entry>
119+
<entry>vBucket ID. <b>†</b></entry>
97120
</row>
98121
</tbody>
99122
</tgroup>
100123
</table>
101124

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+
102138
</section>
103-
<section><title>Example</title>
139+
140+
<section>
141+
<title>Example 1: Find the vBucket ID associated with a given key</title>
142+
104143
<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>
106150

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>
107166
</section>
167+
108168
</refbody>
109169
</reference>

0 commit comments

Comments
 (0)