DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: nicolas
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Store HBase

Support for BloomFilters, inMemory and some other options on column families when creating a table

Created: 07/Dec/12 06:36 PM   Updated: 01/Jan/13 09:22 AM   Resolved: 10/Dec/12 08:20 PM
Component/s: Schema
Affects Version/s: 3.2.0.m1
Fix Version/s: 3.2.0.m2

File Attachments: 1. XML File hbase.xml (7 kB)
2. Text File Store_HBase-addExtensionsToHBase.patch (46 kB)
3. Text File Test_added_extensions_for_HBase.patch (12 kB)

Environment: Any

Forum Thread URL: See thread,7300
Datastore: HBase
Severity: Development

 Description  « Hide

When creating a column family in HBase, it is not possible to specify any of the optional fields available:
HColumnDescriptor(byte[] familyName, int minVersions, int maxVersions, boolean keepDeletedCells, String compression, boolean encodeOnDisk, String dataBlockEncoding, boolean inMemory, boolean blockCacheEnabled, int blocksize, int timeToLive, String bloomFilter, int scope)

As such, it would be interesting to define those as extensions as per JDO.

nicolas added a comment - 07/Dec/12 06:40 PM
Patch for store.hbase.

Please review it and tell me if it is OK. Some more tests are most likely required for the parser. I can add those later if you agree with implementation.

Apply Store_HBase-addExtensionsToHBase.patch at store.hbase level.
Apply Test_added_extensions_for_HBase.patch at C:\projects\svn\datanucleus\test\accessplatform\trunk\test.jdo.hbase level.

Tell me if there is a problem with patches.

Not sure where to document this as documenting it in the HBaseUtils java doc would not expose this to the user. The HBase wiki maybe? Or do you have another proposal?

nicolas made changes - 07/Dec/12 06:40 PM
Field Original Value New Value
Attachment Store_HBase-addExtensionsToHBase.patch [ 11810 ]
Attachment Test_added_extensions_for_HBase.patch [ 11811 ]
nicolas added a comment - 07/Dec/12 06:48 PM
Added support for the following attributes:

In order to define these attributes on the @PersistenceCapable class, it is possible to use anootations. The format is similar to that of a properties file ie:

n order to indicate bloom filter is on ROW for column family then the @Exception annotation key would be extended such as:
hbase.columnFamily.<name of family>.<option>= <value>
- option: One of the above defined attributes (inMemory, bloomFilter,...)
- name of family: The column family affected.
- value: The corresponding value for this attribute.

Example usage:
                @Extension(vendorName = "datanucleus", key = "hbase.columnFamily.meta.bloomFilter", value = "ROW"),
                @Extension(vendorName = "datanucleus", key = "hbase.columnFamily.meta.inMemory", value = "true")

Note that the "meta" being the column family, the above sets bloomFilter to "ROW" and inMemory to true.

Example of annotated entity:
                @Extension(vendorName = "datanucleus", key = "hbase.columnFamily.meta.bloomFilter", value = "ROW"),
                @Extension(vendorName = "datanucleus", key = "hbase.columnFamily.meta.inMemory", value = "true")
public class ServiceProfile {

    private long id;

    // column family data, name of attribute blob
    @Column(name = "data:blob")
    private String blob;

    // column family meta, name of attribute firstName
    @Column(name = "meta:firstName")
    private String firstName;
   // column family meta, name of attribute firstName
    @Column(name = "meta:lastName")
    private String lastName;

Andy Jefferson added a comment - 08/Dec/12 11:03 AM
Thanks. A clarification : is the copyright notice for the new files supposed to be Ericsson, or yourself ? (one has Ericsson, and one your name) Any problem with just using the text of the Apache 2 license and putting the name against that ? doubt there's a problem if not though obviously simpler if all code is Apache 2.

nicolas added a comment - 08/Dec/12 11:50 AM - edited
My mistake... No problem. I work for Ericsson but did this myself. Apply the Apache 2 license.

If there is anything else I can do just say.

Andy Jefferson added a comment - 08/Dec/12 12:18 PM
SVN trunk now has your patches, thanks. I made the following minimal changes :-
1. put license as Apache2 on all new files with you as the original author.
2. renamed to since these are metadata extensions (as opposed to query extensions, or other extensions). Also made use of MetaData.VENDOR_NAME.
3. not used HBaseUtilsTest since did nothing (though we could do with some tests for methods in that class, just never had the time).
4. didn't include all of the pom.xml changes since only needed junit (not jdo-api, datanucleus-test-framework).
5. put test entity under "src/java" to match other test suites.

All builds and runs ok.

The only thing needed now is to document the extensions, in the following file

If you could provide either a patch to that (to add some basic info on the available extensions), or provide a block of text that I can put in. Thx.

nicolas added a comment - 08/Dec/12 01:27 PM
HBaseUtilsTest was there because I thought I would start with that for the unit tests. Then I forgot to remove it. Same reason for the additions to the pom.xml. Thanks for removing those.

Great that all is in svn!

Will do the documentation a bit later today or Monday.

nicolas added a comment - 10/Dec/12 06:57 PM
Here is the documentation.


Tell me if it is OK.

nicolas made changes - 10/Dec/12 06:57 PM
Attachment hbase.xml [ 11820 ]
Andy Jefferson added a comment - 10/Dec/12 08:20 PM
All in SVN trunk now, thx

Andy Jefferson made changes - 10/Dec/12 08:20 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.0.m2 [ 11781 ]
Resolution Fixed [ 1 ]
nicolas added a comment - 10/Dec/12 09:08 PM
Thank you!

Tell me if there is something I could help with.

Andy Jefferson added a comment - 11/Dec/12 02:59 PM
If you wanted to help with any other work on DataNucleus either look through JIRA if there's an issue of interest to you, otherwise look at how you use DataNucleus (and the datastores you use it with) and think about what other features it is lacking (and then add issues in JIRA to track any work).

Andy Jefferson made changes - 01/Jan/13 09:22 AM
Status Resolved [ 5 ] Closed [ 6 ]