Skip to content

Commit 93aaac4

Browse files
ZephyrGuomanolama
authored andcommitted
COMMON: (OpenTSDB#1453)
- Use DIFF encoding by default - Verify DATA_BLOCK_ENCODING variable Signed-off-by: Chris Larsen <[email protected]>
1 parent d342301 commit 93aaac4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/create_table.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ BLOOMFILTER=${BLOOMFILTER-'ROW'}
1919
COMPRESSION=${COMPRESSION-'LZO'}
2020
# All compression codec names are upper case (NONE, LZO, SNAPPY, etc).
2121
COMPRESSION=`echo "$COMPRESSION" | tr a-z A-Z`
22-
DATA_BLOCK_ENCODING=${DATA_BLOCK_ENCODING-'NONE'}
22+
# DIFF encoding is very useful for OpenTSDB's case that many small KVs and common prefix.
23+
# This can save a lot of storage space.
24+
DATA_BLOCK_ENCODING=${DATA_BLOCK_ENCODING-'DIFF'}
25+
DATA_BLOCK_ENCODING=`echo "$DATA_BLOCK_ENCODING" | tr a-z A-Z`
2326
TSDB_TTL=${TSDB_TTL-'FOREVER'}
2427

2528
case $COMPRESSION in
@@ -29,6 +32,13 @@ case $COMPRESSION in
2932
;;
3033
esac
3134

35+
case $DATA_BLOCK_ENCODING in
36+
(NONE|PREFIX|DIFF|FAST_DIFF|ROW_INDEX_V1) :;; # Know good
37+
(*)
38+
echo >&2 "warning: encoding '$DATA_BLOCK_ENCODING' might not be supported."
39+
;;
40+
esac
41+
3242
# HBase scripts also use a variable named `HBASE_HOME', and having this
3343
# variable in the environment with a value somewhat different from what
3444
# they expect can confuse them in some cases. So rename the variable.

0 commit comments

Comments
 (0)