@@ -33,7 +33,6 @@ DEFAULT_PROXY_CONF=$PULSAR_HOME/conf/proxy.conf
33
33
DEFAULT_STANDALONE_CONF=$PULSAR_HOME /conf/standalone.conf
34
34
DEFAULT_WEBSOCKET_CONF=$PULSAR_HOME /conf/websocket.conf
35
35
DEFAULT_LOG_CONF=$PULSAR_HOME /conf/log4j2.yaml
36
- DEFAULT_PULSAR_PRESTO_CONF=${PULSAR_HOME} /conf/presto
37
36
DEFAULT_FUNCTIONS_LOG_CONF=$PULSAR_HOME /conf/functions_log4j2.xml
38
37
39
38
# functions related variables
@@ -46,7 +45,8 @@ PY_INSTANCE_FILE=${PULSAR_PY_INSTANCE_FILE:-"${DEFAULT_PY_INSTANCE_FILE}"}
46
45
DEFAULT_FUNCTIONS_EXTRA_DEPS_DIR=$PULSAR_HOME /instances/deps
47
46
FUNCTIONS_EXTRA_DEPS_DIR=${PULSAR_FUNCTIONS_EXTRA_DEPS_DIR:- " ${DEFAULT_FUNCTIONS_EXTRA_DEPS_DIR} " }
48
47
SQL_HOME=$PULSAR_HOME /pulsar-sql
49
- PRESTO_HOME=${PULSAR_HOME} /lib/presto
48
+ TRINO_HOME=${PULSAR_HOME} /trino
49
+ DEFAULT_PULSAR_TRINO_CONF=${TRINO_HOME} /conf
50
50
51
51
pulsar_help () {
52
52
cat << EOF
@@ -90,7 +90,7 @@ Environment variables:
90
90
PULSAR_PROXY_CONF Configuration file for Pulsar proxy (default: $DEFAULT_PROXY_CONF )
91
91
PULSAR_WORKER_CONF Configuration file for functions worker (default: $DEFAULT_WORKER_CONF )
92
92
PULSAR_STANDALONE_CONF Configuration file for standalone (default: $DEFAULT_STANDALONE_CONF )
93
- PULSAR_PRESTO_CONF Configuration directory for Pulsar Presto (default: $DEFAULT_PULSAR_PRESTO_CONF )
93
+ PULSAR_TRINO_CONF Configuration directory for Pulsar SQL (default: $DEFAULT_PULSAR_TRINO_CONF )
94
94
PULSAR_EXTRA_OPTS Extra options to be passed to the jvm
95
95
PULSAR_EXTRA_CLASSPATH Add extra paths to the pulsar classpath
96
96
PULSAR_PID_DIR Folder where the pulsar server PID file should be stored
@@ -177,17 +177,17 @@ if [ ! -f "${PY_INSTANCE_FILE}" ]; then
177
177
PY_INSTANCE_FILE=${BUILT_PY_INSTANCE_FILE}
178
178
fi
179
179
180
- # find pulsar sql presto distribution location
181
- check_presto_libraries () {
182
- if [ ! -d " ${PRESTO_HOME} " ]; then
183
-
184
- BUILT_PRESTO_HOME=" ${SQL_HOME} /presto-distribution/target/pulsar-presto-distribution"
185
- if [ ! -d " ${BUILT_PRESTO_HOME} " ]; then
186
- echo " \nCouldn't find presto distribution." ;
180
+ # find pulsar sql trino distribution location
181
+ check_trino_libraries () {
182
+ if [ ! -d " ${TRINO_HOME} " ]; then
183
+ BUILT_TRINO_HOME=" ${SQL_HOME} /presto-distribution/target/pulsar-presto-distribution"
184
+ if [ ! -d " ${BUILT_TRINO_HOME} " ]; then
185
+ echo " \nCouldn't find trino distribution." ;
187
186
echo " Make sure you've run 'mvn package'\n" ;
188
187
exit 1;
189
188
fi
190
- PRESTO_HOME=${BUILT_PRESTO_HOME}
189
+ TRINO_HOME=${BUILT_TRINO_HOME}
190
+ PULSAR_TRINO_CONF=${BUILT_TRINO_HOME} /conf
191
191
fi
192
192
}
193
193
@@ -257,8 +257,19 @@ if [ -z "$PULSAR_LOG_CONF" ]; then
257
257
PULSAR_LOG_CONF=$DEFAULT_LOG_CONF
258
258
fi
259
259
260
- if [ -z " $PULSAR_PRESTO_CONF " ]; then
261
- PULSAR_PRESTO_CONF=$DEFAULT_PULSAR_PRESTO_CONF
260
+ if [ -z " $PULSAR_TRINO_CONF " ]; then
261
+ # TODO: As PIP-200 accepted, this compatibility is not promised. Refactor when we drop this b/w compatibility.
262
+ if [ -z " $PULSAR_PRESTO_CONF " ]; then
263
+ PULSAR_TRINO_CONF=$DEFAULT_PULSAR_TRINO_CONF
264
+ else
265
+ PULSAR_TRINO_CONF=$PULSAR_PRESTO_CONF
266
+ fi
267
+ if [ ! -d " ${PULSAR_TRINO_CONF} " ]; then
268
+ FALLBACK_PULSAR_PRESTO_CONF=${PULSAR_HOME} /conf/presto
269
+ if [ -d " ${FALLBACK_PULSAR_PRESTO_CONF} " ]; then
270
+ PULSAR_TRINO_CONF=$FALLBACK_PULSAR_PRESTO_CONF
271
+ fi
272
+ fi
262
273
fi
263
274
264
275
if [ -z " $FUNCTIONS_LOG_CONF " ]; then
@@ -387,11 +398,11 @@ elif [ $COMMAND == "broker-tool" ]; then
387
398
elif [ $COMMAND == " compact-topic" ]; then
388
399
exec $JAVA $OPTS org.apache.pulsar.compaction.CompactorTool --broker-conf $PULSAR_BROKER_CONF $@
389
400
elif [ $COMMAND == " sql" ]; then
390
- check_presto_libraries
391
- exec $JAVA -cp " ${PRESTO_HOME } /lib/*" io.trino.cli.Trino --server localhost:8081 " ${@ } "
401
+ check_trino_libraries
402
+ exec $JAVA -cp " ${TRINO_HOME } /lib/*" io.trino.cli.Trino --server localhost:8081 " ${@ } "
392
403
elif [ $COMMAND == " sql-worker" ]; then
393
- check_presto_libraries
394
- exec python3 ${PRESTO_HOME } /bin/launcher.py --etc-dir ${PULSAR_PRESTO_CONF } " ${@ } "
404
+ check_trino_libraries
405
+ exec python3 ${TRINO_HOME } /bin/launcher.py --etc-dir ${PULSAR_TRINO_CONF } " ${@ } "
395
406
elif [ $COMMAND == " tokens" ]; then
396
407
exec $JAVA $OPTS org.apache.pulsar.utils.auth.tokens.TokensCliUtils $@
397
408
elif [ $COMMAND == " version" ]; then
0 commit comments