You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by clockfly <gi...@git.apache.org> on 2014/05/21 04:20:09 UTC

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

GitHub user clockfly opened a pull request:

    https://github.com/apache/incubator-storm/pull/120

    STORM-188: Allow user to specifiy full configuration path when running storm command

    We can use system config "storm.conf.file" to specify a custom config file.
    
    Before this patch, we will only try to lookup this file on jvm classpath.
    
    This patch will give us the ability to specify full/relative filesystem path as configuration file path, thus will give us more flexibility, while we still are able to look it up on jvm classpath.
    
    Now we are able to submit storm topology like this: 
    
    ```bash
    storm jar job.jar --config /tmp/dynamic-configuration-path.yaml
    ```
    
    We don't need to add /tmp into our classpath(also inappropriate).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/clockfly/incubator-storm storm-188-storm-config-support-localfs-path

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-storm/pull/120.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #120
    
----
commit 0512fb461504d31f3011417e9ac66bc7b4a8f8e1
Author: Sean Zhong <cl...@gmail.com>
Date:   2014-05-21T02:03:33Z

    STORM-188: when looking up storm.yaml, should also try to search file system path if we cannot find it on classpath

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
Github user d2r commented on the pull request:

    https://github.com/apache/incubator-storm/pull/120#issuecomment-48665060
  
    Changed my comments to the diff instead of the commit.  Sorry about that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
Github user d2r commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/120#discussion_r14793685
  
    --- 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");
    +      }
    +    }
    --- End diff --
    
    It does not appear getInt(Object, Integer) is being used anywhere else. This should probably be part of a separate pull request.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by clockfly <gi...@git.apache.org>.
Github user clockfly commented on the pull request:

    https://github.com/apache/incubator-storm/pull/120#issuecomment-54571868
  
    Sure, I will take care of it.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
Github user d2r commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/120#discussion_r14793676
  
    --- Diff: storm-core/src/jvm/backtype/storm/utils/Utils.java ---
    @@ -19,12 +19,15 @@
     
     import java.io.ByteArrayInputStream;
     import java.io.ByteArrayOutputStream;
    +import java.io.File;
    +import java.io.FileInputStream;
     import java.io.FileOutputStream;
     import java.io.IOException;
     import java.io.InputStream;
     import java.io.InputStreamReader;
     import java.io.ObjectInputStream;
     import java.io.ObjectOutputStream;
    +import java.io.PrintStream;
    --- End diff --
    
    Unused?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
Github user d2r commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/120#discussion_r14793678
  
    --- Diff: storm-core/src/jvm/backtype/storm/utils/Utils.java ---
    @@ -37,6 +40,7 @@
     import java.util.Iterator;
     import java.util.List;
     import java.util.Map;
    +import java.util.Scanner;
    --- End diff --
    
    Unused?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
Github user d2r commented on the pull request:

    https://github.com/apache/incubator-storm/pull/120#issuecomment-52250120
  
    @clockfly Any chance to look at the comments?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-storm pull request: STORM-188: Allow user to specifiy fu...

Posted by d2r <gi...@git.apache.org>.
Github user d2r commented on the pull request:

    https://github.com/apache/incubator-storm/pull/120#issuecomment-54550440
  
    @clockfly Could you upmerge also?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---