hbasegate 0.2.3 → 0.2.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/lib/hbasegate/htable.rb +7 -0
- data/lib/hbasegate/version.rb +1 -1
- metadata +1 -1
data/lib/hbasegate/htable.rb
CHANGED
|
@@ -6,6 +6,8 @@ module HBaseGate
|
|
|
6
6
|
java_import 'org.apache.hadoop.hbase.client.Scan'
|
|
7
7
|
|
|
8
8
|
class HTable
|
|
9
|
+
include Enumerable
|
|
10
|
+
|
|
9
11
|
alias_method :original_delete, :delete
|
|
10
12
|
alias_method :original_get, :get
|
|
11
13
|
alias_method :original_put, :put
|
|
@@ -35,6 +37,11 @@ module HBaseGate
|
|
|
35
37
|
original_delete(delete)
|
|
36
38
|
end
|
|
37
39
|
|
|
40
|
+
# Enable the Enumerable module by providing a full scanner.
|
|
41
|
+
def each
|
|
42
|
+
original_get_scanner(Scan.new).each { |row| yield row }
|
|
43
|
+
end
|
|
44
|
+
|
|
38
45
|
# Create a scanner for the table.
|
|
39
46
|
def get_scanner(start_row = nil, stop_row = nil)
|
|
40
47
|
scan = case
|
data/lib/hbasegate/version.rb
CHANGED