hyper_record 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +9 -0
- data/VERSION.yml +1 -1
- data/hyper_record.gemspec +6 -5
- data/lib/active_record/connection_adapters/hypertable_adapter.rb +25 -15
- data/lib/hypertable/gen-rb/client_service.rb +1224 -335
- data/lib/hypertable/gen-rb/client_types.rb +185 -20
- data/lib/hypertable/gen-rb/hql_service.rb +52 -44
- data/lib/hypertable/gen-rb/hql_types.rb +4 -4
- data/lib/hypertable/thrift_client.rb +5 -6
- data/pkg/hyper_record-0.9.3.gem +0 -0
- data/test/thrift_client_test.rb +116 -74
- metadata +6 -5
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
module Hypertable
|
9
9
|
module ThriftGen
|
10
|
-
module
|
10
|
+
module KeyFlag
|
11
11
|
DELETE_ROW = 0
|
12
12
|
DELETE_CF = 1
|
13
13
|
DELETE_CELL = 2
|
@@ -39,13 +39,12 @@ module Hypertable
|
|
39
39
|
# <dd>Whether the end row is included in the result (default: true)</dd>
|
40
40
|
# </dl>
|
41
41
|
class RowInterval
|
42
|
-
include ::Thrift::Struct
|
42
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
43
43
|
START_ROW = 1
|
44
44
|
START_INCLUSIVE = 2
|
45
45
|
END_ROW = 3
|
46
46
|
END_INCLUSIVE = 4
|
47
47
|
|
48
|
-
::Thrift::Struct.field_accessor self, :start_row, :start_inclusive, :end_row, :end_inclusive
|
49
48
|
FIELDS = {
|
50
49
|
START_ROW => {:type => ::Thrift::Types::STRING, :name => 'start_row', :optional => true},
|
51
50
|
START_INCLUSIVE => {:type => ::Thrift::Types::BOOL, :name => 'start_inclusive', :default => true, :optional => true},
|
@@ -58,6 +57,7 @@ module Hypertable
|
|
58
57
|
def validate
|
59
58
|
end
|
60
59
|
|
60
|
+
::Thrift::Struct.generate_accessors self
|
61
61
|
end
|
62
62
|
|
63
63
|
# Specifies a range of cells
|
@@ -84,7 +84,7 @@ module Hypertable
|
|
84
84
|
# <dd>Whether the end row is included in the result (default: true)</dd>
|
85
85
|
# </dl>
|
86
86
|
class CellInterval
|
87
|
-
include ::Thrift::Struct
|
87
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
88
88
|
START_ROW = 1
|
89
89
|
START_COLUMN = 2
|
90
90
|
START_INCLUSIVE = 3
|
@@ -92,7 +92,6 @@ module Hypertable
|
|
92
92
|
END_COLUMN = 5
|
93
93
|
END_INCLUSIVE = 6
|
94
94
|
|
95
|
-
::Thrift::Struct.field_accessor self, :start_row, :start_column, :start_inclusive, :end_row, :end_column, :end_inclusive
|
96
95
|
FIELDS = {
|
97
96
|
START_ROW => {:type => ::Thrift::Types::STRING, :name => 'start_row', :optional => true},
|
98
97
|
START_COLUMN => {:type => ::Thrift::Types::STRING, :name => 'start_column', :optional => true},
|
@@ -107,6 +106,7 @@ module Hypertable
|
|
107
106
|
def validate
|
108
107
|
end
|
109
108
|
|
109
|
+
::Thrift::Struct.generate_accessors self
|
110
110
|
end
|
111
111
|
|
112
112
|
# Specifies options for a scan
|
@@ -138,9 +138,12 @@ module Hypertable
|
|
138
138
|
#
|
139
139
|
# <dt>columns</dt>
|
140
140
|
# <dd>Specifies the names of the columns to return</dd>
|
141
|
+
#
|
142
|
+
# <dt>cell_limit</dt>
|
143
|
+
# <dd>Specifies max number of cells to return per column family per row</dd>
|
141
144
|
# </dl>
|
142
145
|
class ScanSpec
|
143
|
-
include ::Thrift::Struct
|
146
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
144
147
|
ROW_INTERVALS = 1
|
145
148
|
CELL_INTERVALS = 2
|
146
149
|
RETURN_DELETES = 3
|
@@ -150,8 +153,8 @@ module Hypertable
|
|
150
153
|
END_TIME = 7
|
151
154
|
COLUMNS = 8
|
152
155
|
KEYS_ONLY = 9
|
156
|
+
CELL_LIMIT = 10
|
153
157
|
|
154
|
-
::Thrift::Struct.field_accessor self, :row_intervals, :cell_intervals, :return_deletes, :revs, :row_limit, :start_time, :end_time, :columns, :keys_only
|
155
158
|
FIELDS = {
|
156
159
|
ROW_INTERVALS => {:type => ::Thrift::Types::LIST, :name => 'row_intervals', :element => {:type => ::Thrift::Types::STRUCT, :class => Hypertable::ThriftGen::RowInterval}, :optional => true},
|
157
160
|
CELL_INTERVALS => {:type => ::Thrift::Types::LIST, :name => 'cell_intervals', :element => {:type => ::Thrift::Types::STRUCT, :class => Hypertable::ThriftGen::CellInterval}, :optional => true},
|
@@ -161,7 +164,8 @@ module Hypertable
|
|
161
164
|
START_TIME => {:type => ::Thrift::Types::I64, :name => 'start_time', :optional => true},
|
162
165
|
END_TIME => {:type => ::Thrift::Types::I64, :name => 'end_time', :optional => true},
|
163
166
|
COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
|
164
|
-
KEYS_ONLY => {:type => ::Thrift::Types::BOOL, :name => 'keys_only', :default => false, :optional => true}
|
167
|
+
KEYS_ONLY => {:type => ::Thrift::Types::BOOL, :name => 'keys_only', :default => false, :optional => true},
|
168
|
+
CELL_LIMIT => {:type => ::Thrift::Types::I32, :name => 'cell_limit', :default => 0, :optional => true}
|
165
169
|
}
|
166
170
|
|
167
171
|
def struct_fields; FIELDS; end
|
@@ -169,6 +173,7 @@ module Hypertable
|
|
169
173
|
def validate
|
170
174
|
end
|
171
175
|
|
176
|
+
::Thrift::Struct.generate_accessors self
|
172
177
|
end
|
173
178
|
|
174
179
|
# Defines a cell key
|
@@ -195,7 +200,7 @@ module Hypertable
|
|
195
200
|
# <dd>A 16-bit integer indicating the state of the cell</dd>
|
196
201
|
# </dl>
|
197
202
|
class Key
|
198
|
-
include ::Thrift::Struct
|
203
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
199
204
|
ROW = 1
|
200
205
|
COLUMN_FAMILY = 2
|
201
206
|
COLUMN_QUALIFIER = 3
|
@@ -203,21 +208,24 @@ module Hypertable
|
|
203
208
|
REVISION = 5
|
204
209
|
FLAG = 6
|
205
210
|
|
206
|
-
::Thrift::Struct.field_accessor self, :row, :column_family, :column_qualifier, :timestamp, :revision, :flag
|
207
211
|
FIELDS = {
|
208
212
|
ROW => {:type => ::Thrift::Types::STRING, :name => 'row'},
|
209
213
|
COLUMN_FAMILY => {:type => ::Thrift::Types::STRING, :name => 'column_family'},
|
210
214
|
COLUMN_QUALIFIER => {:type => ::Thrift::Types::STRING, :name => 'column_qualifier'},
|
211
215
|
TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp', :optional => true},
|
212
216
|
REVISION => {:type => ::Thrift::Types::I64, :name => 'revision', :optional => true},
|
213
|
-
FLAG => {:type => ::Thrift::Types::
|
217
|
+
FLAG => {:type => ::Thrift::Types::I32, :name => 'flag', :default => 255, :enum_class => Hypertable::ThriftGen::KeyFlag}
|
214
218
|
}
|
215
219
|
|
216
220
|
def struct_fields; FIELDS; end
|
217
221
|
|
218
222
|
def validate
|
223
|
+
unless @flag.nil? || Hypertable::ThriftGen::KeyFlag::VALID_VALUES.include?(@flag)
|
224
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field flag!')
|
225
|
+
end
|
219
226
|
end
|
220
227
|
|
228
|
+
::Thrift::Struct.generate_accessors self
|
221
229
|
end
|
222
230
|
|
223
231
|
# Specifies options for a shared periodic mutator
|
@@ -233,12 +241,11 @@ module Hypertable
|
|
233
241
|
# <dd>Mutator flags</dt>
|
234
242
|
# </dl>
|
235
243
|
class MutateSpec
|
236
|
-
include ::Thrift::Struct
|
244
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
237
245
|
APPNAME = 1
|
238
246
|
FLUSH_INTERVAL = 2
|
239
247
|
FLAGS = 3
|
240
248
|
|
241
|
-
::Thrift::Struct.field_accessor self, :appname, :flush_interval, :flags
|
242
249
|
FIELDS = {
|
243
250
|
APPNAME => {:type => ::Thrift::Types::STRING, :name => 'appname', :default => %q""},
|
244
251
|
FLUSH_INTERVAL => {:type => ::Thrift::Types::I32, :name => 'flush_interval', :default => 1000},
|
@@ -253,6 +260,7 @@ module Hypertable
|
|
253
260
|
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field flags is unset!') unless @flags
|
254
261
|
end
|
255
262
|
|
263
|
+
::Thrift::Struct.generate_accessors self
|
256
264
|
end
|
257
265
|
|
258
266
|
# Defines a table cell
|
@@ -265,21 +273,50 @@ module Hypertable
|
|
265
273
|
# <dd>Value of a cell. Currently a sequence of uninterpreted bytes.</dd>
|
266
274
|
# </dl>
|
267
275
|
class Cell
|
268
|
-
include ::Thrift::Struct
|
276
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
269
277
|
KEY = 1
|
270
278
|
VALUE = 2
|
271
279
|
|
272
|
-
::Thrift::Struct.field_accessor self, :key, :value
|
273
280
|
FIELDS = {
|
274
281
|
KEY => {:type => ::Thrift::Types::STRUCT, :name => 'key', :class => Hypertable::ThriftGen::Key},
|
275
|
-
VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :optional => true}
|
282
|
+
VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true, :optional => true}
|
283
|
+
}
|
284
|
+
|
285
|
+
def struct_fields; FIELDS; end
|
286
|
+
|
287
|
+
def validate
|
288
|
+
end
|
289
|
+
|
290
|
+
::Thrift::Struct.generate_accessors self
|
291
|
+
end
|
292
|
+
|
293
|
+
# Defines an individual namespace listing
|
294
|
+
#
|
295
|
+
# <dl>
|
296
|
+
# <dt>name</dt>
|
297
|
+
# <dd>Name of the listing.</dd>
|
298
|
+
#
|
299
|
+
# <dt>is_namespace</dt>
|
300
|
+
# <dd>true if this entry is a namespace.</dd>
|
301
|
+
# </dl>
|
302
|
+
class NamespaceListing
|
303
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
304
|
+
NAME = 1
|
305
|
+
IS_NAMESPACE = 2
|
306
|
+
|
307
|
+
FIELDS = {
|
308
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
|
309
|
+
IS_NAMESPACE => {:type => ::Thrift::Types::BOOL, :name => 'is_namespace'}
|
276
310
|
}
|
277
311
|
|
278
312
|
def struct_fields; FIELDS; end
|
279
313
|
|
280
314
|
def validate
|
315
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
|
316
|
+
raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field is_namespace is unset!') if @is_namespace.nil?
|
281
317
|
end
|
282
318
|
|
319
|
+
::Thrift::Struct.generate_accessors self
|
283
320
|
end
|
284
321
|
|
285
322
|
# Defines a table split
|
@@ -298,13 +335,12 @@ module Hypertable
|
|
298
335
|
# <dd>The IP address of the split.</dd>
|
299
336
|
# </dl>
|
300
337
|
class TableSplit
|
301
|
-
include ::Thrift::Struct
|
338
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
302
339
|
START_ROW = 1
|
303
340
|
END_ROW = 2
|
304
341
|
LOCATION = 3
|
305
342
|
IP_ADDRESS = 4
|
306
343
|
|
307
|
-
::Thrift::Struct.field_accessor self, :start_row, :end_row, :location, :ip_address
|
308
344
|
FIELDS = {
|
309
345
|
START_ROW => {:type => ::Thrift::Types::STRING, :name => 'start_row', :optional => true},
|
310
346
|
END_ROW => {:type => ::Thrift::Types::STRING, :name => 'end_row', :optional => true},
|
@@ -317,6 +353,135 @@ module Hypertable
|
|
317
353
|
def validate
|
318
354
|
end
|
319
355
|
|
356
|
+
::Thrift::Struct.generate_accessors self
|
357
|
+
end
|
358
|
+
|
359
|
+
# Describes a ColumnFamily
|
360
|
+
# <dl>
|
361
|
+
# <dt>name</dt>
|
362
|
+
# <dd>Name of the column family</dd>
|
363
|
+
#
|
364
|
+
# <dt>ag</dt>
|
365
|
+
# <dd>Name of the access group for this CF</dd>
|
366
|
+
#
|
367
|
+
# <dt>max_versions</dt>
|
368
|
+
# <dd>Max versions of the same cell to be stored</dd>
|
369
|
+
#
|
370
|
+
# <dt>ttl</dt>
|
371
|
+
# <dd>Time to live for cells in the CF (ie delete cells older than this time)</dd>
|
372
|
+
# </dl>
|
373
|
+
class ColumnFamily
|
374
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
375
|
+
NAME = 1
|
376
|
+
AG = 2
|
377
|
+
MAX_VERSIONS = 3
|
378
|
+
TTL = 4
|
379
|
+
|
380
|
+
FIELDS = {
|
381
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :optional => true},
|
382
|
+
AG => {:type => ::Thrift::Types::STRING, :name => 'ag', :optional => true},
|
383
|
+
MAX_VERSIONS => {:type => ::Thrift::Types::I32, :name => 'max_versions', :optional => true},
|
384
|
+
TTL => {:type => ::Thrift::Types::STRING, :name => 'ttl', :optional => true}
|
385
|
+
}
|
386
|
+
|
387
|
+
def struct_fields; FIELDS; end
|
388
|
+
|
389
|
+
def validate
|
390
|
+
end
|
391
|
+
|
392
|
+
::Thrift::Struct.generate_accessors self
|
393
|
+
end
|
394
|
+
|
395
|
+
# Describes an AccessGroup
|
396
|
+
# <dl>
|
397
|
+
# <dt>name</dt>
|
398
|
+
# <dd>Name of the access group</dd>
|
399
|
+
#
|
400
|
+
# <dt>in_memory</dt>
|
401
|
+
# <dd>Is this access group in memory</dd>
|
402
|
+
#
|
403
|
+
# <dt>replication</dt>
|
404
|
+
# <dd>Replication factor for this AG</dd>
|
405
|
+
#
|
406
|
+
# <dt>blocksize</dt>
|
407
|
+
# <dd>Specifies blocksize for this AG</dd>
|
408
|
+
#
|
409
|
+
# <dt>compressor</dt>
|
410
|
+
# <dd>Specifies compressor for this AG</dd>
|
411
|
+
#
|
412
|
+
# <dt>bloom_filter</dt>
|
413
|
+
# <dd>Specifies bloom filter type</dd>
|
414
|
+
#
|
415
|
+
# <dt>columns</dt>
|
416
|
+
# <dd>Specifies list of column families in this AG</dd>
|
417
|
+
# </dl>
|
418
|
+
class AccessGroup
|
419
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
420
|
+
NAME = 1
|
421
|
+
IN_MEMORY = 2
|
422
|
+
REPLICATION = 3
|
423
|
+
BLOCKSIZE = 4
|
424
|
+
COMPRESSOR = 5
|
425
|
+
BLOOM_FILTER = 6
|
426
|
+
COLUMNS = 7
|
427
|
+
|
428
|
+
FIELDS = {
|
429
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :optional => true},
|
430
|
+
IN_MEMORY => {:type => ::Thrift::Types::BOOL, :name => 'in_memory', :optional => true},
|
431
|
+
REPLICATION => {:type => ::Thrift::Types::I16, :name => 'replication', :optional => true},
|
432
|
+
BLOCKSIZE => {:type => ::Thrift::Types::I32, :name => 'blocksize', :optional => true},
|
433
|
+
COMPRESSOR => {:type => ::Thrift::Types::STRING, :name => 'compressor', :optional => true},
|
434
|
+
BLOOM_FILTER => {:type => ::Thrift::Types::STRING, :name => 'bloom_filter', :optional => true},
|
435
|
+
COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => Hypertable::ThriftGen::ColumnFamily}, :optional => true}
|
436
|
+
}
|
437
|
+
|
438
|
+
def struct_fields; FIELDS; end
|
439
|
+
|
440
|
+
def validate
|
441
|
+
end
|
442
|
+
|
443
|
+
::Thrift::Struct.generate_accessors self
|
444
|
+
end
|
445
|
+
|
446
|
+
# Describes a schema
|
447
|
+
# <dl>
|
448
|
+
# <dt>name</dt>
|
449
|
+
# <dd>Name of the access group</dd>
|
450
|
+
#
|
451
|
+
# <dt>in_memory</dt>
|
452
|
+
# <dd>Is this access group in memory</dd>
|
453
|
+
#
|
454
|
+
# <dt>replication</dt>
|
455
|
+
# <dd>Replication factor for this AG</dd>
|
456
|
+
#
|
457
|
+
# <dt>blocksize</dt>
|
458
|
+
# <dd>Specifies blocksize for this AG</dd>
|
459
|
+
#
|
460
|
+
# <dt>compressor</dt>
|
461
|
+
# <dd>Specifies compressor for this AG</dd>
|
462
|
+
#
|
463
|
+
# <dt>bloom_filter</dt>
|
464
|
+
# <dd>Specifies bloom filter type</dd>
|
465
|
+
#
|
466
|
+
# <dt>columns</dt>
|
467
|
+
# <dd>Specifies list of column families in this AG</dd>
|
468
|
+
# </dl>
|
469
|
+
class Schema
|
470
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
471
|
+
ACCESS_GROUPS = 1
|
472
|
+
COLUMN_FAMILIES = 2
|
473
|
+
|
474
|
+
FIELDS = {
|
475
|
+
ACCESS_GROUPS => {:type => ::Thrift::Types::MAP, :name => 'access_groups', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Hypertable::ThriftGen::AccessGroup}, :optional => true},
|
476
|
+
COLUMN_FAMILIES => {:type => ::Thrift::Types::MAP, :name => 'column_families', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => Hypertable::ThriftGen::ColumnFamily}, :optional => true}
|
477
|
+
}
|
478
|
+
|
479
|
+
def struct_fields; FIELDS; end
|
480
|
+
|
481
|
+
def validate
|
482
|
+
end
|
483
|
+
|
484
|
+
::Thrift::Struct.generate_accessors self
|
320
485
|
end
|
321
486
|
|
322
487
|
# Exception for thrift clients.
|
@@ -329,11 +494,10 @@ module Hypertable
|
|
329
494
|
# Note: some languages (like php) don't have adequate namespace, so Exception
|
330
495
|
# would conflict with language builtins.
|
331
496
|
class ClientException < ::Thrift::Exception
|
332
|
-
include ::Thrift::Struct
|
497
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
333
498
|
CODE = 1
|
334
499
|
MESSAGE = 2
|
335
500
|
|
336
|
-
::Thrift::Struct.field_accessor self, :code, :message
|
337
501
|
FIELDS = {
|
338
502
|
CODE => {:type => ::Thrift::Types::I32, :name => 'code'},
|
339
503
|
MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
|
@@ -344,6 +508,7 @@ module Hypertable
|
|
344
508
|
def validate
|
345
509
|
end
|
346
510
|
|
511
|
+
::Thrift::Struct.generate_accessors self
|
347
512
|
end
|
348
513
|
|
349
514
|
end
|
@@ -14,13 +14,13 @@ require 'hql_types'
|
|
14
14
|
class Client < Hypertable::ThriftGen::ClientService::Client
|
15
15
|
include ::Thrift::Client
|
16
16
|
|
17
|
-
def hql_exec(command, noflush, unbuffered)
|
18
|
-
send_hql_exec(command, noflush, unbuffered)
|
17
|
+
def hql_exec(ns, command, noflush, unbuffered)
|
18
|
+
send_hql_exec(ns, command, noflush, unbuffered)
|
19
19
|
return recv_hql_exec()
|
20
20
|
end
|
21
21
|
|
22
|
-
def send_hql_exec(command, noflush, unbuffered)
|
23
|
-
send_message('hql_exec', Hql_exec_args, :command => command, :noflush => noflush, :unbuffered => unbuffered)
|
22
|
+
def send_hql_exec(ns, command, noflush, unbuffered)
|
23
|
+
send_message('hql_exec', Hql_exec_args, :ns => ns, :command => command, :noflush => noflush, :unbuffered => unbuffered)
|
24
24
|
end
|
25
25
|
|
26
26
|
def recv_hql_exec()
|
@@ -30,13 +30,13 @@ require 'hql_types'
|
|
30
30
|
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'hql_exec failed: unknown result')
|
31
31
|
end
|
32
32
|
|
33
|
-
def hql_query(command)
|
34
|
-
send_hql_query(command)
|
33
|
+
def hql_query(ns, command)
|
34
|
+
send_hql_query(ns, command)
|
35
35
|
return recv_hql_query()
|
36
36
|
end
|
37
37
|
|
38
|
-
def send_hql_query(command)
|
39
|
-
send_message('hql_query', Hql_query_args, :command => command)
|
38
|
+
def send_hql_query(ns, command)
|
39
|
+
send_message('hql_query', Hql_query_args, :ns => ns, :command => command)
|
40
40
|
end
|
41
41
|
|
42
42
|
def recv_hql_query()
|
@@ -46,13 +46,13 @@ require 'hql_types'
|
|
46
46
|
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'hql_query failed: unknown result')
|
47
47
|
end
|
48
48
|
|
49
|
-
def hql_exec2(command, noflush, unbuffered)
|
50
|
-
send_hql_exec2(command, noflush, unbuffered)
|
49
|
+
def hql_exec2(ns, command, noflush, unbuffered)
|
50
|
+
send_hql_exec2(ns, command, noflush, unbuffered)
|
51
51
|
return recv_hql_exec2()
|
52
52
|
end
|
53
53
|
|
54
|
-
def send_hql_exec2(command, noflush, unbuffered)
|
55
|
-
send_message('hql_exec2', Hql_exec2_args, :command => command, :noflush => noflush, :unbuffered => unbuffered)
|
54
|
+
def send_hql_exec2(ns, command, noflush, unbuffered)
|
55
|
+
send_message('hql_exec2', Hql_exec2_args, :ns => ns, :command => command, :noflush => noflush, :unbuffered => unbuffered)
|
56
56
|
end
|
57
57
|
|
58
58
|
def recv_hql_exec2()
|
@@ -62,13 +62,13 @@ require 'hql_types'
|
|
62
62
|
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'hql_exec2 failed: unknown result')
|
63
63
|
end
|
64
64
|
|
65
|
-
def hql_query2(command)
|
66
|
-
send_hql_query2(command)
|
65
|
+
def hql_query2(ns, command)
|
66
|
+
send_hql_query2(ns, command)
|
67
67
|
return recv_hql_query2()
|
68
68
|
end
|
69
69
|
|
70
|
-
def send_hql_query2(command)
|
71
|
-
send_message('hql_query2', Hql_query2_args, :command => command)
|
70
|
+
def send_hql_query2(ns, command)
|
71
|
+
send_message('hql_query2', Hql_query2_args, :ns => ns, :command => command)
|
72
72
|
end
|
73
73
|
|
74
74
|
def recv_hql_query2()
|
@@ -87,7 +87,7 @@ require 'hql_types'
|
|
87
87
|
args = read_args(iprot, Hql_exec_args)
|
88
88
|
result = Hql_exec_result.new()
|
89
89
|
begin
|
90
|
-
result.success = @handler.hql_exec(args.command, args.noflush, args.unbuffered)
|
90
|
+
result.success = @handler.hql_exec(args.ns, args.command, args.noflush, args.unbuffered)
|
91
91
|
rescue Hypertable::ThriftGen::ClientException => e
|
92
92
|
result.e = e
|
93
93
|
end
|
@@ -98,7 +98,7 @@ require 'hql_types'
|
|
98
98
|
args = read_args(iprot, Hql_query_args)
|
99
99
|
result = Hql_query_result.new()
|
100
100
|
begin
|
101
|
-
result.success = @handler.hql_query(args.command)
|
101
|
+
result.success = @handler.hql_query(args.ns, args.command)
|
102
102
|
rescue Hypertable::ThriftGen::ClientException => e
|
103
103
|
result.e = e
|
104
104
|
end
|
@@ -109,7 +109,7 @@ require 'hql_types'
|
|
109
109
|
args = read_args(iprot, Hql_exec2_args)
|
110
110
|
result = Hql_exec2_result.new()
|
111
111
|
begin
|
112
|
-
result.success = @handler.hql_exec2(args.command, args.noflush, args.unbuffered)
|
112
|
+
result.success = @handler.hql_exec2(args.ns, args.command, args.noflush, args.unbuffered)
|
113
113
|
rescue Hypertable::ThriftGen::ClientException => e
|
114
114
|
result.e = e
|
115
115
|
end
|
@@ -120,7 +120,7 @@ require 'hql_types'
|
|
120
120
|
args = read_args(iprot, Hql_query2_args)
|
121
121
|
result = Hql_query2_result.new()
|
122
122
|
begin
|
123
|
-
result.success = @handler.hql_query2(args.command)
|
123
|
+
result.success = @handler.hql_query2(args.ns, args.command)
|
124
124
|
rescue Hypertable::ThriftGen::ClientException => e
|
125
125
|
result.e = e
|
126
126
|
end
|
@@ -132,13 +132,14 @@ require 'hql_types'
|
|
132
132
|
# HELPER FUNCTIONS AND STRUCTURES
|
133
133
|
|
134
134
|
class Hql_exec_args
|
135
|
-
include ::Thrift::Struct
|
136
|
-
|
137
|
-
|
138
|
-
|
135
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
136
|
+
NS = 1
|
137
|
+
COMMAND = 2
|
138
|
+
NOFLUSH = 3
|
139
|
+
UNBUFFERED = 4
|
139
140
|
|
140
|
-
::Thrift::Struct.field_accessor self, :command, :noflush, :unbuffered
|
141
141
|
FIELDS = {
|
142
|
+
NS => {:type => ::Thrift::Types::I64, :name => 'ns'},
|
142
143
|
COMMAND => {:type => ::Thrift::Types::STRING, :name => 'command'},
|
143
144
|
NOFLUSH => {:type => ::Thrift::Types::BOOL, :name => 'noflush', :default => false},
|
144
145
|
UNBUFFERED => {:type => ::Thrift::Types::BOOL, :name => 'unbuffered', :default => false}
|
@@ -149,14 +150,14 @@ require 'hql_types'
|
|
149
150
|
def validate
|
150
151
|
end
|
151
152
|
|
153
|
+
::Thrift::Struct.generate_accessors self
|
152
154
|
end
|
153
155
|
|
154
156
|
class Hql_exec_result
|
155
|
-
include ::Thrift::Struct
|
157
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
156
158
|
SUCCESS = 0
|
157
159
|
E = 1
|
158
160
|
|
159
|
-
::Thrift::Struct.field_accessor self, :success, :e
|
160
161
|
FIELDS = {
|
161
162
|
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hypertable::ThriftGen::HqlResult},
|
162
163
|
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Hypertable::ThriftGen::ClientException}
|
@@ -167,14 +168,16 @@ require 'hql_types'
|
|
167
168
|
def validate
|
168
169
|
end
|
169
170
|
|
171
|
+
::Thrift::Struct.generate_accessors self
|
170
172
|
end
|
171
173
|
|
172
174
|
class Hql_query_args
|
173
|
-
include ::Thrift::Struct
|
174
|
-
|
175
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
176
|
+
NS = 1
|
177
|
+
COMMAND = 2
|
175
178
|
|
176
|
-
::Thrift::Struct.field_accessor self, :command
|
177
179
|
FIELDS = {
|
180
|
+
NS => {:type => ::Thrift::Types::I64, :name => 'ns'},
|
178
181
|
COMMAND => {:type => ::Thrift::Types::STRING, :name => 'command'}
|
179
182
|
}
|
180
183
|
|
@@ -183,14 +186,14 @@ require 'hql_types'
|
|
183
186
|
def validate
|
184
187
|
end
|
185
188
|
|
189
|
+
::Thrift::Struct.generate_accessors self
|
186
190
|
end
|
187
191
|
|
188
192
|
class Hql_query_result
|
189
|
-
include ::Thrift::Struct
|
193
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
190
194
|
SUCCESS = 0
|
191
195
|
E = 1
|
192
196
|
|
193
|
-
::Thrift::Struct.field_accessor self, :success, :e
|
194
197
|
FIELDS = {
|
195
198
|
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hypertable::ThriftGen::HqlResult},
|
196
199
|
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Hypertable::ThriftGen::ClientException}
|
@@ -201,16 +204,18 @@ require 'hql_types'
|
|
201
204
|
def validate
|
202
205
|
end
|
203
206
|
|
207
|
+
::Thrift::Struct.generate_accessors self
|
204
208
|
end
|
205
209
|
|
206
210
|
class Hql_exec2_args
|
207
|
-
include ::Thrift::Struct
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
212
|
+
NS = 1
|
213
|
+
COMMAND = 2
|
214
|
+
NOFLUSH = 3
|
215
|
+
UNBUFFERED = 4
|
211
216
|
|
212
|
-
::Thrift::Struct.field_accessor self, :command, :noflush, :unbuffered
|
213
217
|
FIELDS = {
|
218
|
+
NS => {:type => ::Thrift::Types::I64, :name => 'ns'},
|
214
219
|
COMMAND => {:type => ::Thrift::Types::STRING, :name => 'command'},
|
215
220
|
NOFLUSH => {:type => ::Thrift::Types::BOOL, :name => 'noflush', :default => false},
|
216
221
|
UNBUFFERED => {:type => ::Thrift::Types::BOOL, :name => 'unbuffered', :default => false}
|
@@ -221,14 +226,14 @@ require 'hql_types'
|
|
221
226
|
def validate
|
222
227
|
end
|
223
228
|
|
229
|
+
::Thrift::Struct.generate_accessors self
|
224
230
|
end
|
225
231
|
|
226
232
|
class Hql_exec2_result
|
227
|
-
include ::Thrift::Struct
|
233
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
228
234
|
SUCCESS = 0
|
229
235
|
E = 1
|
230
236
|
|
231
|
-
::Thrift::Struct.field_accessor self, :success, :e
|
232
237
|
FIELDS = {
|
233
238
|
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hypertable::ThriftGen::HqlResult2},
|
234
239
|
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Hypertable::ThriftGen::ClientException}
|
@@ -239,14 +244,16 @@ require 'hql_types'
|
|
239
244
|
def validate
|
240
245
|
end
|
241
246
|
|
247
|
+
::Thrift::Struct.generate_accessors self
|
242
248
|
end
|
243
249
|
|
244
250
|
class Hql_query2_args
|
245
|
-
include ::Thrift::Struct
|
246
|
-
|
251
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
252
|
+
NS = 1
|
253
|
+
COMMAND = 2
|
247
254
|
|
248
|
-
::Thrift::Struct.field_accessor self, :command
|
249
255
|
FIELDS = {
|
256
|
+
NS => {:type => ::Thrift::Types::I64, :name => 'ns'},
|
250
257
|
COMMAND => {:type => ::Thrift::Types::STRING, :name => 'command'}
|
251
258
|
}
|
252
259
|
|
@@ -255,14 +262,14 @@ require 'hql_types'
|
|
255
262
|
def validate
|
256
263
|
end
|
257
264
|
|
265
|
+
::Thrift::Struct.generate_accessors self
|
258
266
|
end
|
259
267
|
|
260
268
|
class Hql_query2_result
|
261
|
-
include ::Thrift::Struct
|
269
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
262
270
|
SUCCESS = 0
|
263
271
|
E = 1
|
264
272
|
|
265
|
-
::Thrift::Struct.field_accessor self, :success, :e
|
266
273
|
FIELDS = {
|
267
274
|
SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Hypertable::ThriftGen::HqlResult2},
|
268
275
|
E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Hypertable::ThriftGen::ClientException}
|
@@ -273,6 +280,7 @@ require 'hql_types'
|
|
273
280
|
def validate
|
274
281
|
end
|
275
282
|
|
283
|
+
::Thrift::Struct.generate_accessors self
|
276
284
|
end
|
277
285
|
|
278
286
|
end
|
@@ -25,13 +25,12 @@ module Hypertable
|
|
25
25
|
# <dd>Resulting mutator ID for unflushed modifying queries</dd>
|
26
26
|
# </dl>
|
27
27
|
class HqlResult
|
28
|
-
include ::Thrift::Struct
|
28
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
29
29
|
RESULTS = 1
|
30
30
|
CELLS = 2
|
31
31
|
SCANNER = 3
|
32
32
|
MUTATOR = 4
|
33
33
|
|
34
|
-
::Thrift::Struct.field_accessor self, :results, :cells, :scanner, :mutator
|
35
34
|
FIELDS = {
|
36
35
|
RESULTS => {:type => ::Thrift::Types::LIST, :name => 'results', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
|
37
36
|
CELLS => {:type => ::Thrift::Types::LIST, :name => 'cells', :element => {:type => ::Thrift::Types::STRUCT, :class => Hypertable::ThriftGen::Cell}, :optional => true},
|
@@ -44,17 +43,17 @@ module Hypertable
|
|
44
43
|
def validate
|
45
44
|
end
|
46
45
|
|
46
|
+
::Thrift::Struct.generate_accessors self
|
47
47
|
end
|
48
48
|
|
49
49
|
# Same as HqlResult except with cell as array
|
50
50
|
class HqlResult2
|
51
|
-
include ::Thrift::Struct
|
51
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
52
52
|
RESULTS = 1
|
53
53
|
CELLS = 2
|
54
54
|
SCANNER = 3
|
55
55
|
MUTATOR = 4
|
56
56
|
|
57
|
-
::Thrift::Struct.field_accessor self, :results, :cells, :scanner, :mutator
|
58
57
|
FIELDS = {
|
59
58
|
RESULTS => {:type => ::Thrift::Types::LIST, :name => 'results', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
|
60
59
|
CELLS => {:type => ::Thrift::Types::LIST, :name => 'cells', :element => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}, :optional => true},
|
@@ -67,6 +66,7 @@ module Hypertable
|
|
67
66
|
def validate
|
68
67
|
end
|
69
68
|
|
69
|
+
::Thrift::Struct.generate_accessors self
|
70
70
|
end
|
71
71
|
|
72
72
|
end
|