sishen-hbase-ruby 0.4.1 → 0.4.2

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/History.txt CHANGED
@@ -1,2 +1,6 @@
1
+
2
+ v0.4 Oct 12, 2008
3
+ * support 'scanner'
4
+
1
5
  v0.1 Jul 29, 2008
2
6
  * initial version
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.0') do |p|
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{hbase-ruby}
3
- s.version = "0.4.1"
3
+ s.version = "0.4.2"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Ye Dingding"]
@@ -6,7 +6,7 @@ module HBase
6
6
  end
7
7
 
8
8
  def list_tables
9
- @path
9
+ @path << "/"
10
10
  end
11
11
 
12
12
  def create_table
@@ -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
- path = "/#{@table_name}/row/#{@name}"
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
- if columns.is_a? String
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
- @path << "/#{name}"
13
+ member_path
14
14
  end
15
15
 
16
16
  def regions(start_row = nil, end_row = nil)
17
- @path << "/#{name}/regions"
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
- @path << "/#{name}"
26
+ member_path
26
27
  end
27
28
 
28
29
  def enable
29
- @path << "/#{name}/enable"
30
+ member_path << "/enable"
30
31
  end
31
32
 
32
33
  def disable
33
- @path << "/#{name}/disable"
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
- @path << "?#{params}"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sishen-hbase-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ye Dingding