Guest User

Untitled

a guest
Feb 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #!/bin/sh
  4. # this script sets the TTL(in seconds) value on the tsdb column family in HBase.
  5.  
  6. TTL=$1
  7. if ! [[ $TTL =~ ^[1-9][0-9]*$ ]] ; then
  8. echo "Invalid TTL value (expecting a postive integer)" 1>&2
  9. exit 1
  10. fi
  11.  
  12.  
  13. # set TSDB_TABLE name if not already set in ENV
  14. TSDB_TABLE=${TSDB_TABLE-'tsdb'}
  15.  
  16. export JAVA_HOME=/usr/lib/jvm/jre
  17.  
  18. hbh=/opt/hbase
  19. exec "$hbh/bin/hbase" shell <<EOF
  20. disable '$TSDB_TABLE';
  21. alter '$TSDB_TABLE', {NAME=>'t', TTL=>'$TTL'};
  22. enable '$TSDB_TABLE';
  23. describe '$TSDB_TABLE'
  24. EOF
Add Comment
Please, Sign In to add comment