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

ASF GitHub Bot commented on TWILL-138:
--------------------------------------

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

    https://github.com/apache/twill/pull/14#discussion_r83117233
  
    --- Diff: 
twill-yarn/src/main/java/org/apache/twill/internal/appmaster/ApplicationMasterService.java
 ---
    @@ -951,4 +958,34 @@ public void run() {
           }
         };
       }
    +
    +  /**
    +   * Attempt to change the log level from a runnable or all runnables.
    +   *
    +   * @return {@code true} if the message requests changing log levels and 
{@code false} otherwise.
    +   */
    +  private boolean handleLogLevelChange(final Message message, final 
Runnable completion) {
    +    Message.Scope scope = message.getScope();
    +    if (message.getType() != Message.Type.SYSTEM ||
    +      (scope != Message.Scope.RUNNABLE && scope != 
Message.Scope.ALL_RUNNABLE)) {
    +      return false;
    +    }
    +
    +    Command command = message.getCommand();
    +    if (!command.getCommand().equals(SystemMessages.LOG_LEVEL)) {
    +      return false;
    +    }
    +
    +    if (scope == Message.Scope.ALL_RUNNABLE) {
    +      runningContainers.sendToAll(message, completion);
    +    } else {
    +      final String runnableName = message.getRunnableName();
    +      if (runnableName == null || runnableName.isEmpty() || 
!twillSpec.getRunnables().containsKey(runnableName)) {
    --- End diff --
    
    No need to check if `runnableName` is empty.


> Runtime change of Application runnable log level
> ------------------------------------------------
>
>                 Key: TWILL-138
>                 URL: https://issues.apache.org/jira/browse/TWILL-138
>             Project: Apache Twill
>          Issue Type: New Feature
>          Components: core
>            Reporter: Henry Saputra
>
> With TWILL-24 is supported for setting log level when starting the Twill 
> application, next enhancement is to able to send command to update the 
> aggregate log level for a particular runnable in a Twill application.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to