HBase default REST API

HFactory Tools brings greater simplification and a much better usability than the HBase default REST API (formerly known as Stargate). HFactory Tools has been built with the expectations of the application developer in mind, and is designed to abstract away the low-level intricacies complexities of HBase to make it more widely accessible.

Scala-based DSL

With HTalk, HFactory Tools includes a high-level, expressive DSL for HBase CRUD operation. HTalk significantly reduces boilerplate code, and its power can be observed with the following example:

"user" put ("project1", "name", "YourProject") execute

Entity vs table-level API

HBase default REST API firmy sits at the table level. While this is powerful, it is also quite remote from application and business requirements. Instead, HFactory Tools offers an entity-centric API more suitable to web wervices and application development than this table-level implementation. And going one step further, HFactory Tools fully automates the generation of the REST API in the standard Swagger / OpenAPI 2.0 format from the description of the entities.

Decoding of bytecode arrays

HBase default REST API lets you manage the complexity of NoSQL serialization. This is obviously feasable, but painful and best avoided unless you have a special fondness for Base64 encoding… Such functionality is included in HFactory Tools, which lets you focus on higher-level developments. HFactory Tools automatically converts HBase byte arrays into a strongly-typed, entity-oriented interface which enables you to interact with standard JSON.

Example output with HFactory Tools REST API

http://zeppelin/TSN/sensors/53797374656d310044657669636531004d6f746f72315f63757272656e745f617665726167655f616273

{"rowKey":"53797374656d310044657669636531004d6f746f72315f63757272656e745f617665726167655f616273","fields":
{"id":"Motor1_current_average_abs","deviceId":"Device1","systemId":"System1","description":"Motor 1's average current consumption","tags":
{"unit":"A","name":"Motor1_current_average_abs","system":"System1","device":"Device1"}}}`

Example output with HBase default REST API

curl -H "Accept: application/json" http://zeppelin:9999/sensor/System1%00Device1%00Motor1_current_average_abs

{"Row":

[{"key":"U3lzdGVtMQBEZXZpY2UxAE1vdG9yMV9jdXJyZW50X2F2ZXJhZ2VfYWJz","Cell":
[{"column":"ZDpkZXNjcmlwdGlvbg==","timestamp":1473928112497,"$":"TW90b3IgMSdzIGF2ZXJhZ2UgY3VycmVudCBjb25zdW1wdGlvbg=="},
{"column":"ZDpkZXZpY2VJZA==","timestamp":1473928112497,"$":"RGV2aWNlMQ=="},
{"column":"ZDppZA==","timestamp":1473928112497,"$":"TW90b3IxX2N1cnJlbnRfYXZlcmFnZV9hYnM="},
{"column":"ZDpzeXN0ZW1JZA==","timestamp":1473928112497,"$":"U3lzdGVtMQ=="},
{"column":"dDpkZXZpY2U=","timestamp":1473928112497,"$":"RGV2aWNlMQ=="},
{"column":"dDpuYW1l","timestamp":1473928112497,"$":"TW90b3IxX2N1cnJlbnRfYXZlcmFnZV9hYnM="},
{"column":"dDpzeXN0ZW0=","timestamp":1473928112497,"$":"U3lzdGVtMQ=="},
{"column":"dDp1bml0","timestamp":1473928112497,"$":"QQ=="}]}]}