hbase-thrift 0.20.5
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +202 -0
- data/README.textile +21 -0
- data/lib/Hbase.thrift +562 -0
- data/lib/gen-rb/hbase.rb +2213 -0
- data/lib/gen-rb/hbase_constants.rb +16 -0
- data/lib/gen-rb/hbase_types.rb +226 -0
- data/lib/hbase-thrift.rb +1 -0
- data/lib/hbase_thrift.rb +7 -0
- metadata +91 -0
data/LICENSE.txt
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
178
|
+
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
180
|
+
|
181
|
+
To apply the Apache License to your work, attach the following
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
+
replaced with your own identifying information. (Don't include
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
185
|
+
comment syntax for the file format. We also recommend that a
|
186
|
+
file or class name and description of purpose be included on the
|
187
|
+
same "printed page" as the copyright notice for easier
|
188
|
+
identification within third-party archives.
|
189
|
+
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
191
|
+
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
+
you may not use this file except in compliance with the License.
|
194
|
+
You may obtain a copy of the License at
|
195
|
+
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
+
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
+
See the License for the specific language governing permissions and
|
202
|
+
limitations under the License.
|
data/README.textile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
h1. HBase Thrift
|
2
|
+
|
3
|
+
Just the thrift interface and its generated Ruby code. Maybe some more idiomatic Ruby in the future.
|
4
|
+
|
5
|
+
h2. Running HBase
|
6
|
+
|
7
|
+
Follow the standard instructions for installing and running the HBase server. As of version 0.20.0, it appears that the Thrift server needs to be started with:
|
8
|
+
|
9
|
+
<pre><code>hbase thrift start</code></pre>
|
10
|
+
|
11
|
+
and *not* the hbase-daemon.sh script as indicated in multiple places.
|
12
|
+
|
13
|
+
h2. Regenerating the code
|
14
|
+
|
15
|
+
There's a rake task to generate the ruby files in gen-rb from the lib/Hbase.thrift. To regenerate, run:
|
16
|
+
|
17
|
+
<pre><code>rake thrift:gen</code></pre>
|
18
|
+
|
19
|
+
h2. Version?
|
20
|
+
|
21
|
+
To keep things simpler, the version of the gem will always match the version of HBase that the Thrift file came from.
|
data/lib/Hbase.thrift
ADDED
@@ -0,0 +1,562 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
4
|
+
* distributed with this work for additional information
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
7
|
+
* "License"); you may not use this file except in compliance
|
8
|
+
* with the License. You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*/
|
18
|
+
|
19
|
+
// ----------------------------------------------------------------
|
20
|
+
// HBase.thrift -
|
21
|
+
//
|
22
|
+
// This is a Thrift interface definition file for the Hbase service.
|
23
|
+
// Target language libraries for C++, Java, Ruby, PHP, (and more) are
|
24
|
+
// generated by running this file through the Thrift compiler with the
|
25
|
+
// appropriate flags. The Thrift compiler binary and runtime
|
26
|
+
// libraries for various languages is currently available from
|
27
|
+
// Facebook (http://developers.facebook.com/thrift/). The intent is
|
28
|
+
// for the Thrift project to migrate to Apache Incubator.
|
29
|
+
//
|
30
|
+
// See the package.html file for information on the version of Thrift
|
31
|
+
// used to generate the *.java files checked into the Hbase project.
|
32
|
+
// ----------------------------------------------------------------
|
33
|
+
|
34
|
+
namespace java org.apache.hadoop.hbase.thrift.generated
|
35
|
+
namespace cpp apache.hadoop.hbase.thrift
|
36
|
+
namespace rb Apache.Hadoop.Hbase.Thrift
|
37
|
+
namespace py hbase
|
38
|
+
namespace perl Hbase
|
39
|
+
|
40
|
+
// note: other language namespaces tbd...
|
41
|
+
|
42
|
+
//
|
43
|
+
// Types
|
44
|
+
//
|
45
|
+
|
46
|
+
// NOTE: all variables with the Text type are assumed to be correctly
|
47
|
+
// formatted UTF-8 strings. This is a programming language and locale
|
48
|
+
// dependent property that the client application is repsonsible for
|
49
|
+
// maintaining. If strings with an invalid encoding are sent, an
|
50
|
+
// IOError will be thrown.
|
51
|
+
|
52
|
+
typedef binary Text
|
53
|
+
typedef binary Bytes
|
54
|
+
typedef i32 ScannerID
|
55
|
+
|
56
|
+
/**
|
57
|
+
* TCell - Used to transport a cell value (byte[]) and the timestamp it was
|
58
|
+
* stored with together as a result for get and getRow methods. This promotes
|
59
|
+
* the timestamp of a cell to a first-class value, making it easy to take
|
60
|
+
* note of temporal data. Cell is used all the way from HStore up to HTable.
|
61
|
+
*/
|
62
|
+
struct TCell{
|
63
|
+
1:Bytes value,
|
64
|
+
2:i64 timestamp
|
65
|
+
}
|
66
|
+
|
67
|
+
/**
|
68
|
+
* An HColumnDescriptor contains information about a column family
|
69
|
+
* such as the number of versions, compression settings, etc. It is
|
70
|
+
* used as input when creating a table or adding a column.
|
71
|
+
*/
|
72
|
+
struct ColumnDescriptor {
|
73
|
+
1:Text name,
|
74
|
+
2:i32 maxVersions = 3,
|
75
|
+
3:string compression = "NONE",
|
76
|
+
4:bool inMemory = 0,
|
77
|
+
5:string bloomFilterType = "NONE",
|
78
|
+
6:i32 bloomFilterVectorSize = 0,
|
79
|
+
7:i32 bloomFilterNbHashes = 0,
|
80
|
+
8:bool blockCacheEnabled = 0,
|
81
|
+
9:i32 timeToLive = -1
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* A TRegionInfo contains information about an HTable region.
|
86
|
+
*/
|
87
|
+
struct TRegionInfo {
|
88
|
+
1:Text startKey,
|
89
|
+
2:Text endKey,
|
90
|
+
3:i64 id,
|
91
|
+
4:Text name,
|
92
|
+
5:byte version
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* A Mutation object is used to either update or delete a column-value.
|
97
|
+
*/
|
98
|
+
struct Mutation {
|
99
|
+
1:bool isDelete = 0,
|
100
|
+
2:Text column,
|
101
|
+
3:Text value
|
102
|
+
}
|
103
|
+
|
104
|
+
|
105
|
+
/**
|
106
|
+
* A BatchMutation object is used to apply a number of Mutations to a single row.
|
107
|
+
*/
|
108
|
+
struct BatchMutation {
|
109
|
+
1:Text row,
|
110
|
+
2:list<Mutation> mutations
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Holds row name and then a map of columns to cells.
|
116
|
+
*/
|
117
|
+
struct TRowResult {
|
118
|
+
1:Text row,
|
119
|
+
2:map<Text, TCell> columns
|
120
|
+
}
|
121
|
+
|
122
|
+
//
|
123
|
+
// Exceptions
|
124
|
+
//
|
125
|
+
/**
|
126
|
+
* An IOError exception signals that an error occurred communicating
|
127
|
+
* to the Hbase master or an Hbase region server. Also used to return
|
128
|
+
* more general Hbase error conditions.
|
129
|
+
*/
|
130
|
+
exception IOError {
|
131
|
+
1:string message
|
132
|
+
}
|
133
|
+
|
134
|
+
/**
|
135
|
+
* An IllegalArgument exception indicates an illegal or invalid
|
136
|
+
* argument was passed into a procedure.
|
137
|
+
*/
|
138
|
+
exception IllegalArgument {
|
139
|
+
1:string message
|
140
|
+
}
|
141
|
+
|
142
|
+
/**
|
143
|
+
* An AlreadyExists exceptions signals that a table with the specified
|
144
|
+
* name already exists
|
145
|
+
*/
|
146
|
+
exception AlreadyExists {
|
147
|
+
1:string message
|
148
|
+
}
|
149
|
+
|
150
|
+
//
|
151
|
+
// Service
|
152
|
+
//
|
153
|
+
|
154
|
+
service Hbase {
|
155
|
+
/**
|
156
|
+
* Brings a table on-line (enables it)
|
157
|
+
* @param tableName name of the table
|
158
|
+
*/
|
159
|
+
void enableTable(1:Bytes tableName)
|
160
|
+
throws (1:IOError io)
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Disables a table (takes it off-line) If it is being served, the master
|
164
|
+
* will tell the servers to stop serving it.
|
165
|
+
* @param tableName name of the table
|
166
|
+
*/
|
167
|
+
void disableTable(1:Bytes tableName)
|
168
|
+
throws (1:IOError io)
|
169
|
+
|
170
|
+
/**
|
171
|
+
* @param tableName name of table to check
|
172
|
+
* @return true if table is on-line
|
173
|
+
*/
|
174
|
+
bool isTableEnabled(1:Bytes tableName)
|
175
|
+
throws (1:IOError io)
|
176
|
+
|
177
|
+
void compact(1:Bytes tableNameOrRegionName)
|
178
|
+
throws (1:IOError io)
|
179
|
+
|
180
|
+
void majorCompact(1:Bytes tableNameOrRegionName)
|
181
|
+
throws (1:IOError io)
|
182
|
+
|
183
|
+
/**
|
184
|
+
* List all the userspace tables.
|
185
|
+
* @return - returns a list of names
|
186
|
+
*/
|
187
|
+
list<Text> getTableNames()
|
188
|
+
throws (1:IOError io)
|
189
|
+
|
190
|
+
/**
|
191
|
+
* List all the column families assoicated with a table.
|
192
|
+
* @param tableName table name
|
193
|
+
* @return list of column family descriptors
|
194
|
+
*/
|
195
|
+
map<Text,ColumnDescriptor> getColumnDescriptors (1:Text tableName)
|
196
|
+
throws (1:IOError io)
|
197
|
+
|
198
|
+
/**
|
199
|
+
* List the regions associated with a table.
|
200
|
+
* @param tableName table name
|
201
|
+
* @return list of region descriptors
|
202
|
+
*/
|
203
|
+
list<TRegionInfo> getTableRegions(1:Text tableName)
|
204
|
+
throws (1:IOError io)
|
205
|
+
|
206
|
+
/**
|
207
|
+
* Create a table with the specified column families. The name
|
208
|
+
* field for each ColumnDescriptor must be set and must end in a
|
209
|
+
* colon (:). All other fields are optional and will get default
|
210
|
+
* values if not explicitly specified.
|
211
|
+
*
|
212
|
+
* @param tableName name of table to create
|
213
|
+
* @param columnFamilies list of column family descriptors
|
214
|
+
*
|
215
|
+
* @throws IllegalArgument if an input parameter is invalid
|
216
|
+
* @throws AlreadyExists if the table name already exists
|
217
|
+
*/
|
218
|
+
void createTable(1:Text tableName, 2:list<ColumnDescriptor> columnFamilies)
|
219
|
+
throws (1:IOError io, 2:IllegalArgument ia, 3:AlreadyExists exist)
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Deletes a table
|
223
|
+
* @param tableName name of table to delete
|
224
|
+
* @throws IOError if table doesn't exist on server or there was some other
|
225
|
+
* problem
|
226
|
+
*/
|
227
|
+
void deleteTable(1:Text tableName)
|
228
|
+
throws (1:IOError io)
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Get a single TCell for the specified table, row, and column at the
|
232
|
+
* latest timestamp. Returns an empty list if no such value exists.
|
233
|
+
*
|
234
|
+
* @param tableName name of table
|
235
|
+
* @param row row key
|
236
|
+
* @param column column name
|
237
|
+
* @return value for specified row/column
|
238
|
+
*/
|
239
|
+
list<TCell> get(1:Text tableName, 2:Text row, 3:Text column)
|
240
|
+
throws (1:IOError io)
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Get the specified number of versions for the specified table,
|
244
|
+
* row, and column.
|
245
|
+
*
|
246
|
+
* @param tableName name of table
|
247
|
+
* @param row row key
|
248
|
+
* @param column column name
|
249
|
+
* @param numVersions number of versions to retrieve
|
250
|
+
* @return list of cells for specified row/column
|
251
|
+
*/
|
252
|
+
list<TCell> getVer(1:Text tableName, 2:Text row, 3:Text column,
|
253
|
+
4:i32 numVersions)
|
254
|
+
throws (1:IOError io)
|
255
|
+
|
256
|
+
/**
|
257
|
+
* Get the specified number of versions for the specified table,
|
258
|
+
* row, and column. Only versions less than or equal to the specified
|
259
|
+
* timestamp will be returned.
|
260
|
+
*
|
261
|
+
* @param tableName name of table
|
262
|
+
* @param row row key
|
263
|
+
* @param column column name
|
264
|
+
* @param timestamp timestamp
|
265
|
+
* @param numVersions number of versions to retrieve
|
266
|
+
* @return list of cells for specified row/column
|
267
|
+
*/
|
268
|
+
list<TCell> getVerTs(1:Text tableName, 2:Text row, 3:Text column,
|
269
|
+
4:i64 timestamp, 5:i32 numVersions)
|
270
|
+
throws (1:IOError io)
|
271
|
+
|
272
|
+
/**
|
273
|
+
* Get all the data for the specified table and row at the latest
|
274
|
+
* timestamp. Returns an empty list if the row does not exist.
|
275
|
+
*
|
276
|
+
* @param tableName name of table
|
277
|
+
* @param row row key
|
278
|
+
* @return TRowResult containing the row and map of columns to TCells
|
279
|
+
*/
|
280
|
+
list<TRowResult> getRow(1:Text tableName, 2:Text row)
|
281
|
+
throws (1:IOError io)
|
282
|
+
|
283
|
+
/**
|
284
|
+
* Get the specified columns for the specified table and row at the latest
|
285
|
+
* timestamp. Returns an empty list if the row does not exist.
|
286
|
+
*
|
287
|
+
* @param tableName name of table
|
288
|
+
* @param row row key
|
289
|
+
* @param columns List of columns to return, null for all columns
|
290
|
+
* @return TRowResult containing the row and map of columns to TCells
|
291
|
+
*/
|
292
|
+
list<TRowResult> getRowWithColumns(1:Text tableName, 2:Text row,
|
293
|
+
3:list<Text> columns)
|
294
|
+
throws (1:IOError io)
|
295
|
+
|
296
|
+
/**
|
297
|
+
* Get all the data for the specified table and row at the specified
|
298
|
+
* timestamp. Returns an empty list if the row does not exist.
|
299
|
+
*
|
300
|
+
* @param tableName of table
|
301
|
+
* @param row row key
|
302
|
+
* @param timestamp timestamp
|
303
|
+
* @return TRowResult containing the row and map of columns to TCells
|
304
|
+
*/
|
305
|
+
list<TRowResult> getRowTs(1:Text tableName, 2:Text row, 3:i64 timestamp)
|
306
|
+
throws (1:IOError io)
|
307
|
+
|
308
|
+
/**
|
309
|
+
* Get the specified columns for the specified table and row at the specified
|
310
|
+
* timestamp. Returns an empty list if the row does not exist.
|
311
|
+
*
|
312
|
+
* @param tableName name of table
|
313
|
+
* @param row row key
|
314
|
+
* @param columns List of columns to return, null for all columns
|
315
|
+
* @return TRowResult containing the row and map of columns to TCells
|
316
|
+
*/
|
317
|
+
list<TRowResult> getRowWithColumnsTs(1:Text tableName, 2:Text row,
|
318
|
+
3:list<Text> columns, 4:i64 timestamp)
|
319
|
+
throws (1:IOError io)
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Apply a series of mutations (updates/deletes) to a row in a
|
323
|
+
* single transaction. If an exception is thrown, then the
|
324
|
+
* transaction is aborted. Default current timestamp is used, and
|
325
|
+
* all entries will have an identical timestamp.
|
326
|
+
*
|
327
|
+
* @param tableName name of table
|
328
|
+
* @param row row key
|
329
|
+
* @param mutations list of mutation commands
|
330
|
+
*/
|
331
|
+
void mutateRow(1:Text tableName, 2:Text row, 3:list<Mutation> mutations)
|
332
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
333
|
+
|
334
|
+
/**
|
335
|
+
* Apply a series of mutations (updates/deletes) to a row in a
|
336
|
+
* single transaction. If an exception is thrown, then the
|
337
|
+
* transaction is aborted. The specified timestamp is used, and
|
338
|
+
* all entries will have an identical timestamp.
|
339
|
+
*
|
340
|
+
* @param tableName name of table
|
341
|
+
* @param row row key
|
342
|
+
* @param mutations list of mutation commands
|
343
|
+
* @param timestamp timestamp
|
344
|
+
*/
|
345
|
+
void mutateRowTs(1:Text tableName, 2:Text row, 3:list<Mutation> mutations, 4:i64 timestamp)
|
346
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
347
|
+
|
348
|
+
/**
|
349
|
+
* Apply a series of batches (each a series of mutations on a single row)
|
350
|
+
* in a single transaction. If an exception is thrown, then the
|
351
|
+
* transaction is aborted. Default current timestamp is used, and
|
352
|
+
* all entries will have an identical timestamp.
|
353
|
+
*
|
354
|
+
* @param tableName name of table
|
355
|
+
* @param rowBatches list of row batches
|
356
|
+
*/
|
357
|
+
void mutateRows(1:Text tableName, 2:list<BatchMutation> rowBatches)
|
358
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
359
|
+
|
360
|
+
/**
|
361
|
+
* Apply a series of batches (each a series of mutations on a single row)
|
362
|
+
* in a single transaction. If an exception is thrown, then the
|
363
|
+
* transaction is aborted. The specified timestamp is used, and
|
364
|
+
* all entries will have an identical timestamp.
|
365
|
+
*
|
366
|
+
* @param tableName name of table
|
367
|
+
* @param rowBatches list of row batches
|
368
|
+
* @param timestamp timestamp
|
369
|
+
*/
|
370
|
+
void mutateRowsTs(1:Text tableName, 2:list<BatchMutation> rowBatches, 3:i64 timestamp)
|
371
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
372
|
+
|
373
|
+
/**
|
374
|
+
* Atomically increment the column value specified. Returns the next value post increment.
|
375
|
+
* @param tableName name of table
|
376
|
+
* @param row row to increment
|
377
|
+
* @param column name of column
|
378
|
+
* @param value amount to increment by
|
379
|
+
*/
|
380
|
+
i64 atomicIncrement(1:Text tableName, 2:Text row, 3:Text column, 4:i64 value)
|
381
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
382
|
+
|
383
|
+
/**
|
384
|
+
* Delete all cells that match the passed row and column.
|
385
|
+
*
|
386
|
+
* @param tableName name of table
|
387
|
+
* @param row Row to update
|
388
|
+
* @param column name of column whose value is to be deleted
|
389
|
+
*/
|
390
|
+
void deleteAll(1:Text tableName, 2:Text row, 3:Text column)
|
391
|
+
throws (1:IOError io)
|
392
|
+
|
393
|
+
/**
|
394
|
+
* Delete all cells that match the passed row and column and whose
|
395
|
+
* timestamp is equal-to or older than the passed timestamp.
|
396
|
+
*
|
397
|
+
* @param tableName name of table
|
398
|
+
* @param row Row to update
|
399
|
+
* @param column name of column whose value is to be deleted
|
400
|
+
* @param timestamp timestamp
|
401
|
+
*/
|
402
|
+
void deleteAllTs(1:Text tableName, 2:Text row, 3:Text column, 4:i64 timestamp)
|
403
|
+
throws (1:IOError io)
|
404
|
+
|
405
|
+
/**
|
406
|
+
* Completely delete the row's cells.
|
407
|
+
*
|
408
|
+
* @param tableName name of table
|
409
|
+
* @param row key of the row to be completely deleted.
|
410
|
+
*/
|
411
|
+
void deleteAllRow(1:Text tableName, 2:Text row)
|
412
|
+
throws (1:IOError io)
|
413
|
+
|
414
|
+
/**
|
415
|
+
* Completely delete the row's cells marked with a timestamp
|
416
|
+
* equal-to or older than the passed timestamp.
|
417
|
+
*
|
418
|
+
* @param tableName name of table
|
419
|
+
* @param row key of the row to be completely deleted.
|
420
|
+
* @param timestamp timestamp
|
421
|
+
*/
|
422
|
+
void deleteAllRowTs(1:Text tableName, 2:Text row, 3:i64 timestamp)
|
423
|
+
throws (1:IOError io)
|
424
|
+
|
425
|
+
/**
|
426
|
+
* Get a scanner on the current table starting at the specified row and
|
427
|
+
* ending at the last row in the table. Return the specified columns.
|
428
|
+
*
|
429
|
+
* @param columns columns to scan. If column name is a column family, all
|
430
|
+
* columns of the specified column family are returned. Its also possible
|
431
|
+
* to pass a regex in the column qualifier.
|
432
|
+
* @param tableName name of table
|
433
|
+
* @param startRow starting row in table to scan. send "" (empty string) to
|
434
|
+
* start at the first row.
|
435
|
+
*
|
436
|
+
* @return scanner id to be used with other scanner procedures
|
437
|
+
*/
|
438
|
+
ScannerID scannerOpen(1:Text tableName,
|
439
|
+
2:Text startRow,
|
440
|
+
3:list<Text> columns)
|
441
|
+
throws (1:IOError io)
|
442
|
+
|
443
|
+
/**
|
444
|
+
* Get a scanner on the current table starting and stopping at the
|
445
|
+
* specified rows. ending at the last row in the table. Return the
|
446
|
+
* specified columns.
|
447
|
+
*
|
448
|
+
* @param columns columns to scan. If column name is a column family, all
|
449
|
+
* columns of the specified column family are returned. Its also possible
|
450
|
+
* to pass a regex in the column qualifier.
|
451
|
+
* @param tableName name of table
|
452
|
+
* @param startRow starting row in table to scan. send "" (empty string) to
|
453
|
+
* start at the first row.
|
454
|
+
* @param stopRow row to stop scanning on. This row is *not* included in the
|
455
|
+
* scanner's results
|
456
|
+
*
|
457
|
+
* @return scanner id to be used with other scanner procedures
|
458
|
+
*/
|
459
|
+
ScannerID scannerOpenWithStop(1:Text tableName,
|
460
|
+
2:Text startRow,
|
461
|
+
3:Text stopRow,
|
462
|
+
4:list<Text> columns)
|
463
|
+
throws (1:IOError io)
|
464
|
+
|
465
|
+
/**
|
466
|
+
* Open a scanner for a given prefix. That is all rows will have the specified
|
467
|
+
* prefix. No other rows will be returned.
|
468
|
+
*
|
469
|
+
* @param tableName name of table
|
470
|
+
* @param startAndPrefix the prefix (and thus start row) of the keys you want
|
471
|
+
* @param columns the columns you want returned
|
472
|
+
* @return scanner id to use with other scanner calls
|
473
|
+
*/
|
474
|
+
ScannerID scannerOpenWithPrefix(1:Text tableName,
|
475
|
+
2:Text startAndPrefix,
|
476
|
+
3:list<Text> columns)
|
477
|
+
throws (1:IOError io)
|
478
|
+
|
479
|
+
/**
|
480
|
+
* Get a scanner on the current table starting at the specified row and
|
481
|
+
* ending at the last row in the table. Return the specified columns.
|
482
|
+
* Only values with the specified timestamp are returned.
|
483
|
+
*
|
484
|
+
* @param columns columns to scan. If column name is a column family, all
|
485
|
+
* columns of the specified column family are returned. Its also possible
|
486
|
+
* to pass a regex in the column qualifier.
|
487
|
+
* @param tableName name of table
|
488
|
+
* @param startRow starting row in table to scan. send "" (empty string) to
|
489
|
+
* start at the first row.
|
490
|
+
* @param timestamp timestamp
|
491
|
+
*
|
492
|
+
* @return scanner id to be used with other scanner procedures
|
493
|
+
*/
|
494
|
+
ScannerID scannerOpenTs(1:Text tableName,
|
495
|
+
2:Text startRow,
|
496
|
+
3:list<Text> columns,
|
497
|
+
4:i64 timestamp)
|
498
|
+
throws (1:IOError io)
|
499
|
+
|
500
|
+
/**
|
501
|
+
* Get a scanner on the current table starting and stopping at the
|
502
|
+
* specified rows. ending at the last row in the table. Return the
|
503
|
+
* specified columns. Only values with the specified timestamp are
|
504
|
+
* returned.
|
505
|
+
*
|
506
|
+
* @param columns columns to scan. If column name is a column family, all
|
507
|
+
* columns of the specified column family are returned. Its also possible
|
508
|
+
* to pass a regex in the column qualifier.
|
509
|
+
* @param tableName name of table
|
510
|
+
* @param startRow starting row in table to scan. send "" (empty string) to
|
511
|
+
* start at the first row.
|
512
|
+
* @param stopRow row to stop scanning on. This row is *not* included
|
513
|
+
* in the scanner's results
|
514
|
+
* @param timestamp timestamp
|
515
|
+
*
|
516
|
+
* @return scanner id to be used with other scanner procedures
|
517
|
+
*/
|
518
|
+
ScannerID scannerOpenWithStopTs(1:Text tableName,
|
519
|
+
2:Text startRow,
|
520
|
+
3:Text stopRow,
|
521
|
+
4:list<Text> columns,
|
522
|
+
5:i64 timestamp)
|
523
|
+
throws (1:IOError io)
|
524
|
+
|
525
|
+
/**
|
526
|
+
* Returns the scanner's current row value and advances to the next
|
527
|
+
* row in the table. When there are no more rows in the table, or a key
|
528
|
+
* greater-than-or-equal-to the scanner's specified stopRow is reached,
|
529
|
+
* an empty list is returned.
|
530
|
+
*
|
531
|
+
* @param id id of a scanner returned by scannerOpen
|
532
|
+
* @return a TRowResult containing the current row and a map of the columns to TCells.
|
533
|
+
* @throws IllegalArgument if ScannerID is invalid
|
534
|
+
* @throws NotFound when the scanner reaches the end
|
535
|
+
*/
|
536
|
+
list<TRowResult> scannerGet(1:ScannerID id)
|
537
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
538
|
+
|
539
|
+
/**
|
540
|
+
* Returns, starting at the scanner's current row value nbRows worth of
|
541
|
+
* rows and advances to the next row in the table. When there are no more
|
542
|
+
* rows in the table, or a key greater-than-or-equal-to the scanner's
|
543
|
+
* specified stopRow is reached, an empty list is returned.
|
544
|
+
*
|
545
|
+
* @param id id of a scanner returned by scannerOpen
|
546
|
+
* @param nbRows number of results to regturn
|
547
|
+
* @return a TRowResult containing the current row and a map of the columns to TCells.
|
548
|
+
* @throws IllegalArgument if ScannerID is invalid
|
549
|
+
* @throws NotFound when the scanner reaches the end
|
550
|
+
*/
|
551
|
+
list<TRowResult> scannerGetList(1:ScannerID id,2:i32 nbRows)
|
552
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
553
|
+
|
554
|
+
/**
|
555
|
+
* Closes the server-state associated with an open scanner.
|
556
|
+
*
|
557
|
+
* @param id id of a scanner returned by scannerOpen
|
558
|
+
* @throws IllegalArgument if ScannerID is invalid
|
559
|
+
*/
|
560
|
+
void scannerClose(1:ScannerID id)
|
561
|
+
throws (1:IOError io, 2:IllegalArgument ia)
|
562
|
+
}
|