hbase-rb 0.90.4.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/README.md +69 -0
- data/Rakefile +2 -0
- data/hbase-rb.gemspec +20 -0
- data/lib/Hbase.thrift +757 -0
- data/lib/hbase-rb.rb +10 -0
- data/lib/hbase/hbase.rb +2578 -0
- data/lib/hbase/hbase_types.rb +225 -0
- metadata +79 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# HBase For Ruby Made Easy
|
2
|
+
|
3
|
+
<!--[![Build Status](https://secure.travis-ci.org/highgroove/hbase-rb.png)](http://travis-ci.org/highgroove/hbase-rb)-->
|
4
|
+
|
5
|
+
To use [HBase](http://hbase.apache.org/) with [Apache
|
6
|
+
Thrift](http://thrift.apache.org/), you might have to manually generate
|
7
|
+
Ruby code from generic *.thrift files.
|
8
|
+
|
9
|
+
This gem tries to alleviate that slight annoyance by packaging everything
|
10
|
+
you need to communicate with HBase.
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
### Bundler
|
15
|
+
|
16
|
+
Add to `Gemfile` and run `bundle install`:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'hbase-rb'
|
20
|
+
```
|
21
|
+
|
22
|
+
### Without Bundler
|
23
|
+
|
24
|
+
Install the gem:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
gem install hbase-rb
|
28
|
+
```
|
29
|
+
|
30
|
+
Require it explicitly in your scripts:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
require "rubygems"
|
34
|
+
require "hbase-rb"
|
35
|
+
```
|
36
|
+
|
37
|
+
## Versioning
|
38
|
+
|
39
|
+
The version of the gem matches the version of HBase the interface was
|
40
|
+
generated against.
|
41
|
+
|
42
|
+
For instance, when using HBase 0.90.4:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
gem 'hbase-rb', '0.90.4'
|
46
|
+
```
|
47
|
+
|
48
|
+
## Usage
|
49
|
+
|
50
|
+
This library simply exposes the generated Ruby code from Thrift.
|
51
|
+
**Therefore it is not necessarily very idiomatic Ruby.**
|
52
|
+
|
53
|
+
For example:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
socket = Thrift::Socket.new('localhost', 9090)
|
57
|
+
|
58
|
+
transport = Thrift::BufferedTransport(socket)
|
59
|
+
transport.open
|
60
|
+
|
61
|
+
protocol = Thrift::BinaryProtocol.new(transport)
|
62
|
+
client = HBase::Client.new(protocol)
|
63
|
+
|
64
|
+
puts client.getTableNames
|
65
|
+
```
|
66
|
+
|
67
|
+
## API Reference
|
68
|
+
|
69
|
+
* [Hbase/ThriftApi](http://wiki.apache.org/hadoop/Hbase/ThriftApi)
|
data/Rakefile
ADDED
data/hbase-rb.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "hbase-rb"
|
5
|
+
s.version = "0.90.4.pre1"
|
6
|
+
s.authors = ["Andy Lindeman"]
|
7
|
+
s.email = ["andy@highgroove.com"]
|
8
|
+
s.homepage = "http://github.com/highgroove/hbase-rb"
|
9
|
+
s.summary = %q{Generated HBase Thrift bindings for Ruby packed into a gem}
|
10
|
+
s.description = %q{Everything you need to build a Ruby client for HBase}
|
11
|
+
|
12
|
+
s.files = `git ls-files`.split("\n")
|
13
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
15
|
+
s.require_paths = ["lib"]
|
16
|
+
|
17
|
+
s.add_dependency "thrift", ">=0.7.0"
|
18
|
+
|
19
|
+
s.add_development_dependency "rake"
|
20
|
+
end
|
data/lib/Hbase.thrift
ADDED
@@ -0,0 +1,757 @@
|
|
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 are available
|
27
|
+
// from the Apache Incubator (http://incubator.apache.org/thrift/)
|
28
|
+
//
|
29
|
+
// See the package.html file for information on the version of Thrift
|
30
|
+
// used to generate the *.java files checked into the Hbase project.
|
31
|
+
// ----------------------------------------------------------------
|
32
|
+
|
33
|
+
namespace java org.apache.hadoop.hbase.thrift.generated
|
34
|
+
namespace cpp apache.hadoop.hbase.thrift
|
35
|
+
namespace rb Apache.Hadoop.Hbase.Thrift
|
36
|
+
namespace py hbase
|
37
|
+
namespace perl Hbase
|
38
|
+
|
39
|
+
//
|
40
|
+
// Types
|
41
|
+
//
|
42
|
+
|
43
|
+
// NOTE: all variables with the Text type are assumed to be correctly
|
44
|
+
// formatted UTF-8 strings. This is a programming language and locale
|
45
|
+
// dependent property that the client application is repsonsible for
|
46
|
+
// maintaining. If strings with an invalid encoding are sent, an
|
47
|
+
// IOError will be thrown.
|
48
|
+
|
49
|
+
typedef binary Text
|
50
|
+
typedef binary Bytes
|
51
|
+
typedef i32 ScannerID
|
52
|
+
|
53
|
+
/**
|
54
|
+
* TCell - Used to transport a cell value (byte[]) and the timestamp it was
|
55
|
+
* stored with together as a result for get and getRow methods. This promotes
|
56
|
+
* the timestamp of a cell to a first-class value, making it easy to take
|
57
|
+
* note of temporal data. Cell is used all the way from HStore up to HTable.
|
58
|
+
*/
|
59
|
+
struct TCell{
|
60
|
+
1:Bytes value,
|
61
|
+
2:i64 timestamp
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* An HColumnDescriptor contains information about a column family
|
66
|
+
* such as the number of versions, compression settings, etc. It is
|
67
|
+
* used as input when creating a table or adding a column.
|
68
|
+
*/
|
69
|
+
struct ColumnDescriptor {
|
70
|
+
1:Text name,
|
71
|
+
2:i32 maxVersions = 3,
|
72
|
+
3:string compression = "NONE",
|
73
|
+
4:bool inMemory = 0,
|
74
|
+
5:string bloomFilterType = "NONE",
|
75
|
+
6:i32 bloomFilterVectorSize = 0,
|
76
|
+
7:i32 bloomFilterNbHashes = 0,
|
77
|
+
8:bool blockCacheEnabled = 0,
|
78
|
+
9:i32 timeToLive = -1
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* A TRegionInfo contains information about an HTable region.
|
83
|
+
*/
|
84
|
+
struct TRegionInfo {
|
85
|
+
1:Text startKey,
|
86
|
+
2:Text endKey,
|
87
|
+
3:i64 id,
|
88
|
+
4:Text name,
|
89
|
+
5:byte version
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* A Mutation object is used to either update or delete a column-value.
|
94
|
+
*/
|
95
|
+
struct Mutation {
|
96
|
+
1:bool isDelete = 0,
|
97
|
+
2:Text column,
|
98
|
+
3:Text value
|
99
|
+
}
|
100
|
+
|
101
|
+
|
102
|
+
/**
|
103
|
+
* A BatchMutation object is used to apply a number of Mutations to a single row.
|
104
|
+
*/
|
105
|
+
struct BatchMutation {
|
106
|
+
1:Text row,
|
107
|
+
2:list<Mutation> mutations
|
108
|
+
}
|
109
|
+
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Holds row name and then a map of columns to cells.
|
113
|
+
*/
|
114
|
+
struct TRowResult {
|
115
|
+
1:Text row,
|
116
|
+
2:map<Text, TCell> columns
|
117
|
+
}
|
118
|
+
|
119
|
+
//
|
120
|
+
// Exceptions
|
121
|
+
//
|
122
|
+
/**
|
123
|
+
* An IOError exception signals that an error occurred communicating
|
124
|
+
* to the Hbase master or an Hbase region server. Also used to return
|
125
|
+
* more general Hbase error conditions.
|
126
|
+
*/
|
127
|
+
exception IOError {
|
128
|
+
1:string message
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* An IllegalArgument exception indicates an illegal or invalid
|
133
|
+
* argument was passed into a procedure.
|
134
|
+
*/
|
135
|
+
exception IllegalArgument {
|
136
|
+
1:string message
|
137
|
+
}
|
138
|
+
|
139
|
+
/**
|
140
|
+
* An AlreadyExists exceptions signals that a table with the specified
|
141
|
+
* name already exists
|
142
|
+
*/
|
143
|
+
exception AlreadyExists {
|
144
|
+
1:string message
|
145
|
+
}
|
146
|
+
|
147
|
+
//
|
148
|
+
// Service
|
149
|
+
//
|
150
|
+
|
151
|
+
service Hbase {
|
152
|
+
/**
|
153
|
+
* Brings a table on-line (enables it)
|
154
|
+
*/
|
155
|
+
void enableTable(
|
156
|
+
/** name of the table */
|
157
|
+
1:Bytes tableName
|
158
|
+
) throws (1:IOError io)
|
159
|
+
|
160
|
+
/**
|
161
|
+
* Disables a table (takes it off-line) If it is being served, the master
|
162
|
+
* will tell the servers to stop serving it.
|
163
|
+
*/
|
164
|
+
void disableTable(
|
165
|
+
/** name of the table */
|
166
|
+
1:Bytes tableName
|
167
|
+
) throws (1:IOError io)
|
168
|
+
|
169
|
+
/**
|
170
|
+
* @return true if table is on-line
|
171
|
+
*/
|
172
|
+
bool isTableEnabled(
|
173
|
+
/** name of the table to check */
|
174
|
+
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
|
+
*
|
186
|
+
* @return returns a list of names
|
187
|
+
*/
|
188
|
+
list<Text> getTableNames()
|
189
|
+
throws (1:IOError io)
|
190
|
+
|
191
|
+
/**
|
192
|
+
* List all the column families assoicated with a table.
|
193
|
+
*
|
194
|
+
* @return list of column family descriptors
|
195
|
+
*/
|
196
|
+
map<Text,ColumnDescriptor> getColumnDescriptors (
|
197
|
+
/** table name */
|
198
|
+
1:Text tableName
|
199
|
+
) throws (1:IOError io)
|
200
|
+
|
201
|
+
/**
|
202
|
+
* List the regions associated with a table.
|
203
|
+
*
|
204
|
+
* @return list of region descriptors
|
205
|
+
*/
|
206
|
+
list<TRegionInfo> getTableRegions(
|
207
|
+
/** table name */
|
208
|
+
1:Text tableName)
|
209
|
+
throws (1:IOError io)
|
210
|
+
|
211
|
+
/**
|
212
|
+
* Create a table with the specified column families. The name
|
213
|
+
* field for each ColumnDescriptor must be set and must end in a
|
214
|
+
* colon (:). All other fields are optional and will get default
|
215
|
+
* values if not explicitly specified.
|
216
|
+
*
|
217
|
+
* @throws IllegalArgument if an input parameter is invalid
|
218
|
+
*
|
219
|
+
* @throws AlreadyExists if the table name already exists
|
220
|
+
*/
|
221
|
+
void createTable(
|
222
|
+
/** name of table to create */
|
223
|
+
1:Text tableName,
|
224
|
+
|
225
|
+
/** list of column family descriptors */
|
226
|
+
2:list<ColumnDescriptor> columnFamilies
|
227
|
+
) throws (1:IOError io, 2:IllegalArgument ia, 3:AlreadyExists exist)
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Deletes a table
|
231
|
+
*
|
232
|
+
* @throws IOError if table doesn't exist on server or there was some other
|
233
|
+
* problem
|
234
|
+
*/
|
235
|
+
void deleteTable(
|
236
|
+
/** name of table to delete */
|
237
|
+
1:Text tableName
|
238
|
+
) throws (1:IOError io)
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Get a single TCell for the specified table, row, and column at the
|
242
|
+
* latest timestamp. Returns an empty list if no such value exists.
|
243
|
+
*
|
244
|
+
* @return value for specified row/column
|
245
|
+
*/
|
246
|
+
list<TCell> get(
|
247
|
+
/** name of table */
|
248
|
+
1:Text tableName,
|
249
|
+
|
250
|
+
/** row key */
|
251
|
+
2:Text row,
|
252
|
+
|
253
|
+
/** column name */
|
254
|
+
3:Text column
|
255
|
+
) throws (1:IOError io)
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Get the specified number of versions for the specified table,
|
259
|
+
* row, and column.
|
260
|
+
*
|
261
|
+
* @return list of cells for specified row/column
|
262
|
+
*/
|
263
|
+
list<TCell> getVer(
|
264
|
+
/** name of table */
|
265
|
+
1:Text tableName,
|
266
|
+
|
267
|
+
/** row key */
|
268
|
+
2:Text row,
|
269
|
+
|
270
|
+
/** column name */
|
271
|
+
3:Text column,
|
272
|
+
|
273
|
+
/** number of versions to retrieve */
|
274
|
+
4:i32 numVersions
|
275
|
+
) throws (1:IOError io)
|
276
|
+
|
277
|
+
/**
|
278
|
+
* Get the specified number of versions for the specified table,
|
279
|
+
* row, and column. Only versions less than or equal to the specified
|
280
|
+
* timestamp will be returned.
|
281
|
+
*
|
282
|
+
* @return list of cells for specified row/column
|
283
|
+
*/
|
284
|
+
list<TCell> getVerTs(
|
285
|
+
/** name of table */
|
286
|
+
1:Text tableName,
|
287
|
+
|
288
|
+
/** row key */
|
289
|
+
2:Text row,
|
290
|
+
|
291
|
+
/** column name */
|
292
|
+
3:Text column,
|
293
|
+
|
294
|
+
/** timestamp */
|
295
|
+
4:i64 timestamp,
|
296
|
+
|
297
|
+
/** number of versions to retrieve */
|
298
|
+
5:i32 numVersions
|
299
|
+
) throws (1:IOError io)
|
300
|
+
|
301
|
+
/**
|
302
|
+
* Get all the data for the specified table and row at the latest
|
303
|
+
* timestamp. Returns an empty list if the row does not exist.
|
304
|
+
*
|
305
|
+
* @return TRowResult containing the row and map of columns to TCells
|
306
|
+
*/
|
307
|
+
list<TRowResult> getRow(
|
308
|
+
/** name of table */
|
309
|
+
1:Text tableName,
|
310
|
+
|
311
|
+
/** row key */
|
312
|
+
2:Text row
|
313
|
+
) throws (1:IOError io)
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Get the specified columns for the specified table and row at the latest
|
317
|
+
* timestamp. Returns an empty list if the row does not exist.
|
318
|
+
*
|
319
|
+
* @return TRowResult containing the row and map of columns to TCells
|
320
|
+
*/
|
321
|
+
list<TRowResult> getRowWithColumns(
|
322
|
+
/** name of table */
|
323
|
+
1:Text tableName,
|
324
|
+
|
325
|
+
/** row key */
|
326
|
+
2:Text row,
|
327
|
+
|
328
|
+
/** List of columns to return, null for all columns */
|
329
|
+
3:list<Text> columns
|
330
|
+
) throws (1:IOError io)
|
331
|
+
|
332
|
+
/**
|
333
|
+
* Get all the data for the specified table and row at the specified
|
334
|
+
* timestamp. Returns an empty list if the row does not exist.
|
335
|
+
*
|
336
|
+
* @return TRowResult containing the row and map of columns to TCells
|
337
|
+
*/
|
338
|
+
list<TRowResult> getRowTs(
|
339
|
+
/** name of the table */
|
340
|
+
1:Text tableName,
|
341
|
+
|
342
|
+
/** row key */
|
343
|
+
2:Text row,
|
344
|
+
|
345
|
+
/** timestamp */
|
346
|
+
3:i64 timestamp
|
347
|
+
) throws (1:IOError io)
|
348
|
+
|
349
|
+
/**
|
350
|
+
* Get the specified columns for the specified table and row at the specified
|
351
|
+
* timestamp. Returns an empty list if the row does not exist.
|
352
|
+
*
|
353
|
+
* @return TRowResult containing the row and map of columns to TCells
|
354
|
+
*/
|
355
|
+
list<TRowResult> getRowWithColumnsTs(
|
356
|
+
/** name of table */
|
357
|
+
1:Text tableName,
|
358
|
+
|
359
|
+
/** row key */
|
360
|
+
2:Text row,
|
361
|
+
|
362
|
+
/** List of columns to return, null for all columns */
|
363
|
+
3:list<Text> columns,
|
364
|
+
4:i64 timestamp
|
365
|
+
) throws (1:IOError io)
|
366
|
+
|
367
|
+
/**
|
368
|
+
* Get all the data for the specified table and rows at the latest
|
369
|
+
* timestamp. Returns an empty list if no rows exist.
|
370
|
+
*
|
371
|
+
* @return TRowResult containing the rows and map of columns to TCells
|
372
|
+
*/
|
373
|
+
list<TRowResult> getRows(
|
374
|
+
/** name of table */
|
375
|
+
1:Text tableName,
|
376
|
+
|
377
|
+
/** row keys */
|
378
|
+
2:list<Text> rows
|
379
|
+
) throws (1:IOError io)
|
380
|
+
|
381
|
+
/**
|
382
|
+
* Get the specified columns for the specified table and rows at the latest
|
383
|
+
* timestamp. Returns an empty list if no rows exist.
|
384
|
+
*
|
385
|
+
* @return TRowResult containing the rows and map of columns to TCells
|
386
|
+
*/
|
387
|
+
list<TRowResult> getRowsWithColumns(
|
388
|
+
/** name of table */
|
389
|
+
1:Text tableName,
|
390
|
+
|
391
|
+
/** row keys */
|
392
|
+
2:list<Text> rows
|
393
|
+
|
394
|
+
/** List of columns to return, null for all columns */
|
395
|
+
3:list<Text> columns
|
396
|
+
) throws (1:IOError io)
|
397
|
+
|
398
|
+
/**
|
399
|
+
* Get all the data for the specified table and rows at the specified
|
400
|
+
* timestamp. Returns an empty list if no rows exist.
|
401
|
+
*
|
402
|
+
* @return TRowResult containing the rows and map of columns to TCells
|
403
|
+
*/
|
404
|
+
list<TRowResult> getRowsTs(
|
405
|
+
/** name of the table */
|
406
|
+
1:Text tableName,
|
407
|
+
|
408
|
+
/** row keys */
|
409
|
+
2:list<Text> rows
|
410
|
+
|
411
|
+
/** timestamp */
|
412
|
+
3:i64 timestamp
|
413
|
+
) throws (1:IOError io)
|
414
|
+
|
415
|
+
/**
|
416
|
+
* Get the specified columns for the specified table and rows at the specified
|
417
|
+
* timestamp. Returns an empty list if no rows exist.
|
418
|
+
*
|
419
|
+
* @return TRowResult containing the rows and map of columns to TCells
|
420
|
+
*/
|
421
|
+
list<TRowResult> getRowsWithColumnsTs(
|
422
|
+
/** name of table */
|
423
|
+
1:Text tableName,
|
424
|
+
|
425
|
+
/** row keys */
|
426
|
+
2:list<Text> rows
|
427
|
+
|
428
|
+
/** List of columns to return, null for all columns */
|
429
|
+
3:list<Text> columns,
|
430
|
+
4:i64 timestamp
|
431
|
+
) throws (1:IOError io)
|
432
|
+
|
433
|
+
/**
|
434
|
+
* Apply a series of mutations (updates/deletes) to a row in a
|
435
|
+
* single transaction. If an exception is thrown, then the
|
436
|
+
* transaction is aborted. Default current timestamp is used, and
|
437
|
+
* all entries will have an identical timestamp.
|
438
|
+
*/
|
439
|
+
void mutateRow(
|
440
|
+
/** name of table */
|
441
|
+
1:Text tableName,
|
442
|
+
|
443
|
+
/** row key */
|
444
|
+
2:Text row,
|
445
|
+
|
446
|
+
/** list of mutation commands */
|
447
|
+
3:list<Mutation> mutations
|
448
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
449
|
+
|
450
|
+
/**
|
451
|
+
* Apply a series of mutations (updates/deletes) to a row in a
|
452
|
+
* single transaction. If an exception is thrown, then the
|
453
|
+
* transaction is aborted. The specified timestamp is used, and
|
454
|
+
* all entries will have an identical timestamp.
|
455
|
+
*/
|
456
|
+
void mutateRowTs(
|
457
|
+
/** name of table */
|
458
|
+
1:Text tableName,
|
459
|
+
|
460
|
+
/** row key */
|
461
|
+
2:Text row,
|
462
|
+
|
463
|
+
/** list of mutation commands */
|
464
|
+
3:list<Mutation> mutations,
|
465
|
+
|
466
|
+
/** timestamp */
|
467
|
+
4:i64 timestamp
|
468
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
469
|
+
|
470
|
+
/**
|
471
|
+
* Apply a series of batches (each a series of mutations on a single row)
|
472
|
+
* in a single transaction. If an exception is thrown, then the
|
473
|
+
* transaction is aborted. Default current timestamp is used, and
|
474
|
+
* all entries will have an identical timestamp.
|
475
|
+
*/
|
476
|
+
void mutateRows(
|
477
|
+
/** name of table */
|
478
|
+
1:Text tableName,
|
479
|
+
|
480
|
+
/** list of row batches */
|
481
|
+
2:list<BatchMutation> rowBatches
|
482
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
483
|
+
|
484
|
+
/**
|
485
|
+
* Apply a series of batches (each a series of mutations on a single row)
|
486
|
+
* in a single transaction. If an exception is thrown, then the
|
487
|
+
* transaction is aborted. The specified timestamp is used, and
|
488
|
+
* all entries will have an identical timestamp.
|
489
|
+
*/
|
490
|
+
void mutateRowsTs(
|
491
|
+
/** name of table */
|
492
|
+
1:Text tableName,
|
493
|
+
|
494
|
+
/** list of row batches */
|
495
|
+
2:list<BatchMutation> rowBatches,
|
496
|
+
|
497
|
+
/** timestamp */
|
498
|
+
3:i64 timestamp
|
499
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
500
|
+
|
501
|
+
/**
|
502
|
+
* Atomically increment the column value specified. Returns the next value post increment.
|
503
|
+
*/
|
504
|
+
i64 atomicIncrement(
|
505
|
+
/** name of table */
|
506
|
+
1:Text tableName,
|
507
|
+
|
508
|
+
/** row to increment */
|
509
|
+
2:Text row,
|
510
|
+
|
511
|
+
/** name of column */
|
512
|
+
3:Text column,
|
513
|
+
|
514
|
+
/** amount to increment by */
|
515
|
+
4:i64 value
|
516
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
517
|
+
|
518
|
+
/**
|
519
|
+
* Delete all cells that match the passed row and column.
|
520
|
+
*/
|
521
|
+
void deleteAll(
|
522
|
+
/** name of table */
|
523
|
+
1:Text tableName,
|
524
|
+
|
525
|
+
/** Row to update */
|
526
|
+
2:Text row,
|
527
|
+
|
528
|
+
/** name of column whose value is to be deleted */
|
529
|
+
3:Text column
|
530
|
+
) throws (1:IOError io)
|
531
|
+
|
532
|
+
/**
|
533
|
+
* Delete all cells that match the passed row and column and whose
|
534
|
+
* timestamp is equal-to or older than the passed timestamp.
|
535
|
+
*/
|
536
|
+
void deleteAllTs(
|
537
|
+
/** name of table */
|
538
|
+
1:Text tableName,
|
539
|
+
|
540
|
+
/** Row to update */
|
541
|
+
2:Text row,
|
542
|
+
|
543
|
+
/** name of column whose value is to be deleted */
|
544
|
+
3:Text column,
|
545
|
+
|
546
|
+
/** timestamp */
|
547
|
+
4:i64 timestamp
|
548
|
+
) throws (1:IOError io)
|
549
|
+
|
550
|
+
/**
|
551
|
+
* Completely delete the row's cells.
|
552
|
+
*/
|
553
|
+
void deleteAllRow(
|
554
|
+
/** name of table */
|
555
|
+
1:Text tableName,
|
556
|
+
|
557
|
+
/** key of the row to be completely deleted. */
|
558
|
+
2:Text row
|
559
|
+
) throws (1:IOError io)
|
560
|
+
|
561
|
+
/**
|
562
|
+
* Completely delete the row's cells marked with a timestamp
|
563
|
+
* equal-to or older than the passed timestamp.
|
564
|
+
*/
|
565
|
+
void deleteAllRowTs(
|
566
|
+
/** name of table */
|
567
|
+
1:Text tableName,
|
568
|
+
|
569
|
+
/** key of the row to be completely deleted. */
|
570
|
+
2:Text row,
|
571
|
+
|
572
|
+
/** timestamp */
|
573
|
+
3:i64 timestamp
|
574
|
+
) throws (1:IOError io)
|
575
|
+
|
576
|
+
/**
|
577
|
+
* Get a scanner on the current table starting at the specified row and
|
578
|
+
* ending at the last row in the table. Return the specified columns.
|
579
|
+
*
|
580
|
+
* @return scanner id to be used with other scanner procedures
|
581
|
+
*/
|
582
|
+
ScannerID scannerOpen(
|
583
|
+
/** name of table */
|
584
|
+
1:Text tableName,
|
585
|
+
|
586
|
+
/**
|
587
|
+
* Starting row in table to scan.
|
588
|
+
* Send "" (empty string) to start at the first row.
|
589
|
+
*/
|
590
|
+
2:Text startRow,
|
591
|
+
|
592
|
+
/**
|
593
|
+
* columns to scan. If column name is a column family, all
|
594
|
+
* columns of the specified column family are returned. It's also possible
|
595
|
+
* to pass a regex in the column qualifier.
|
596
|
+
*/
|
597
|
+
3:list<Text> columns
|
598
|
+
) throws (1:IOError io)
|
599
|
+
|
600
|
+
/**
|
601
|
+
* Get a scanner on the current table starting and stopping at the
|
602
|
+
* specified rows. ending at the last row in the table. Return the
|
603
|
+
* specified columns.
|
604
|
+
*
|
605
|
+
* @return scanner id to be used with other scanner procedures
|
606
|
+
*/
|
607
|
+
ScannerID scannerOpenWithStop(
|
608
|
+
/** name of table */
|
609
|
+
1:Text tableName,
|
610
|
+
|
611
|
+
/**
|
612
|
+
* Starting row in table to scan.
|
613
|
+
* Send "" (empty string) to start at the first row.
|
614
|
+
*/
|
615
|
+
2:Text startRow,
|
616
|
+
|
617
|
+
/**
|
618
|
+
* row to stop scanning on. This row is *not* included in the
|
619
|
+
* scanner's results
|
620
|
+
*/
|
621
|
+
3:Text stopRow,
|
622
|
+
|
623
|
+
/**
|
624
|
+
* columns to scan. If column name is a column family, all
|
625
|
+
* columns of the specified column family are returned. It's also possible
|
626
|
+
* to pass a regex in the column qualifier.
|
627
|
+
*/
|
628
|
+
4:list<Text> columns
|
629
|
+
) throws (1:IOError io)
|
630
|
+
|
631
|
+
/**
|
632
|
+
* Open a scanner for a given prefix. That is all rows will have the specified
|
633
|
+
* prefix. No other rows will be returned.
|
634
|
+
*
|
635
|
+
* @return scanner id to use with other scanner calls
|
636
|
+
*/
|
637
|
+
ScannerID scannerOpenWithPrefix(
|
638
|
+
/** name of table */
|
639
|
+
1:Text tableName,
|
640
|
+
|
641
|
+
/** the prefix (and thus start row) of the keys you want */
|
642
|
+
2:Text startAndPrefix,
|
643
|
+
|
644
|
+
/** the columns you want returned */
|
645
|
+
3:list<Text> columns
|
646
|
+
) throws (1:IOError io)
|
647
|
+
|
648
|
+
/**
|
649
|
+
* Get a scanner on the current table starting at the specified row and
|
650
|
+
* ending at the last row in the table. Return the specified columns.
|
651
|
+
* Only values with the specified timestamp are returned.
|
652
|
+
*
|
653
|
+
* @return scanner id to be used with other scanner procedures
|
654
|
+
*/
|
655
|
+
ScannerID scannerOpenTs(
|
656
|
+
/** name of table */
|
657
|
+
1:Text tableName,
|
658
|
+
|
659
|
+
/**
|
660
|
+
* Starting row in table to scan.
|
661
|
+
* Send "" (empty string) to start at the first row.
|
662
|
+
*/
|
663
|
+
2:Text startRow,
|
664
|
+
|
665
|
+
/**
|
666
|
+
* columns to scan. If column name is a column family, all
|
667
|
+
* columns of the specified column family are returned. It's also possible
|
668
|
+
* to pass a regex in the column qualifier.
|
669
|
+
*/
|
670
|
+
3:list<Text> columns,
|
671
|
+
|
672
|
+
/** timestamp */
|
673
|
+
4:i64 timestamp
|
674
|
+
) throws (1:IOError io)
|
675
|
+
|
676
|
+
/**
|
677
|
+
* Get a scanner on the current table starting and stopping at the
|
678
|
+
* specified rows. ending at the last row in the table. Return the
|
679
|
+
* specified columns. Only values with the specified timestamp are
|
680
|
+
* returned.
|
681
|
+
*
|
682
|
+
* @return scanner id to be used with other scanner procedures
|
683
|
+
*/
|
684
|
+
ScannerID scannerOpenWithStopTs(
|
685
|
+
/** name of table */
|
686
|
+
1:Text tableName,
|
687
|
+
|
688
|
+
/**
|
689
|
+
* Starting row in table to scan.
|
690
|
+
* Send "" (empty string) to start at the first row.
|
691
|
+
*/
|
692
|
+
2:Text startRow,
|
693
|
+
|
694
|
+
/**
|
695
|
+
* row to stop scanning on. This row is *not* included in the
|
696
|
+
* scanner's results
|
697
|
+
*/
|
698
|
+
3:Text stopRow,
|
699
|
+
|
700
|
+
/**
|
701
|
+
* columns to scan. If column name is a column family, all
|
702
|
+
* columns of the specified column family are returned. It's also possible
|
703
|
+
* to pass a regex in the column qualifier.
|
704
|
+
*/
|
705
|
+
4:list<Text> columns,
|
706
|
+
|
707
|
+
/** timestamp */
|
708
|
+
5:i64 timestamp
|
709
|
+
) throws (1:IOError io)
|
710
|
+
|
711
|
+
/**
|
712
|
+
* Returns the scanner's current row value and advances to the next
|
713
|
+
* row in the table. When there are no more rows in the table, or a key
|
714
|
+
* greater-than-or-equal-to the scanner's specified stopRow is reached,
|
715
|
+
* an empty list is returned.
|
716
|
+
*
|
717
|
+
* @return a TRowResult containing the current row and a map of the columns to TCells.
|
718
|
+
*
|
719
|
+
* @throws IllegalArgument if ScannerID is invalid
|
720
|
+
*
|
721
|
+
* @throws NotFound when the scanner reaches the end
|
722
|
+
*/
|
723
|
+
list<TRowResult> scannerGet(
|
724
|
+
/** id of a scanner returned by scannerOpen */
|
725
|
+
1:ScannerID id
|
726
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
727
|
+
|
728
|
+
/**
|
729
|
+
* Returns, starting at the scanner's current row value nbRows worth of
|
730
|
+
* rows and advances to the next row in the table. When there are no more
|
731
|
+
* rows in the table, or a key greater-than-or-equal-to the scanner's
|
732
|
+
* specified stopRow is reached, an empty list is returned.
|
733
|
+
*
|
734
|
+
* @return a TRowResult containing the current row and a map of the columns to TCells.
|
735
|
+
*
|
736
|
+
* @throws IllegalArgument if ScannerID is invalid
|
737
|
+
*
|
738
|
+
* @throws NotFound when the scanner reaches the end
|
739
|
+
*/
|
740
|
+
list<TRowResult> scannerGetList(
|
741
|
+
/** id of a scanner returned by scannerOpen */
|
742
|
+
1:ScannerID id,
|
743
|
+
|
744
|
+
/** number of results to return */
|
745
|
+
2:i32 nbRows
|
746
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
747
|
+
|
748
|
+
/**
|
749
|
+
* Closes the server-state associated with an open scanner.
|
750
|
+
*
|
751
|
+
* @throws IllegalArgument if ScannerID is invalid
|
752
|
+
*/
|
753
|
+
void scannerClose(
|
754
|
+
/** id of a scanner returned by scannerOpen */
|
755
|
+
1:ScannerID id
|
756
|
+
) throws (1:IOError io, 2:IllegalArgument ia)
|
757
|
+
}
|