clojure-hbase-schemas
clojure-hbase-schemas copied to clipboard
Manipulate table definitions using schemas
Instead of manually configuring a table, add a schema-aware layer to the admin interface to allow for table creation/deletion.
Describe the column in the schema:
(define-schema :tablename [:key-type :keyword :descriptor-default {:compression-type Compression$Algorithm/LZO}] :family {:key-type :string :exceptions {...} :descriptor {:block-cache-enabled true :max-versions 10}}
The family descriptor is merged with the default-descriptor so defaults will need to be overridden by children if necessary.
Admin API:
(instantiate-table schema-name) -> creates the table and columns using descriptor information or defaults (upgrade-table schema-name) -> disable table get column family defs diff existing table descriptors with schema specifications change/add/del column families as appropriate re-enable table (table-synchronized? schema-name) -> Is the database description the same as that specified by the schema