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

ASF GitHub Bot commented on STORM-188:
--------------------------------------

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

    https://github.com/apache/incubator-storm/pull/120#discussion_r14793687
  
    --- Diff: storm-core/src/jvm/backtype/storm/utils/Utils.java ---
    @@ -301,15 +332,39 @@ public static ComponentCommon 
getComponentCommon(StormTopology topology, String
         }
         
         public static Integer getInt(Object o) {
    -        if(o instanceof Long) {
    -            return ((Long) o ).intValue();
    -        } else if (o instanceof Integer) {
    -            return (Integer) o;
    -        } else if (o instanceof Short) {
    -            return ((Short) o).intValue();
    -        } else {
    -            throw new IllegalArgumentException("Don't know how to convert 
" + o + " + to int");
    -        }
    +      Integer result = getInt(o, null);
    +      if (null == result) {
    +        throw new IllegalArgumentException("Don't know how to convert null 
+ to int");
    +      }
    +      return result;
    +    }
    +    
    +    public static Integer getInt(Object o, Integer defaultValue) {
    +      if (null == o) {
    +        return defaultValue;
    +      }
    +      
    +      if(o instanceof Long) {
    +          return ((Long) o ).intValue();
    +      } else if (o instanceof Integer) {
    +          return (Integer) o;
    +      } else if (o instanceof Short) {
    +          return ((Short) o).intValue();
    +      } else {
    +          throw new IllegalArgumentException("Don't know how to convert " 
+ o + " + to int");
    +      }
    +    }
    +
    +    public static boolean getBoolean(Object o, boolean defaultValue) {
    +      if (null == o) {
    +        return defaultValue;
    +      }
    +      
    +      if(o instanceof Boolean) {
    +          return (Boolean) o;
    +      } else {
    +          throw new IllegalArgumentException("Don't know how to convert " 
+ o + " + to boolean");
    +      }
         }
    --- End diff --
    
    getBoolean seems to be an addition unrelated to the changes for this JIRA. 
It should be in its own pull request.


> Allow user to specifiy full configuration path when running storm command
> -------------------------------------------------------------------------
>
>                 Key: STORM-188
>                 URL: https://issues.apache.org/jira/browse/STORM-188
>             Project: Apache Storm (Incubating)
>          Issue Type: Bug
>            Reporter: Sean Zhong
>            Priority: Minor
>         Attachments: search_local_path_for_config.patch, storm-188.patch
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Currently, storm will only look up configuration path in java classpath. We 
> should also allow user to specify full configuration path. This is very 
> important for a shared cluster environment, like YARN. Multiple storm cluster 
> may runs with different configuration, but share same binary folder.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to