Hi All,
I wast trying out storm with python and was quite successful to a point.
It works fine on Python 2.6 however when running on python 3.4 I get the
below exception.
I think it has to do with json serialisation changes in 3.4. Not exactly an
expert on python but looks like the call in storm.py (found in
WordCountTopology) to
* json_encode = lambda x: json.dumps(x)*
causes the issue
* raise TypeError(repr(o) + " is not JSON serializable")*
would be greatful if someone can help with making storm.py Python 3.4
compliant.
2015-02-22T16:33:19.152+0800 b.s.t.ShellBolt [ERROR] Halting process:
ShellBolt died.
java.lang.RuntimeException: backtype.storm.multilang.NoOutputException:
Pipe to subprocess seems to be broken! No output read.
Serializer Exception:
Traceback (most recent call last):
File
"E:\Apps\apache-storm-0.9.3\local\supervisor\stormdist\TCPTopology101-1-1424593935\resources\storm.py",
line 223, in run
self.process(tup)
File "splitsentence.py", line 10, in process
storm.emit([word])
File
"E:\Apps\apache-storm-0.9.3\local\supervisor\stormdist\TCPTopology101-1-1424593935\resources\storm.py",
line 91, in emit
__emit(*args, **kwargs)
File
"E:\Apps\apache-storm-0.9.3\local\supervisor\stormdist\TCPTopology101-1-1424593935\resources\storm.py",
line 101, in __emit
emitBolt(*args, **kwargs)
File
"E:\Apps\apache-storm-0.9.3\local\supervisor\stormdist\TCPTopology101-1-1424593935\resources\storm.py",
line 116, in emitBolt
sendMsgToParent(m)
File
"E:\Apps\apache-storm-0.9.3\local\supervisor\stormdist\TCPTopology101-1-1424593935\resources\storm.py",
line 78, in sendMsgToParent
print (json_encode(msg))
File
"E:\Apps\apache-storm-0.9.3\local\supervisor\stormdist\TCPTopology101-1-1424593935\resources\storm.py",
line 29, in <lambda>
json_encode = lambda x: json.dumps(x)
File "E:\Apps\Python34\lib\json\__init__.py", line 230, in dumps
return _default_encoder.encode(obj)
File "E:\Apps\Python34\lib\json\encoder.py", line 192, in encode
chunks = self.iterencode(o, _one_shot=True)
File "E:\Apps\Python34\lib\json\encoder.py", line 250, in iterencode
return _iterencode(o, 0)
File "E:\Apps\Python34\lib\json\encoder.py", line 173, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <map object at 0x0000000002BCD7F0> is not JSON serializable
Thanks,
Jubin
--
Think big thoughts but relish small pleasures.