zkTxnLogToolkit.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. # https://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing,
  14. # software distributed under the License is distributed on an
  15. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. # KIND, either express or implied. See the License for the
  17. # specific language governing permissions and limitations
  18. # under the License.
  19. #
  20. #
  21. # If this scripted is run out of /usr/bin or some other system bin directory
  22. # it should be linked to and not copied. Things like java jar files are found
  23. # relative to the canonical path of this script.
  24. #
  25. # use POSIX interface, symlink is followed automatically
  26. ZOOBIN="${BASH_SOURCE-$0}"
  27. ZOOBIN="$(dirname "$ZOOBIN")"
  28. ZOOBINDIR="$(cd "$ZOOBIN" && pwd)"
  29. if [[ -e "$ZOOBIN/../libexec/zkEnv.sh" ]]; then
  30. # shellcheck source=bin/zkEnv.sh
  31. . "$ZOOBINDIR"/../libexec/zkEnv.sh
  32. else
  33. # shellcheck source=bin/zkEnv.sh
  34. . "$ZOOBINDIR"/zkEnv.sh
  35. fi
  36. # shellcheck disable=SC2206
  37. flags=($JVMFLAGS)
  38. "$JAVA" "${flags[@]}" \
  39. org.apache.zookeeper.server.persistence.TxnLogToolkit "$@"