- Surus-covered tables are being processed by Surus ORM [3]
- HBE supports multiple ORM and multi-component rowKeys via ORMInterface and ORMContext
- All tables, not covered by custom ORM are processed by HBE default pattern mechanism
Let's take a look at two screenshots:
Please, note that rowKey components are changing to match the table structure. On the backend, it is supported by two new methods that were added to AbstractPrimaryKey class:
- Map<String, Class> getComponents()
- ImmutableBytesWritable generateRowKey(Map<String, Object> components);
First is irreplaceable, when it comes to finding out keyRow structure, and second is required to construct actual rowKey from HTML parameters.
Next, let's review what would you need to do to plug-in custom ORM for HBE. It would be two simple steps:
- Implement interface ORMInterface
Let's assume class' name will be "AnotherOrm" - Register "AnotherOrm" instance in ORMContext static section:
static {
CONTEXT.add(new OrmSurus());
CONTEXT.add(new AnotherOrm());
} - Build, deploy and use!
In summary: both Surus and HBE got cool features to make your life easier.
Cheers!
[1] HBase Explorer with Surus Integration and multi-ORM support:
[2] Original HBase Explorer:
[3] Surus ORM:
No comments:
Post a Comment