Skip to content

Commit

Permalink
COMMON: (OpenTSDB#1453)
Browse files Browse the repository at this point in the history
- Use DIFF encoding by default
- Verify DATA_BLOCK_ENCODING variable

Signed-off-by: Chris Larsen <[email protected]>
  • Loading branch information
ZephyrGuo authored and manolama committed Dec 12, 2018
1 parent d342301 commit 93aaac4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/create_table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ BLOOMFILTER=${BLOOMFILTER-'ROW'}
COMPRESSION=${COMPRESSION-'LZO'}
# All compression codec names are upper case (NONE, LZO, SNAPPY, etc).
COMPRESSION=`echo "$COMPRESSION" | tr a-z A-Z`
DATA_BLOCK_ENCODING=${DATA_BLOCK_ENCODING-'NONE'}
# DIFF encoding is very useful for OpenTSDB's case that many small KVs and common prefix.
# This can save a lot of storage space.
DATA_BLOCK_ENCODING=${DATA_BLOCK_ENCODING-'DIFF'}
DATA_BLOCK_ENCODING=`echo "$DATA_BLOCK_ENCODING" | tr a-z A-Z`
TSDB_TTL=${TSDB_TTL-'FOREVER'}

case $COMPRESSION in
Expand All @@ -29,6 +32,13 @@ case $COMPRESSION in
;;
esac

case $DATA_BLOCK_ENCODING in
(NONE|PREFIX|DIFF|FAST_DIFF|ROW_INDEX_V1) :;; # Know good
(*)
echo >&2 "warning: encoding '$DATA_BLOCK_ENCODING' might not be supported."
;;
esac

# HBase scripts also use a variable named `HBASE_HOME', and having this
# variable in the environment with a value somewhat different from what
# they expect can confuse them in some cases. So rename the variable.
Expand Down

0 comments on commit 93aaac4

Please sign in to comment.