forward-rbase 0.1.0
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/lib/rbase/client.rb +37 -0
- data/lib/rbase/table.rb +29 -0
- data/lib/rbase/thrift/hbase.rb +2312 -0
- data/lib/rbase/thrift/hbase_constants.rb +16 -0
- data/lib/rbase/thrift/hbase_types.rb +226 -0
- data/lib/rbase.rb +6 -0
- metadata +87 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
require File.join(File.dirname(__FILE__), 'hbase_types')
|
8
|
+
|
9
|
+
module Apache
|
10
|
+
module Hadoop
|
11
|
+
module Hbase
|
12
|
+
module Thrift
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,226 @@
|
|
1
|
+
#
|
2
|
+
# Autogenerated by Thrift
|
3
|
+
#
|
4
|
+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
#
|
6
|
+
|
7
|
+
|
8
|
+
module Apache
|
9
|
+
module Hadoop
|
10
|
+
module Hbase
|
11
|
+
module Thrift
|
12
|
+
# TCell - Used to transport a cell value (byte[]) and the timestamp it was
|
13
|
+
# stored with together as a result for get and getRow methods. This promotes
|
14
|
+
# the timestamp of a cell to a first-class value, making it easy to take
|
15
|
+
# note of temporal data. Cell is used all the way from HStore up to HTable.
|
16
|
+
class TCell
|
17
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
18
|
+
VALUE = 1
|
19
|
+
TIMESTAMP = 2
|
20
|
+
|
21
|
+
FIELDS = {
|
22
|
+
VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true},
|
23
|
+
TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'}
|
24
|
+
}
|
25
|
+
|
26
|
+
def struct_fields; FIELDS; end
|
27
|
+
|
28
|
+
def validate
|
29
|
+
end
|
30
|
+
|
31
|
+
::Thrift::Struct.generate_accessors self
|
32
|
+
end
|
33
|
+
|
34
|
+
# An HColumnDescriptor contains information about a column family
|
35
|
+
# such as the number of versions, compression settings, etc. It is
|
36
|
+
# used as input when creating a table or adding a column.
|
37
|
+
class ColumnDescriptor
|
38
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
39
|
+
NAME = 1
|
40
|
+
MAXVERSIONS = 2
|
41
|
+
COMPRESSION = 3
|
42
|
+
INMEMORY = 4
|
43
|
+
BLOOMFILTERTYPE = 5
|
44
|
+
BLOOMFILTERVECTORSIZE = 6
|
45
|
+
BLOOMFILTERNBHASHES = 7
|
46
|
+
BLOCKCACHEENABLED = 8
|
47
|
+
TIMETOLIVE = 9
|
48
|
+
|
49
|
+
FIELDS = {
|
50
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
|
51
|
+
MAXVERSIONS => {:type => ::Thrift::Types::I32, :name => 'maxVersions', :default => 3},
|
52
|
+
COMPRESSION => {:type => ::Thrift::Types::STRING, :name => 'compression', :default => %q"NONE"},
|
53
|
+
INMEMORY => {:type => ::Thrift::Types::BOOL, :name => 'inMemory', :default => false},
|
54
|
+
BLOOMFILTERTYPE => {:type => ::Thrift::Types::STRING, :name => 'bloomFilterType', :default => %q"NONE"},
|
55
|
+
BLOOMFILTERVECTORSIZE => {:type => ::Thrift::Types::I32, :name => 'bloomFilterVectorSize', :default => 0},
|
56
|
+
BLOOMFILTERNBHASHES => {:type => ::Thrift::Types::I32, :name => 'bloomFilterNbHashes', :default => 0},
|
57
|
+
BLOCKCACHEENABLED => {:type => ::Thrift::Types::BOOL, :name => 'blockCacheEnabled', :default => false},
|
58
|
+
TIMETOLIVE => {:type => ::Thrift::Types::I32, :name => 'timeToLive', :default => -1}
|
59
|
+
}
|
60
|
+
|
61
|
+
def struct_fields; FIELDS; end
|
62
|
+
|
63
|
+
def validate
|
64
|
+
end
|
65
|
+
|
66
|
+
::Thrift::Struct.generate_accessors self
|
67
|
+
end
|
68
|
+
|
69
|
+
# A TRegionInfo contains information about an HTable region.
|
70
|
+
class TRegionInfo
|
71
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
72
|
+
STARTKEY = 1
|
73
|
+
ENDKEY = 2
|
74
|
+
ID = 3
|
75
|
+
NAME = 4
|
76
|
+
VERSION = 5
|
77
|
+
|
78
|
+
FIELDS = {
|
79
|
+
STARTKEY => {:type => ::Thrift::Types::STRING, :name => 'startKey', :binary => true},
|
80
|
+
ENDKEY => {:type => ::Thrift::Types::STRING, :name => 'endKey', :binary => true},
|
81
|
+
ID => {:type => ::Thrift::Types::I64, :name => 'id'},
|
82
|
+
NAME => {:type => ::Thrift::Types::STRING, :name => 'name', :binary => true},
|
83
|
+
VERSION => {:type => ::Thrift::Types::BYTE, :name => 'version'}
|
84
|
+
}
|
85
|
+
|
86
|
+
def struct_fields; FIELDS; end
|
87
|
+
|
88
|
+
def validate
|
89
|
+
end
|
90
|
+
|
91
|
+
::Thrift::Struct.generate_accessors self
|
92
|
+
end
|
93
|
+
|
94
|
+
# A Mutation object is used to either update or delete a column-value.
|
95
|
+
class Mutation
|
96
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
97
|
+
ISDELETE = 1
|
98
|
+
COLUMN = 2
|
99
|
+
VALUE = 3
|
100
|
+
|
101
|
+
FIELDS = {
|
102
|
+
ISDELETE => {:type => ::Thrift::Types::BOOL, :name => 'isDelete', :default => false},
|
103
|
+
COLUMN => {:type => ::Thrift::Types::STRING, :name => 'column', :binary => true},
|
104
|
+
VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true}
|
105
|
+
}
|
106
|
+
|
107
|
+
def struct_fields; FIELDS; end
|
108
|
+
|
109
|
+
def validate
|
110
|
+
end
|
111
|
+
|
112
|
+
::Thrift::Struct.generate_accessors self
|
113
|
+
end
|
114
|
+
|
115
|
+
# A BatchMutation object is used to apply a number of Mutations to a single row.
|
116
|
+
class BatchMutation
|
117
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
118
|
+
ROW = 1
|
119
|
+
MUTATIONS = 2
|
120
|
+
|
121
|
+
FIELDS = {
|
122
|
+
ROW => {:type => ::Thrift::Types::STRING, :name => 'row', :binary => true},
|
123
|
+
MUTATIONS => {:type => ::Thrift::Types::LIST, :name => 'mutations', :element => {:type => ::Thrift::Types::STRUCT, :class => Apache::Hadoop::Hbase::Thrift::Mutation}}
|
124
|
+
}
|
125
|
+
|
126
|
+
def struct_fields; FIELDS; end
|
127
|
+
|
128
|
+
def validate
|
129
|
+
end
|
130
|
+
|
131
|
+
::Thrift::Struct.generate_accessors self
|
132
|
+
end
|
133
|
+
|
134
|
+
# Holds row name and then a map of columns to cells.
|
135
|
+
class TRowResult
|
136
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
137
|
+
ROW = 1
|
138
|
+
COLUMNS = 2
|
139
|
+
|
140
|
+
FIELDS = {
|
141
|
+
ROW => {:type => ::Thrift::Types::STRING, :name => 'row', :binary => true},
|
142
|
+
COLUMNS => {:type => ::Thrift::Types::MAP, :name => 'columns', :key => {:type => ::Thrift::Types::STRING, :binary => true}, :value => {:type => ::Thrift::Types::STRUCT, :class => Apache::Hadoop::Hbase::Thrift::TCell}}
|
143
|
+
}
|
144
|
+
|
145
|
+
def struct_fields; FIELDS; end
|
146
|
+
|
147
|
+
def validate
|
148
|
+
end
|
149
|
+
|
150
|
+
::Thrift::Struct.generate_accessors self
|
151
|
+
end
|
152
|
+
|
153
|
+
# An IOError exception signals that an error occurred communicating
|
154
|
+
# to the Hbase master or an Hbase region server. Also used to return
|
155
|
+
# more general Hbase error conditions.
|
156
|
+
class IOError < ::Thrift::Exception
|
157
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
158
|
+
def initialize(message=nil)
|
159
|
+
super()
|
160
|
+
self.message = message
|
161
|
+
end
|
162
|
+
|
163
|
+
MESSAGE = 1
|
164
|
+
|
165
|
+
FIELDS = {
|
166
|
+
MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
|
167
|
+
}
|
168
|
+
|
169
|
+
def struct_fields; FIELDS; end
|
170
|
+
|
171
|
+
def validate
|
172
|
+
end
|
173
|
+
|
174
|
+
::Thrift::Struct.generate_accessors self
|
175
|
+
end
|
176
|
+
|
177
|
+
# An IllegalArgument exception indicates an illegal or invalid
|
178
|
+
# argument was passed into a procedure.
|
179
|
+
class IllegalArgument < ::Thrift::Exception
|
180
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
181
|
+
def initialize(message=nil)
|
182
|
+
super()
|
183
|
+
self.message = message
|
184
|
+
end
|
185
|
+
|
186
|
+
MESSAGE = 1
|
187
|
+
|
188
|
+
FIELDS = {
|
189
|
+
MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
|
190
|
+
}
|
191
|
+
|
192
|
+
def struct_fields; FIELDS; end
|
193
|
+
|
194
|
+
def validate
|
195
|
+
end
|
196
|
+
|
197
|
+
::Thrift::Struct.generate_accessors self
|
198
|
+
end
|
199
|
+
|
200
|
+
# An AlreadyExists exceptions signals that a table with the specified
|
201
|
+
# name already exists
|
202
|
+
class AlreadyExists < ::Thrift::Exception
|
203
|
+
include ::Thrift::Struct, ::Thrift::Struct_Union
|
204
|
+
def initialize(message=nil)
|
205
|
+
super()
|
206
|
+
self.message = message
|
207
|
+
end
|
208
|
+
|
209
|
+
MESSAGE = 1
|
210
|
+
|
211
|
+
FIELDS = {
|
212
|
+
MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
|
213
|
+
}
|
214
|
+
|
215
|
+
def struct_fields; FIELDS; end
|
216
|
+
|
217
|
+
def validate
|
218
|
+
end
|
219
|
+
|
220
|
+
::Thrift::Struct.generate_accessors self
|
221
|
+
end
|
222
|
+
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
data/lib/rbase.rb
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'rbase', 'thrift', 'hbase')
|
2
|
+
require File.join(File.dirname(__FILE__), 'rbase', 'thrift', 'hbase_constants')
|
3
|
+
require File.join(File.dirname(__FILE__), 'rbase', 'thrift', 'hbase_types')
|
4
|
+
|
5
|
+
require File.join(File.dirname(__FILE__), 'rbase', 'client')
|
6
|
+
require File.join(File.dirname(__FILE__), 'rbase', 'table')
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: forward-rbase
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Forward Internet Group
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-01-12 00:00:00 +00:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: thrift
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 4
|
33
|
+
- 0
|
34
|
+
version: 0.4.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
description: Simple lib for executing hbase lookups
|
38
|
+
email: andy@forward.co.uk
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files: []
|
44
|
+
|
45
|
+
files:
|
46
|
+
- lib/rbase.rb
|
47
|
+
- lib/rbase/client.rb
|
48
|
+
- lib/rbase/table.rb
|
49
|
+
- lib/rbase/thrift/hbase.rb
|
50
|
+
- lib/rbase/thrift/hbase_constants.rb
|
51
|
+
- lib/rbase/thrift/hbase_types.rb
|
52
|
+
has_rdoc: true
|
53
|
+
homepage: http://github.com/forward/rbase
|
54
|
+
licenses: []
|
55
|
+
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
hash: 3
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
requirements: []
|
80
|
+
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 1.3.7
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Simple lib for executing hbase lookups
|
86
|
+
test_files: []
|
87
|
+
|