【问题标题】:Apache Storm calling function from python boltApache Storm 从 python bolt 调用函数
【发布时间】:2016-11-21 17:15:04
【问题描述】:

我有一个简单的风暴螺栓,它只需要从另一个 python 模块调用一个函数。一切正常,直到我调用一个在函数内部有打印语句的方法。

所以我的螺栓:

import storm
from pipeline import module as m

class ExampleBolt(storm.BasicBolt): 

    def initialize(self, conf, context):
        self._conf = conf;
        self._context = context;
        storm.logInfo("ExampleBolt instance starting ...")

    def process(self, tuple):
        id, text = tuple.values
        result = m.dummy_funct(text)        
        storm.emit([result])         


ExampleBolt().run()

方法:

def dummy_funct(text):
    print "log info"
    return text

bolt 调用该方法一次,然后在输出时挂起。使用 Apache Storm 0.9.3

【问题讨论】:

    标签: python apache-storm


    【解决方案1】:

    检查是否从第二次开始只执行进程块。
    不是整个程序都在执行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多