# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
does_jvm_support_ti(){
version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$version" < "1.5" ]]; then
return 1
else
return 0
fi
}
set_debug_param(){
OIFS=$IFS
IFS='='
pair=($1)
case "${pair[0]}" in
recursive)
export HIVE_DEBUG_RECURSIVE="${pair[1]}"
;;
port)
port="address=${pair[1]}"
;;
mainSuspend)
main_suspend="suspend=${pair[1]}"
;;
childSuspend)
child_suspend="suspend=${pair[1]}"
;;
swapSuspend)
tmp=$child_suspend
child_suspend=$main_suspend
main_suspend=$tmp
;;
*)
;;
esac
IFS=$OIFS;
}
parse_debug(){
IFS=':'
read -ra params <<< "$1"
IFS=','
for param in ${params[1]}; do
set_debug_param "$param"
done
unset IFS
}
set_debug_defaults(){
export HIVE_DEBUG_RECURSIVE="y"
port="address=8000"
main_suspend="suspend=y"
child_suspend="suspend=n"
}
get_debug_params(){
set_debug_defaults
parse_debug $1
# For Debug -XX:+UseParallelGC is needed, as it is a (unfortunately not perfect)
# workaround for JVM 6862295 bug, that affects some JVMs still in use
if does_jvm_support_ti; then
export HIVE_MAIN_CLIENT_DEBUG_OPTS=" -XX:+UseParallelGC -agentlib:jdwp=transport=dt_socket,server=y,$port,$main_suspend"
export HIVE_CHILD_CLIENT_DEBUG_OPTS=" -XX:+UseParallelGC -agentlib:jdwp=transport=dt_socket,server=y,$child_suspend"
else
export HIVE_MAIN_CLIENT_DEBUG_OPTS=" -XX:+UseParallelGC -Xdebug -Xrunjdwp:transport=dt_socket,server=y,$port,$main_suspend"
export HIVE_CHILD_CLIENT_DEBUG_OPTS=" -XX:+UseParallelGC -Xdebug -Xrunjdwp:transport=dt_socket,server=y,$child_suspend"
fi
}
debug_help(){
echo
echo "Allows to debug Hive by connecting to it via JDI API"
echo
echo "Usage: hive --debug[:comma-separated parameters list]"
echo
echo "Parameters:"
echo
echo "recursive=<y|n> Should child JVMs also be started in debug mode. Default: y"
echo "port=<port_number> Port on which main JVM listens for debug connection. Default: 8000"
echo "mainSuspend=<y|n> Should main JVM wait with execution for the debugger to connect. Default: y"
echo "childSuspend=<y|n> Should child JVMs wait with execution for the debugger to connect. Default: n"
echo "swapSuspend Swaps suspend options between main and child JVMs"
echo
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
windows_hive.rar (49个子文件)
beeline.cmd 2KB
beeline 1KB
hive.cmd 9KB
hive-config.sh 2KB
schematool 884B
metatool 832B
hive-config.cmd 2KB
derbyserver.cmd 2KB
init-hive-dfs.sh 3KB
ext
beeline.sh 2KB
hbaseschematool.sh 1KB
metatool.sh 1KB
rcfilecat.sh 1KB
schemaTool.sh 1KB
hplsql.sh 1KB
lineage.cmd 1KB
schemaTool.cmd 1KB
lineage.sh 1KB
metastore.sh 1KB
help.cmd 1KB
orcfiledump.sh 1KB
debug.sh 3KB
metastore.cmd 2KB
llap.sh 2KB
hiveserver2.cmd 5KB
cleardanglingscratchdir.sh 1KB
debug.cmd 3KB
hiveserver.sh 1KB
hiveburninclient.sh 1KB
hiveserver2.sh 1KB
cli.cmd 1KB
hwi.sh 2KB
hbaseimport.sh 1KB
cli.sh 1KB
help.sh 1KB
llapdump.sh 1KB
jar.cmd 1KB
version.sh 1KB
hiveserver.cmd 2KB
orcfiledump.cmd 1KB
jar.sh 1KB
util
execHiveCmd.cmd 1KB
execHiveCmd.sh 1KB
hwi.cmd 2KB
rcfilecat.cmd 1KB
llapstatus.sh 1KB
hplsql 880B
hive 8KB
hiveserver2 885B
共 49 条
- 1
资源评论
Ihavayou
- 粉丝: 1
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功