@@ -22,8 +22,6 @@ if [[ -n "$GEOMESA_CONF_DIR" ]] && [[ ! "$GEOMESA_CONF_DIR" -ef "$%%tools.dist.
2222fi
2323export GEOMESA_CONF_DIR=" ${%% tools.dist.name%% _HOME} /conf"
2424
25- NG_RUNNER=" org.locationtech.geomesa.tools.utils.NailgunServer"
26-
2725source " ${GEOMESA_CONF_DIR} /geomesa-env.sh"
2826source " ${GEOMESA_CONF_DIR} /functions.sh"
2927
@@ -82,42 +80,6 @@ function get_classpath() {
8280 fi
8381}
8482
85- function start_nailgun() {
86- load_classpath
87- local NG_OPTS=()
88- if [[ -n " $GEOMESA_NG_SERVER " ]]; then
89- NG_OPTS+=(" -host" " $GEOMESA_NG_SERVER " )
90- fi
91- if [[ -n " $GEOMESA_NG_PORT " ]]; then
92- NG_OPTS+=(" --port" " $GEOMESA_NG_PORT " )
93- fi
94- if [[ -n " $GEOMESA_NG_TIMEOUT " ]]; then
95- NG_OPTS+=(" --timeout" " $GEOMESA_NG_TIMEOUT " )
96- fi
97- if [[ -n " $GEOMESA_NG_IDLE " ]]; then
98- NG_OPTS+=(" --idle" " $GEOMESA_NG_IDLE " )
99- fi
100- if [[ -n " $GEOMESA_NG_POOL_SIZE " ]]; then
101- NG_OPTS+=(" --pool-size" " $GEOMESA_NG_POOL_SIZE " )
102- fi
103- echo -n " Starting Nailgun server... " >&2
104- # create a named pipe to read our nailgun startup output
105- fd=" $( mktemp --tmpdir ngfdXXXX) " && rm " $fd " && mkfifo " $fd "
106- exec 3<> " $fd " # tie the pipe to output 3
107- rm " $fd " # remove the pipe so that the process can exit normally
108- # start nailgun in the background and redirect output to the pipe
109- # shellcheck disable=SC2086
110- nohup java $GEOMESA_OPTS -cp " $CLASSPATH " $NG_RUNNER " ${NG_OPTS[@]} " >&3 2>&1 < /dev/null &
111- # read the output from the nailgun start up, timeout after 60 seconds
112- read -t 60 -r ng_output < & 3
113- echo " $ng_output " >&2
114- if ! echo " $ng_output " | grep -q started; then
115- echo " Error starting Nailgun server" >&2
116- exit 1
117- fi
118- }
119-
120-
12183if [[ $1 = classpath ]]; then
12284 get_classpath | tr ' :' ' \n' | sort
12385elif [[ $1 = configure ]]; then
@@ -128,22 +90,6 @@ elif [[ $1 = scala-console ]]; then
12890 # scala console requires options to be passed in through java_opts
12991 export JAVA_OPTS=" ${GEOMESA_OPTS} "
13092 geomesa_scala_console " $( get_classpath) " " $@ "
131- elif [[ $1 = ng && $2 = start ]]; then
132- start_nailgun
133- elif [[ $1 = ng && $2 = stop ]]; then
134- " ${%% tools.dist.name%% _HOME} " /bin/ng ng-stop
135- elif [[ $1 = ng && $2 = classpath ]]; then
136- " ${%% tools.dist.name%% _HOME} " /bin/ng ng-cp
137- elif [[ " $GEOMESA_NG_ENABLED " = " true" ]]; then
138- # check to see if the nailgun server is up
139- " ${%% tools.dist.name%% _HOME} " /bin/ng ng-version > /dev/null 2>&1
140- RET=$?
141- if [[ $RET -ne 0 ]]; then
142- # it's not running, start the nailgun server
143- start_nailgun
144- fi
145- # invoke the nailgun client
146- " ${%% tools.dist.name%% _HOME} " /bin/ng " %%tools.runner%%" " $@ "
14793else
14894 load_classpath
14995 # shellcheck disable=SC2086
0 commit comments