Github user d2r commented on a diff in the pull request:
https://github.com/apache/incubator-storm/pull/84#discussion_r12686601
--- Diff: storm-core/src/jvm/backtype/storm/task/ShellBolt.java ---
@@ -204,38 +196,31 @@ private void handleFail(Map action) {
_collector.fail(failed);
}
- private void handleError(Map action) {
- String msg = (String) action.get("msg");
+ private void handleError(String msg) {
_collector.reportError(new Exception("Shell Process Exception: " +
msg));
}
- private void handleEmit(Map action) throws InterruptedException {
- String stream = (String) action.get("stream");
- if(stream==null) stream = Utils.DEFAULT_STREAM_ID;
- Long task = (Long) action.get("task");
- List<Object> tuple = (List) action.get("tuple");
+ private void handleEmit(ShellMsg shellMsg) throws InterruptedException
{
List<Tuple> anchors = new ArrayList<Tuple>();
- Object anchorObj = action.get("anchors");
- if(anchorObj!=null) {
- if(anchorObj instanceof String) {
- anchorObj = Arrays.asList(anchorObj);
- }
- for(Object o: (List) anchorObj) {
- Tuple t = _inputs.get((String) o);
+ List<String> recvAnchors = shellMsg.getAnchors();
+ if (recvAnchors != null) {
+ for (String anchor : recvAnchors) {
+ Tuple t = _inputs.get(anchor);
if (t == null) {
- throw new RuntimeException("Anchored onto " + o + "
after ack/fail");
+ throw new RuntimeException("Anchored onto " + anchor +
" after ack/fail");
}
anchors.add(t);
}
}
- if(task==null) {
- List<Integer> outtasks = _collector.emit(stream, anchors,
tuple);
- Object need_task_ids = action.get("need_task_ids");
- if (need_task_ids == null || ((Boolean)
need_task_ids).booleanValue()) {
+
+ if(shellMsg.getTask() == 0) {
--- End diff --
You are correct. I thought it was a `Long` with a capital L.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---