You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ap...@apache.org on 2021/06/10 21:55:58 UTC

[incubator-pinot] 01/01: add auth support to generator.sh

This is an automated email from the ASF dual-hosted git repository.

apucher pushed a commit to branch data-generator-auth-support
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit f746310fce280211f595edab162fa7d5dd670fdf
Author: Alexander Pucher <al...@alexpucher.com>
AuthorDate: Thu Jun 10 14:55:27 2021 -0700

    add auth support to generator.sh
---
 docker/images/pinot/bin/generator.sh | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/docker/images/pinot/bin/generator.sh b/docker/images/pinot/bin/generator.sh
index 15d9126..03a11ff 100755
--- a/docker/images/pinot/bin/generator.sh
+++ b/docker/images/pinot/bin/generator.sh
@@ -27,10 +27,11 @@ TEMPLATE_BASEDIR="$TEMP_DIR/generator"
 CONTROLLER_HOST="localhost"
 CONTROLLER_PORT="9000"
 CONTROLLER_SCHEME="http"
+AUTH_TOKEN=""
 
 export JAVA_OPTS="$(echo $JAVA_OPTS | sed -E 's/-javaagent\S+//')"
 
-USAGE="$(basename "$0") [-h] [-a PATH] [-c HOST:PORT] [-s SCHEME] [-j PATH] [-n ROWS] TEMPLATE_NAME [TABLE_NAME]
+USAGE="$(basename "$0") [-h] [-a PATH] [-c HOST:PORT] [-s SCHEME] [-t AUTH_TOKEN] [-j PATH] [-n ROWS] TEMPLATE_NAME [TABLE_NAME]
 
   where:
       -h  show this help text
@@ -38,9 +39,10 @@ USAGE="$(basename "$0") [-h] [-a PATH] [-c HOST:PORT] [-s SCHEME] [-j PATH] [-n
       -c  set controller host and port (default: 'localhost:9000')
       -j  set jar path for resource extraction
       -n  set number of rows to generate (optional)
-      -s  set connection scheme (default: 'http')"
+      -s  set connection scheme (default: 'http')
+      -t  set auth token (optional)"
 
-while getopts ':ha:c:j:n:s:' OPTION; do
+while getopts ':ha:c:j:n:s:t:' OPTION; do
   case "$OPTION" in
     h) echo "$USAGE"
        exit
@@ -58,6 +60,8 @@ while getopts ':ha:c:j:n:s:' OPTION; do
        ;;
     s) CONTROLLER_SCHEME="$OPTARG"
        ;;
+    t) AUTH_TOKEN="$OPTARG"
+       ;;
     :) printf "missing argument for -%s\n" "$OPTARG" >&2
        echo "$USAGE" >&2
        exit 1
@@ -154,6 +158,7 @@ fi
 
 echo "Adding table ${TABLE_NAME} from template ${TEMPLATE_NAME}"
 ${ADMIN_PATH} AddTable -exec \
+-authToken "${AUTH_TOKEN}" \
 -tableConfigFile "${TEMPLATE_BASEDIR}/${TEMPLATE_NAME}_config.json" \
 -schemaFile "${TEMPLATE_BASEDIR}/${TEMPLATE_NAME}_schema.json" \
 -controllerHost "${CONTROLLER_HOST}" \
@@ -168,6 +173,7 @@ fi
 
 echo "Uploading segment for ${TEMPLATE_NAME}"
 ${ADMIN_PATH} UploadSegment \
+-authToken "${AUTH_TOKEN}" \
 -tableName "${TABLE_NAME}" \
 -segmentDir "${SEGMENT_DIR}" \
 -controllerHost "${CONTROLLER_HOST}" \

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org