sishen-hbase-ruby 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +2 -0
- data/Rakefile +3 -1
- data/hbase-ruby.gemspec +1 -1
- data/lib/hbase/request/meta_request.rb +1 -1
- data/lib/hbase/request/row_request.rb +10 -17
- data/lib/hbase/request/table_request.rb +14 -7
- metadata +1 -1
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -13,6 +13,7 @@ lib/hbase/model/column_descriptor.rb
|
|
13
13
|
lib/hbase/model/region_descriptor.rb
|
14
14
|
lib/hbase/model/row.rb
|
15
15
|
lib/hbase/model/table_descriptor.rb
|
16
|
+
lib/hbase/model/scanner.rb
|
16
17
|
lib/hbase/operation/meta_operation.rb
|
17
18
|
lib/hbase/operation/row_operation.rb
|
18
19
|
lib/hbase/operation/scanner_operation.rb
|
@@ -28,3 +29,4 @@ lib/hbase/response/basic_response.rb
|
|
28
29
|
lib/hbase/response/meta_response.rb
|
29
30
|
lib/hbase/response/row_response.rb
|
30
31
|
lib/hbase/response/table_response.rb
|
32
|
+
lib/hbase/response/scanner_response.rb
|
data/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'hoe'
|
3
3
|
|
4
|
-
Hoe.new('sishen-hbase-ruby', '0.4.
|
4
|
+
Hoe.new('sishen-hbase-ruby', '0.4.2') do |p|
|
5
5
|
p.rubyforge_name = 'sishen-hbase-ruby'
|
6
6
|
p.author = 'Ye Dingding'
|
7
7
|
p.email = 'yedingding@gmail.com'
|
@@ -9,3 +9,5 @@ Hoe.new('sishen-hbase-ruby', '0.4.0') do |p|
|
|
9
9
|
p.summary = 'a pure ruby client for hbase using REST interface'
|
10
10
|
p.description = 'hbase-ruby is a pure ruby client for hbase and enable the ruby app enjoy the power of HBase'
|
11
11
|
end
|
12
|
+
|
13
|
+
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
data/hbase-ruby.gemspec
CHANGED
@@ -7,19 +7,12 @@ module HBase
|
|
7
7
|
|
8
8
|
def initialize(table_name, name, timestamp)
|
9
9
|
@table_name, @name, @timestamp = CGI.escape(table_name), CGI.escape(name), timestamp
|
10
|
-
|
11
|
-
path << "/#{@timestamp}" if timestamp
|
12
|
-
super(path)
|
10
|
+
super("/#{@table_name}/row/#{@name}/#{@timestamp}")
|
13
11
|
end
|
14
12
|
|
15
13
|
def show(columns = nil, version = nil)
|
16
14
|
if columns
|
17
|
-
|
18
|
-
columns = [columns]
|
19
|
-
elsif columns.is_a? Array
|
20
|
-
end
|
21
|
-
params = columns.collect { |column| "column=#{column}" }.join('&')
|
22
|
-
@path << "?#{params}"
|
15
|
+
@path << pack_params(columns)
|
23
16
|
@path << "&version=#{version}" if version
|
24
17
|
end
|
25
18
|
@path
|
@@ -30,16 +23,16 @@ module HBase
|
|
30
23
|
end
|
31
24
|
|
32
25
|
def delete(columns = nil)
|
33
|
-
if columns
|
34
|
-
if columns.is_a? String
|
35
|
-
columns = [columns]
|
36
|
-
elsif columns.is_a? Array
|
37
|
-
end
|
38
|
-
params = columns.collect { |column| "column=#{column}" }.join('&')
|
39
|
-
@path << "?#{params}"
|
40
|
-
end
|
26
|
+
@path << "?#{pack_params(columns)}" if columns
|
41
27
|
@path
|
42
28
|
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def pack_params columns
|
33
|
+
columns = [columns] unless columns.is_a? Array
|
34
|
+
columns.collect { |column| "column=#{column}" }.join('&')
|
35
|
+
end
|
43
36
|
end
|
44
37
|
end
|
45
38
|
end
|
@@ -10,11 +10,12 @@ module HBase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def show
|
13
|
-
|
13
|
+
member_path
|
14
14
|
end
|
15
15
|
|
16
16
|
def regions(start_row = nil, end_row = nil)
|
17
|
-
|
17
|
+
#TODO no handle the args!
|
18
|
+
member_path << "/regions"
|
18
19
|
end
|
19
20
|
|
20
21
|
def create
|
@@ -22,19 +23,18 @@ module HBase
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def update
|
25
|
-
|
26
|
+
member_path
|
26
27
|
end
|
27
28
|
|
28
29
|
def enable
|
29
|
-
|
30
|
+
member_path << "/enable"
|
30
31
|
end
|
31
32
|
|
32
33
|
def disable
|
33
|
-
|
34
|
+
member_path << "/disable"
|
34
35
|
end
|
35
36
|
|
36
37
|
def delete(columns = nil)
|
37
|
-
@path << "/#{name}"
|
38
38
|
if columns
|
39
39
|
if columns.is_a? String
|
40
40
|
columns = [columns]
|
@@ -43,10 +43,17 @@ module HBase
|
|
43
43
|
raise StandardError, "Only String or Array type allows for columns"
|
44
44
|
end
|
45
45
|
params = columns.collect { |column| "column=#{column}" }.join('%')
|
46
|
-
|
46
|
+
member_path << "?#{params}"
|
47
47
|
end
|
48
48
|
@path
|
49
49
|
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def member_path
|
54
|
+
@path << "/#{name}"
|
55
|
+
@path
|
56
|
+
end
|
50
57
|
end
|
51
58
|
end
|
52
59
|
end
|