예제 #1
0
 def run(self):
     storm_conf, context = read_handshake()
     self.__current_tup = None # used for auto-anchoring
     try:
         self.initialize(storm_conf, context)
         while True:
             self.__current_tup = read_tuple()
             self.process(self.__current_tup)
             self.ack(self.__current_tup)
     except Exception as e:
         self.raise_exception(e, self.__current_tup)
예제 #2
0
 def run(self):
     global _ANCHOR_TUPLE
     storm_conf, context = read_handshake()
     tup = None
     try:
         self.initialize(storm_conf, context)
         while True:
             tup = read_tuple()
             _ANCHOR_TUPLE = tup
             self.process(tup)
             self.ack(tup)
     except Exception as e:
         self.raise_exception(e, tup)
예제 #3
0
 def run(self):
     """Main run loop for all bolts. Performs initial handshake with Storm
     and reads tuples handing them off to subclasses.  Any exceptions are
     caught and logged back to Storm prior to the Python process exits.
     Subclasses should not override this method.
     """
     storm_conf, context = read_handshake()
     tup = None
     try:
         self.initialize(storm_conf, context)
         while True:
             tup = read_tuple()
             self.process(tup)
     except Exception as e:
         self.raise_exception(e, tup)
예제 #4
0
 def run(self):
     """Main run loop for all spouts. Performs initial handshake with Storm
     and reads tuples handing them off to subclasses.  Any exceptions are
     caught and logged back to Storm prior to the Python process exits.
     Subclasses should not override this method.
     """
     storm_conf, context = read_handshake()
     try:
         self.initialize(storm_conf, context)
         while True:
             cmd = read_command()
             if cmd['command'] == 'next':
                 self.next_tuple()
             if cmd['command'] == 'ack':
                 self.ack(cmd['id'])
             if cmd['command'] == 'fail':
                 self.fail(cmd['id'])
             send_message({'command': 'sync'})
     except Exception as e:
         self.raise_exception(e)
예제 #5
0
 def run(self):
     """Main run loop for all spouts. Performs initial handshake with Storm
     and reads tuples handing them off to subclasses.  Any exceptions are
     caught and logged back to Storm prior to the Python process exits.
     Subclasses should not override this method.
     """
     storm_conf, context = read_handshake()
     try:
         self.initialize(storm_conf, context)
         while True:
             cmd = read_command()
             if cmd['command'] == 'next':
                 self.next_tuple()
             if cmd['command'] == 'ack':
                 self.ack(cmd['id'])
             if cmd['command'] == 'fail':
                 self.fail(cmd['id'])
             send_message({'command': 'sync'})
     except Exception as e:
         self.raise_exception(e)