storm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d2r <...@git.apache.org>
Subject [GitHub] incubator-storm pull request: [STORM-380] Kafka spout: throw Runti...
Date Thu, 24 Jul 2014 21:50:03 GMT
Github user d2r commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/170#discussion_r15375343
  
    --- Diff: external/storm-kafka/src/jvm/storm/kafka/DynamicBrokersReader.java ---
    @@ -116,6 +116,9 @@ private int getLeaderFor(long partition) {
                 byte[] hostPortData = _curator.getData().forPath(topicBrokersPath + "/" +
partition + "/state");
                 Map<Object, Object> value = (Map<Object, Object>) JSONValue.parse(new
String(hostPortData, "UTF-8"));
                 Integer leader = ((Number) value.get("leader")).intValue();
    +            if (leader == -1) {
    +                throw new RuntimeException("No leader found for partition " + partition);
    +            }
    --- End diff --
    
    It would be nice to add a catch for this so that we do not throw a doubly-wrapped RuntimeException.
    ...
    ```Java
    } catch (RuntimeException e) {
        throw e;
    } catch (Exception e) {
    ```
    ...


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

Mime
View raw message