mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
added host:port as a command line input
This commit is contained in:
parent
b6875476ff
commit
d40eefb364
1 changed files with 5 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# To run:
|
||||
# ./ingestWorkload.sh {Path for featurebase binary} {Path for directory with csv files} {initialize flag}
|
||||
# ./ingestWorkload.sh {Path for featurebase binary} {Local host & port for featurebase} {Path for directory with csv files} {initialize flag}
|
||||
|
||||
function delete_field {
|
||||
if (($INITIALIZE == 0));
|
||||
|
|
@ -34,6 +34,10 @@ function ingest_set_field {
|
|||
FEATUREBASE_PATH=$1
|
||||
shift
|
||||
|
||||
# featurebase host & port
|
||||
HOST=$1
|
||||
shift
|
||||
|
||||
# path for directory with csv directory files for all fields to be ingested
|
||||
CSV_DIR_PATH=$1
|
||||
shift
|
||||
|
|
@ -45,8 +49,6 @@ shift
|
|||
# get a list of csv files in the directory
|
||||
CSV_FILES=`ls $CSV_DIR_PATH/*.csv`
|
||||
|
||||
# featurebase host
|
||||
HOST="localhost:10101"
|
||||
# assign index name
|
||||
INDEX="samsung"
|
||||
if (($INITIALIZE == 1));
|
||||
|
|
@ -62,24 +64,19 @@ for CSV_FILE in ${CSV_FILES[@]}
|
|||
if [[ "$FIELD" == *"age"* ]];
|
||||
then
|
||||
MAX=100
|
||||
echo $CSV_FILE $MAX
|
||||
ingest_int_field
|
||||
elif [[ "$FIELD" == *"identifier"* ]];
|
||||
then
|
||||
MAX=$((2**63 - 1)) # compute max value for 64bit
|
||||
echo $CSV_FILE $MAX
|
||||
ingest_int_field
|
||||
elif [[ "$FIELD" == *"ip"* ]];
|
||||
then
|
||||
MAX=$((2**31 - 1)) # compute max value for 32bit
|
||||
echo $CSV_FILE $MAX
|
||||
ingest_int_field
|
||||
elif [[ "$FIELD" == *"time"* ]];
|
||||
then
|
||||
echo $CSV_FILE
|
||||
ingest_time_field
|
||||
else
|
||||
echo $CSV_FILE
|
||||
ingest_set_field
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue