HBase::Table instance can be set up to cache the interpretations of the
column keys using thread-locals which can lead to 3-times faster Put
generation in tight loops.
table = hbase[:my_table, cache: true]
# ...
table.closeHowever, the option is off by default because of the following issues:
- You should not use it with the tables with unlimited number of columns.
- Caching does not keep track of the updates of the schema. If you change the
schema of an
HBaseobject after you created anHBase::Tableobject with the cache turned on from it, the object may hold stale information on the types of the columns.HBase::Table#closemethod will clean up the cache.
- Refactoring
- Changed
HBase::Row#to_hcall to return a Hash extended withHBase::Row::HashExtensionmodule which makes it possible to extend the returned Hash by monkey-patching the module HBase::Row::HashExtensionoverrides#[]method to allow looking up data with both Array and String notation of column keys:[CF, CQ]orCF:CQ
- Changed
- Hash for describing column and table options can now contain XML entries
using additional
:configkey.
hbase[:my_table].create! :d,
# HTableDescriptor#setValue
'MAX_FILESIZE' => 1 << 33,
:config => {
# HTableDescriptor#setConfiguration
'hbase.hstore.compaction.max.size' => 1 << 30
}- Removed automatic cleanup of thread-local HTable instances
- Fixes issue #35
- Close of individual HTable instance turned out to be unnecessary
flushCommitsnot required ashbase-jrubyruns in auto-flush mode- No need to close shared connection or its thread pool
- Fixed error on JRuby 1.7.13 (#34)
0.6.0 includes a few backward-incompatible changes.
- Default number of versions for a scan or get is now changed to 1 to match Java API
- Make sure to set versions to
:allif you're callingto_Hor plural datatype methodsscoped.versions(:all).to_Hscoped.versions(:all).strings('d:title')
- Make sure to set versions to
- Removed
HBase::Table::BatchAction#mutatemethod- RowMutation is not allowed in
HBase::Table#batch
- RowMutation is not allowed in
- Added CDH5.1 dependency profile
- Fixed
Table#aggregatefor HBase 0.98 or above
- Added CDH5.0 (HBase 0.96.1.1) and CDH4.6 dependency profiles
- If you share HBase instance between threads, you may need to set
hbase.hconnection.threads.coredue to a bug in CDH5.5.0.
- If you share HBase instance between threads, you may need to set
- Use HConnection instead of deprecated HTablePool when possible
- Fixed HBase 0.96 compatibily issues and tested on HBase 0.96 and 0.98
- Added
:split_policytable property Table#propertiesandTable#familiesnow include previously unknown properties as String-String pairs- Added
Row#byte_arraywhich returns an instance ofHBase::ByteArray- Equivalent to
HBase::ByteArray[row.raw(col)]
- Equivalent to
- Fixed
HBase::Table#raw_families/raw_propertieson HBase shell
- Fixed
HBase::Table#add_coprocessor[!]andHBase::Table#remove_coprocessor[!]
- Fixed bug when using schema with non-String/Symbol qualifier
- Updated dependency profiles
- Added CDH4.5, CDH4.4 (same as CDH4.3)
- 0.95, 0.96 (experimental, currently not working)
- Improved compatibility with HBase shell which is based on JRuby 1.6.5
- Fixed .META. scanning with range prefix (#26)
- Added
ByteArray#asas a synonym forByteArray#decode
- Added support for append operation:
HBase::Table#append - Added support for atomic mutations on a single row:
HBase::Table#mutate - Added support for batch operations:
HBase::Table#batch- This method does not take an argument and requires a block
- Don't be confused with the shortcut method to
HBase::Scoped#batch(batch_size)
- Changed
HBase::Table#incrementto return the updated values as a Hash - Fixed HBase.resolve_dependency!(:local) on CDH distribution
- Empty-qualifier must be given as 'cf:', and not 'cf'
- Added
HBase::Row#empty?method - Added
HBase::ByteArray#to_smethod
- Improved
Scoped#countmethod- KeyOnlyFilter turned out to be compatible with SingleColumnValueFilter
- Now takes an optional Hash:
scoped.count(cache_blocks: false, caching: 100) - Changed not to disable server-side block caching by default
- Supports
Scoped#limiteven whenScan.setMaxResultSizeis not implementedScoped#limit(nil)will remove the previously set value
- Cleanup all thread-local (fiber-local) HTable references when connection is closed
- Added
HBase#reset_table_poolmethod for recreating HTable pool
0.3.3 changes the way null values are handled, and introduces interface for CAS operations. It is strongly advised that you upgrade to 0.3.3 since it contains important fixes.
- PUT will not store null values
filter(column: nil)will match rows without the columnfilter(column: value)will NOT match rows without the column- However,
filter(column: { ne: value })WILL match rows without the column
- However,
- Added
HBase::Table#checkmethod for check-and-put and check-and-delete operationsbool = table.check(1, in_print: false).delete(:price)bool = table.check(1, in_print: true).put(price: 100)
- Fix: invalid count when filter is used
- Added CDH4.3 dependency profile
- Fixed a bug in
'cf:cq' => :typeshortcut schema definition - Added schema data type validation
- Fixed reference to ambiguous column names
- Easier data access with table schema
HBase::Table#schema=method to provide the schema of the table- You can omit column family names on predefined columns
- Automatic type conversion for known columns
- 0.3.0 brings many backward-incompatible changes
Row#to_hashandRow#to_hash_with_versionsare now deprecated. Useto_handto_Hinstead without arguments.- Default parameters for
HBase::Row#rowkeyandHBase::Cell#rowkeyare now:rawinstead of:string. HBase::ColumnKeyis removed. Use plain 2-element Arrays instead.- Enumerable classes (Table, Scoped, Row, ByteArray) now return Enumerator on each method when block not given
Cell#valuecan now return the correct data type if defined in the schema. For Java byte array, useCell#raw.Row#[type|types]methods no more take Array of columns as arguments
- Added
HBase::Table#scopedmethod to returnHBase::Scopedobject for the table - Added
HBase::Cell#{eql?,hash}method for equaility check
- Fixed
HBase::Scoped#filtermethod to take short integer (byte, short, int) values - Fixed
HBase::Scoped#rangemethod to take short integer (byte, short, int) values
- Added
HBase::Table#snapshotsmethod - Added
HBase::Table#snapshot!method - Added
HBase#snapshotsmethod - Added
HBase::Cell#{raw,int,short,byte}methods - Updated dependency profiles: cdh4.2.1, cdh4.1.4
- Fixed NameError when HBase::ByteArray is used without first creating an HBase instance
- Updated dependency profiles: 0.95.0, 0.94.6.1, 0.92.2, cdh3u6
- Fix: Thread.current[:htable] must be local to each connection
- Fix:
HBase.log4j=to support XML based configuration - Automatically set versions to 1 when counting records
- New dependency profile:
cdh4.2
- Added
HBase::Table#delete_rowmethod - Dependency profiles as prefixes
- Supported prefixes:
cdh4.1,cdh3,0.94,0.92 - e.g.
HBase.resolve_dependency! 'cdh4.1.3'
- Supported prefixes:
- Advanced data access with
Scoped#with_java_scanandScoped#with_java_get
- Fix: NameError even when appropriate CLASSPATH is set
- Deprecated
HBase::Table#close. You don't need to close Table instances. - Added
HBase::Table#splitandHBase::Table#split!method - Added
:splitsoption toHTable#create!method to pre-split the table - Added table inspection methods:
properties,families, andregions - Added raw inspection methods:
raw_propertiesandraw_families - Added
HBase.log4j=method - Added
HBase::Scoped#at,HBase::Scoped#time_rangemethod - Changed parameters to
HBase.resolve_dependency!method - Ruby Time object can be used as timestamp in put and delete methods
- Using closed HBase connection is disallowed
- Ruby 1.8 compatibility mode (Oops!)
- Maven dependencies for 0.94 and 0.92
- Progress reporting for synchronous table administration
- Added asynchronous versions of table administration methods
- Added support for shorter integers
- Extended
HBase::ByteArrayfor easy manipulation of Java byte arrays
- Fix: Start/stop row not correctly set when byte array rowkey range specified
- More efficient count with FirstKeyOnlyFilter
- Added
HBase::ByteArraymethod as a shorthand notation forHBase::ByteArray.new - Added
HBase::ByteArray#+method for concatenating two byte arrays - Added
HBase::Util::java_bytes?method - Documentation
- Supports Ruby 1.8 compatibility mode
- Fix: Correct return value from
HBase::resolve_dependency! - Fix: Appropriately close result scanners
- Dropped Bignum support. Automatic conversion from Fixnum to Bignum (or vice versa) will produce columns whose values are of heterogeneous types, that are impossible to be read in a consistent way. You can use BigDecimal type instead for large numbers.
- Added
HBase::Scoped#whilewhich allows early termination of scan with WhileMatchFilter - Filtering with regular expressions
- Implemented comparator for
HBase::Result - Added coprocessor administration methods
- Basic aggregation with Coprocessor
HBase::Scoped#countwith block- Allows PUT operation with timestamps