Skip to content

bitware/HBaseShellProOld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HBaseShellPro

HBaseShellPro is a powerful Hbase Shell extention.

1. Can use filter in all command
2. Can use Regular Expression in command parameter
3. Log all command output
4. More simple more lighter then hbase shell

Now it support hbase-0.20.4, hbase-0.94.2(https://github.com/bit-ware/HBaseShellPro/tree/0.94)

Licnese

MIT License (see LICENSE)

Usage

1. vi conf/hbase-site.xml

modify hbase.zookeeper.quorum

2. run.rb

Command List

CLEAR – clear table contents

  • WARNING : ‘clear’(and its alias) will clear contents of all tables in database
  • NOTE : use ‘clear! …’ to force clear

usage : clear [table_pattern]
example : clear ^test_table
alias : [c, cle, clr]

CONNECT – show current quorums or set new quorums temporarily

  • NOTE: for permanent change of quorums, modify hosts file
    [windows: C:\Windows\System32\drivers\etc\hosts / linux: /etc/hosts]
    or change value of ‘hbase.zookeeper.quorum’ in conf/hbase-site.xml

usage : connect [quorums_separated_by_comma]
example : connect 172.17.1.206
alias : [con]

CREATE – create table

usage : create table_name family_name1 [family_name2 …]
example : create test_table family1 family2
alias : [cre]

DELETE – delete data in database with given filter

  • WARNING : ‘delete’(and its alias) will delete all tables in database
  • NOTE : use ‘delete! …’ to force delete

usage : delete [table_pattern [row_pattern [family_pattern [qualifier_pattern [value_pattern]]]]]
example : delete ^test_table family1
alias : [del]

DESCRIBE – describe the named table

usage : describe [table_pattern [family_pattern]]
example : describe ^135530186920f18b9049b0a0743e86ac3185887c5d
alias : [d, des]

FILTER – scan database data with given filter, other_pattern will be applied like grep finally

usage : filter [table_pattern [row_pattern [family_pattern [qualifier_pattern [value_pattern]]]]] other_pattern
example : filter ^135530186920f18b9049b0a0743e86ac3185887c5d fullpath
alias : [f]

GET – get contents of database, table, row, family or qualifier

usage : get [table_name [row_key [family_name [qualifier_name]]]]
example : get 135530186920f18b9049b0a0743e86ac3185887c5d f30dab5e-4b42-11e2-b324-998f21848d86file
alias : [g]

HELP – show help message

usage : help [topic1 [topic2 …]]
example : help filter get
alias : [h]

HISTORY – show command history

usage : history [count [pattern]]
example : history 3 get
alias : [his]

LIST – list database data at a specified level

usage : list [table_pattern [row_pattern [family_pattern [qualifier_pattern [value_pattern]]]]]
example : list ^135530186920f18b9049b0a0743e86ac3185887c5d file
alias : [l, ls]

PUT – put a cell ‘value’ at specified table/row/family:qualifier

usage : put table_name row_key family_name qualifier_name value
example : put test_table row1 family1 qualifier1 value1
alias : [p]

QUIT – quit this shell

usage : quit
example : quit
alias : [e, q, exit]

RENAME – rename table in hbase

usage : rename old_table_name new_table_name
example : rename test_table test_table2
alias : [r, ren]

SCAN – scan database data with given filter

usage : scan [table_pattern [row_pattern [family_pattern [qualifier_pattern [value_pattern]]]]]
example : scan ^135530186920f18b9049b0a0743e86ac3185887c5d . fileinfo
alias : [s]

VERSION – show version message

usage : version
example : version
alias : [v, ver]

** NOTE – Keyboard in linux

- all control keys are not usable before jline added
- thanks to jline, arrow left/right/up/down are usable, but
- backspace and delete are switched (resolved by MyUnixTerminal)
- home/end, page up/down are not usable (resolved by MyConsoleReader partially)
- the following text in pasting text will act as control keys
- ‘1~’ → home, go to begin of line
- ‘2~’ → insert, do nothing
- ‘4~’ → end, go to end of line
- ‘5~’ → page up, move to first history entry
- ‘6~’ → page down, move to last history entry

Author

Xia Xiongjun

Sponser

BitWare Inc. (http://www.bit-ware.co.jp [email protected])

About

HBaseShellPro

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •