add optional connection scheme flag
@@ -26,17 +26,19 @@ TEMP_DIR=$(mktemp -d -t pinotGenerator-XXXXXXXX)
TEMPLATE_BASEDIR="$TEMP_DIR/generator"
CONTROLLER_HOST="localhost"
CONTROLLER_PORT="9000"
+CONTROLLER_SCHEME="http"
-USAGE="$(basename "$0") [-h] [-a PATH] [-c HOST:PORT] [-j PATH] [-n ROWS] TEMPLATE_NAME [TABLE_NAME]
+USAGE="$(basename "$0") [-h] [-a PATH] [-c HOST:PORT] [-s SCHEME] [-j PATH] [-n ROWS] TEMPLATE_NAME [TABLE_NAME]
where:
-h show this help text
-a set pinot-admin path for segement creation
- -c set the controller host and port (default: 'localhost:9000')
+ -c set controller host and port (default: 'localhost:9000')
-j set jar path for resource extraction
- -n number of rows to generate. (optional)"
+ -n set number of rows to generate (optional)
+ -s set connection scheme (default: 'http')"
-while getopts ':ha:c:j:n:' OPTION; do
+while getopts ':ha:c:j:n:s:' OPTION; do
case "$OPTION" in
h) echo "$USAGE"
exit
@@ -52,6 +54,8 @@ while getopts ':ha:c:j:n:' OPTION; do
;;
n) NUM_RECORDS="$OPTARG"
;;
+ s) CONTROLLER_SCHEME="$OPTARG"
+ ;;
:) printf "missing argument for -%s\n" "$OPTARG" >&2
echo "$USAGE" >&2
exit 1
@@ -151,7 +155,8 @@ JAVA_OPTS="" ${ADMIN_PATH} AddTable -exec \
-tableConfigFile "${TEMPLATE_BASEDIR}/${TEMPLATE_NAME}_config.json" \
-schemaFile "${TEMPLATE_BASEDIR}/${TEMPLATE_NAME}_schema.json" \
-controllerHost "${CONTROLLER_HOST}" \
--controllerPort "${CONTROLLER_PORT}"
+-controllerPort "${CONTROLLER_PORT}" \
+-controllerProtocol "${CONTROLLER_SCHEME}"
if [ $? != 0 ]; then
echo "Adding table failed. Aborting."
@@ -164,7 +169,8 @@ JAVA_OPTS="" ${ADMIN_PATH} UploadSegment \
-tableName "${TABLE_NAME}" \
-segmentDir "${SEGMENT_DIR}" \
-controllerHost "${CONTROLLER_HOST}" \
--controllerPort "${CONTROLLER_PORT}"
+-controllerPort "${CONTROLLER_PORT}" \
+-controllerProtocol "${CONTROLLER_SCHEME}"
if [ $? != 0 ]; then
echo "Segment upload failed. Aborting."
@@ -175,4 +181,4 @@ fi
echo "Deleting temp directory"
rm -rf "$TEMP_DIR"
-echo "Succesfully created table ${TABLE_NAME} from template ${TEMPLATE_NAME}"
+echo "Successfully created table ${TABLE_NAME} from template ${TEMPLATE_NAME}"
