Coder Social home page Coder Social logo

hbase-util's Introduction

hbase-util

Utilites for making it easier to interact with hbase

Usage

Working with local hbase cluster

  • lein repl

Working with a distributed hbase cluster

  • mvn clean package
  • Copy target/hbase-util-*.zip to target machine
  • Unzip it on target machine
  • kinit (if the cluster is secure)
  • Run ./bin/hbase-util from within the extracted folder

bin/hbase-util expects..

  • 'hbase' script to be on the classpath.
  • HBASE_CONF_DIR and HADOOP_CONF_DIR env variables set.

Current set of features

Create hbase tables

> (doc create)
-------------------------
hbase-util.table.create/create
([f])
  Reads tables configuration from file 'f' and
creates the corresponding tables

> (create "conf/tables.yml")

Reset hbase tables

> (doc reset)
-------------------------
hbase-util.table.reset/reset
([f])
  Like (hbase shell's ) truncate, but doesn't delete/create
the tables, but instead, for each table..
  - Disables it
  - Deletes and re-creates all column familes
  - Enables the table again
This comes in handy if the logged-in user
has limited permissions. It also preserves
split information, unlike truncate.

> (reset "conf/tables.yml")

Verify hbase tables

> (doc verify)
-------------------------
hbase-util.table.verify/verify
([in out])
  Reads tables configuration from 'in' file, as yaml,
 and dumps any difference found in 'out' file, in yaml format

> (verify "conf/tables.yml" "/tmp/verfied.yml")

Configuration

Tables configuration is specified in yaml format see dev-tables.yml. This same yaml file serves both to 'create', 'reset' and 'verify' .

Splits for a table can be specified (in the input yaml conf file) either as

file: path/to/file


* ```
info: {negions: 16, algo: "HexStringSplit", first-row: "0", last-row "F"}

vals: ["0", "1", "2", "3"]


#### Split file
Table creation and validation routines assume that the non-printable characters in the split
file are hex-encoded. Note: this code honours lower-case hex digits like \xfe which is not
honoured by hbase currently

hbase-util's People

Contributors

rdsr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.