flink 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env bash
  2. ################################################################################
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. ################################################################################
  19. target="$0"
  20. # For the case, the executable has been directly symlinked, figure out
  21. # the correct bin path by following its symlink up to an upper bound.
  22. # Note: we can't use the readlink utility here if we want to be POSIX
  23. # compatible.
  24. iteration=0
  25. while [ -L "$target" ]; do
  26. if [ "$iteration" -gt 100 ]; then
  27. echo "Cannot resolve path: You have a cyclic symlink in $target."
  28. break
  29. fi
  30. ls=`ls -ld -- "$target"`
  31. target=`expr "$ls" : '.* -> \(.*\)$'`
  32. iteration=$((iteration + 1))
  33. done
  34. # Convert relative path to absolute path
  35. bin=`dirname "$target"`
  36. # get flink config
  37. . "$bin"/config.sh
  38. if [ "$FLINK_IDENT_STRING" = "" ]; then
  39. FLINK_IDENT_STRING="$USER"
  40. fi
  41. CC_CLASSPATH=`constructFlinkClassPath`
  42. log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-client-$HOSTNAME.log
  43. log_setting=(-Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4j-cli.properties -Dlog4j.configurationFile=file:"$FLINK_CONF_DIR"/log4j-cli.properties -Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/logback.xml)
  44. # Add Client-specific JVM options
  45. FLINK_ENV_JAVA_OPTS="${FLINK_ENV_JAVA_OPTS} ${FLINK_ENV_JAVA_OPTS_CLI}"
  46. # Add HADOOP_CLASSPATH to allow the usage of Hadoop file systems
  47. exec "${JAVA_RUN}" $JVM_ARGS $FLINK_ENV_JAVA_OPTS "${log_setting[@]}" -classpath "`manglePathList "$CC_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.client.cli.CliFrontend "$@"