[ 
https://issues.apache.org/jira/browse/DRILL-6270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449615#comment-16449615
 ] 

ASF GitHub Bot commented on DRILL-6270:
---------------------------------------

Github user agozhiy commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1210#discussion_r183683315
  
    --- Diff: distribution/src/resources/runbit ---
    @@ -65,6 +65,47 @@ drill_rotate_log ()
         fi
     }
     
    +args=( $@ )
    +RBARGS=()
    +for (( i=0; i < ${#args[@]}; i++ )); do
    +  case "${args[i]}" in
    +  --debug*)
    +      DEBUG=true
    +      DEBUG_STRING=`expr "${args[i]}" : '.*:\(.*\)'`
    +      ;;
    +   *) RBARGS+=("${args[i]}");;
    +  esac
    +done
    +
    +# Enables remote debug if requested
    +# Usage: --debug:[parameter1=value,parameter2=value]
    +# Optional parameters:
    +# port=[port_number] - debug port number
    +# suspend=[y/n] - pause until the IDE connects
    +
    +if [ $DEBUG ]; then
    +  debug_params=( $(echo $DEBUG_STRING | grep -o '[^,"]*') )
    +  for param in ${debug_params[@]}; do
    +    case $param in
    +    port*)
    +      DEBUG_PORT=`expr "$param" : '.*=\(.*\)'`
    +      ;;
    +    suspend*)
    +      DEBUG_SUSPEND=`expr "$param" : '.*=\(.*\)'`
    +      ;;
    +    esac
    +  done
    +
    +  if [ -z $DEBUG_PORT ]; then
    +    DEBUG_PORT=50000
    +  fi
    +  if [ -z $DEBUG_SUSPEND ]; then
    +    DEBUG_SUSPEND='n'
    +  fi
    +
    +  JAVA_DEBUG="-Xdebug -Xnoagent 
-Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=$DEBUG_SUSPEND"
    +fi
    --- End diff --
    
    Done.


> Add debug startup option flag for drill in embedded and server mode
> -------------------------------------------------------------------
>
>                 Key: DRILL-6270
>                 URL: https://issues.apache.org/jira/browse/DRILL-6270
>             Project: Apache Drill
>          Issue Type: Task
>            Reporter: Volodymyr Tkach
>            Assignee: Anton Gozhiy
>            Priority: Major
>             Fix For: 1.14.0
>
>
> Add possibility to run sqlline.sh and drillbit.sh scripts with --<debug flag> 
> with standard java remote debug options with the ability to override port.
> It was decided to make a general flag (--jvm) to pass JVM options to the 
> script to avoid hard coding the options that may change in future.
> Usage examples:
> {noformat}
> bin/drill-embedded --jvm "-Xdebug -Xnoagent 
> -Xrunjdwp:transport=dt_socket,address=50000,server=y,suspend=n"
> bin/sqlline -u "jdbc:drill:zk=zkaddr:port" --jvm "-Xdebug -Xnoagent 
> -Xrunjdwp:transport=dt_socket,address=50000,server=y,suspend=n"
> sqlline.bat -u "jdbc:drill:zk=local" --jvm "-Xdebug -Xnoagent 
> -Xrunjdwp:transport=dt_socket,address=50000,server=y,suspend=n"
> {noformat}
> The --jvm flag is not needed for drillbit startup, you can set the jvm 
> properties directly after the start command:
> {noformat}
> bin/drillbit.sh start -Xdebug -Xnoagent 
> -Xrunjdwp:transport=dt_socket,address=50000,server=y,suspend=n
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to