-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-ingest
executable file
·50 lines (43 loc) · 1.79 KB
/
test-ingest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# usage: test-ingest [OPTIONS]
# $1 = number of rows, default is 1000
# $2 = number of splits, default is 20
# COMING SOON $3 = true to setup crypto, default to false
ROWS=${1:-1000}
SPLITS=${2:-20}
#CRYPTO=${3:-false}
CRYPTO=false
COLS=10
SPLITS_FILE=$ACCUMULO_HOME/conf/splits
if [[ -f $SPLITS_FILE ]]; then
echo "Using $SPLITS_FILE"
fi
# need test jar to be in lib
echo "Looking for test jar in $ACCUMULO_HOME/lib"
if compgen -G "${ACCUMULO_HOME}/lib/accumulo-test-*.jar" > /dev/null; then
echo "Test jar found"
else
echo "Test jar is not in lib!"
echo "From source build dir: cp test/target/accumulo-test-2.1.0-SNAPSHOT.jar $ACCUMULO_HOME/lib"
exit 1
fi
# create splits
NUM=$((ROWS / SPLITS))
echo "Writing $SPLITS splits to $SPLITS_FILE"
for (( x=1; x<=$SPLITS; x++ )) ; do
s=$((x * NUM))
printf "row_%010d\n" "$s" | tee -a "$SPLITS_FILE"
done
accumulo shell -e 'droptable test_ingest -f' -u root -p secret
accumulo shell -e 'createtable test_ingest' -u root -p secret
if [ "$CRYPTO" = true ] ; then
accumulo shell -e 'config -t test_ingest -s table.crypto.opts.key.uri=/home/mike/workspace/uno/CryptoTest-testkeyfile' -u root -p secret
accumulo shell -e 'config -t test_ingest -s table.crypto.service=org.apache.accumulo.core.spi.crypto.NoCryptoService' -u root -p secret
accumulo shell -e 'config -t test_ingest -s table.crypto.opts.enabled=false' -u root -p secret
fi
accumulo shell -e "addsplits -t test_ingest -sf $SPLITS_FILE" -u root -p secret
echo "Ingesting $ROWS rows"
accumulo org.apache.accumulo.test.TestIngest -c "$ACCUMULO_HOME/conf/accumulo-client.properties" -u root --rows "${ROWS}" --cols "${COLS}"
#accumulo shell -e 'tables -l' -u root -p secret
echo "Other possible commands to run"
echo "accumulo shell -e 'flush -t test_ingest'"
echo "accumulo shell -e 'compact -t test_ingest'"