You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by ecararus <gi...@git.apache.org> on 2017/07/19 21:54:23 UTC

[GitHub] storm pull request #2228: STORM-2646 NimbusClient Class cast exception when ...

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

    https://github.com/apache/storm/pull/2228#discussion_r128377962
  
    --- Diff: storm-client/src/jvm/org/apache/storm/utils/NimbusClient.java ---
    @@ -109,12 +109,13 @@ public static NimbusClient getConfiguredClientAs(Map<String, Object> conf, Strin
             }
     
             List<String> seeds;
    -        if(conf.containsKey(Config.NIMBUS_HOST)) {
    +        if (conf.containsKey(Config.NIMBUS_HOST)) {
                 LOG.warn("Using deprecated config {} for backward compatibility. Please update your storm.yaml so it only has config {}",
    -                     Config.NIMBUS_HOST, Config.NIMBUS_SEEDS);
    +                    Config.NIMBUS_HOST, Config.NIMBUS_SEEDS);
                 seeds = Lists.newArrayList(conf.get(Config.NIMBUS_HOST).toString());
             } else {
    -            seeds = (List<String>) conf.get(Config.NIMBUS_SEEDS);
    +            Object nimbusSeeds = conf.get(Config.NIMBUS_SEEDS);
    +            seeds = nimbusSeeds instanceof String[] ? Lists.newArrayList((String[]) nimbusSeeds) : Lists.newArrayList(nimbusSeeds.toString());
    --- End diff --
    
    @d2r I don't think that ```conf.get(Config.NIMBUS_SEEDS)``` will return List<String> as per contract the values in conf is Object. in order to avoid any issue probably is better to have a config validation as @revans2 suggested. 


---
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.
---