hbase-jruby 0.4.0-java → 0.4.1-java

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 0.4.1
5
+ -----
6
+ - Fixed .META. scanning with range prefix ([#26](https://github.com/junegunn/hbase-jruby/issues/26))
7
+ - Added `ByteArray#as` as a synonym for `ByteArray#decode`
8
+
4
9
  0.4.0
5
10
  -----
6
11
  - Added support for append operation: `HBase::Table#append`
@@ -107,6 +107,7 @@ class ByteArray
107
107
  def decode type
108
108
  Util.from_bytes type, @java
109
109
  end
110
+ alias as decode
110
111
 
111
112
  # Returns the first element decoded as the given type
112
113
  # and removes the portion from the byte array.
@@ -606,11 +606,7 @@ private
606
606
  def range_for_prefix
607
607
  return nil if @prefixes.empty?
608
608
 
609
- byte_arrays = @prefixes.map { |pref| ByteArray.new(pref) }.sort
610
- start = byte_arrays.first
611
- stop = byte_arrays.last
612
-
613
- [start.java, stop.stopkey_bytes_for_prefix]
609
+ [@prefixes.map { |pref| ByteArray.new(pref) }.min.java, nil]
614
610
  end
615
611
 
616
612
  def parse_filter_input filters
@@ -1,5 +1,5 @@
1
1
  class HBase
2
2
  module JRuby
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
@@ -64,7 +64,7 @@ class TestByteArray < Test::Unit::TestCase
64
64
  ba = HBase::ByteArray(100, 200, "Hello", 3.14)
65
65
 
66
66
  assert_equal 100, ba[0, 8].decode(:fixnum)
67
- assert_equal 200, ba[8...16].decode(:fixnum)
67
+ assert_equal 200, ba[8...16].as(:fixnum)
68
68
  assert_equal "Hello", ba[16, 5].decode(:string)
69
69
  assert_equal 3.14, ba[21..-1].decode(:float)
70
70
  assert_equal "H", ba[16].chr
@@ -95,7 +95,7 @@ class TestByteArray < Test::Unit::TestCase
95
95
  assert_raise(RangeError) { HBase::ByteArray(:byte => 128) }
96
96
 
97
97
  assert_equal 2, HBase::ByteArray(:short => 12345).length
98
- assert_equal 12345, HBase::ByteArray(:short => 12345).decode(:short)
98
+ assert_equal 12345, HBase::ByteArray(:short => 12345).as(:short)
99
99
  assert_raise(RangeError) { HBase::ByteArray( :short => 1 << 16 ) }
100
100
 
101
101
  assert_equal 4, HBase::ByteArray(:int => 12345).length
@@ -103,7 +103,7 @@ class TestByteArray < Test::Unit::TestCase
103
103
  assert_raise(RangeError) { HBase::ByteArray.new( :int => 1 << 32 ) }
104
104
 
105
105
  ba = HBase::ByteArray( {:int => 10000}, 20000, {:short => 30000}, "Hello" )
106
- assert_equal 10000, ba[0, 4].decode(:int)
106
+ assert_equal 10000, ba[0, 4].as(:int)
107
107
  assert_equal 20000, ba[4, 8].decode(:long)
108
108
  assert_equal 30000, ba[12, 2].decode(:short)
109
109
  assert_equal "Hell", ba[14, 4].decode(:string)
data/test/test_scoped.rb CHANGED
@@ -370,10 +370,12 @@ class TestScoped < TestHBaseJRubyBase
370
370
  end
371
371
 
372
372
  assert_equal 26, @table.range(:prefix => 'c').count
373
+ assert_equal 1, @table.range(:prefix => 'cc').count
373
374
  assert @table.range(:prefix => 'c').get('cc')
374
375
  assert_nil @table.range(:prefix => 'c').get('dd')
375
376
  assert @table.range(:prefix => ['d', 'c']).get('dd')
376
377
  assert_equal 52, @table.range(:prefix => ['a', 'c']).count
378
+ assert_equal 2, @table.range(:prefix => ['aa', 'cc']).count
377
379
  assert_equal 78, @table.range(:prefix => ['d', 'a', 'c']).count
378
380
  assert_equal 52, @table.range(nil, 'd', :prefix => ['d', 'a', 'c']).count
379
381
  assert_equal 52, @table.range('b', :prefix => ['d', 'a', 'c']).count
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: hbase-jruby
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: java
7
7
  authors:
8
8
  - Junegunn Choi
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-28 00:00:00.000000000 Z
12
+ date: 2013-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit