def main(): global message content = "" f = open("../resource/template.html") line = f.readline() while line: content = content + line line = f.readline() f.close() options = read_args() zc = ZkClient(options.zserver, options.zport) my_topology_list = zc.get_children("/") for single_topo in my_topology_list: api = crawlUrl + "/api/v1/topology/" + single_topo + "?sys=false" read = urllib.urlopen(api).read() storm_ui_data = json.loads(read) if not re.search("walle",single_topo): continue consumer_partition = "/" + single_topo + "/partition_0" print "consumer_partition" + consumer_partition tuple = zc.get_node(consumer_partition)[0] j = json.loads(tuple) toponame = j['topology']['name'] try: zk_data = process(zc.spouts(consumer_partition, toponame),storm_ui_data) except ZkError, e: print 'Failed to access Zookeeper: %s' % str(e) return 1 except ProcessorError, e: print 'Failed to process: %s' % str(e) return 1
def main(): options = read_args() zc = ZkClient(options.zserver, options.zport) try: zk_data = process(zc.spouts(options.spoutroot, options.topology)) except ZkError, e: print 'Failed to access Zookeeper: %s' % str(e) return 1
def main(): options = read_args() zc = ZkClient(options.zserver, options.zport) try: display(process(zc.spouts(options.spoutroot, options.topology)), true_or_false_option(options.friendly)) except ZkError, e: print 'Failed to access Zookeeper: %s' % str(e) return 1
def top(): options = read_args() zc = ZkClient(options.zserver, options.zport) zc.start() try: curses.wrapper(curses_main, [zc, options]) #curses_main(None, [zc, options]) except KeyboardInterrupt: pass finally: zc.stop()
def main(): options = read_args() zc = ZkClient(options.zserver, options.zport, options.zroot) try: zk_data = process(zc.spouts(options.spoutroot, options.topology)) except ZkError as e: print 'Failed to access Zookeeper: %s' % str(e) return 1 except ProcessorError as e: print 'Failed to process: %s' % str(e) return 1 else: if options.postjson: post_json(options.postjson, zk_data) else: display(zk_data, true_or_false_option(options.friendly)) return 0
def main(): options = read_args() zc = ZkClient(options.zserver, options.zport) try: zk_data = process(zc.spouts(options.spoutroot, options.topology)) except ZkError as e: print 'Failed to access Zookeeper: %s' % str(e) return 1 except ProcessorError as e: print 'Failed to process: %s' % str(e) return 1 else: if options.postjson: post_json(options.postjson, zk_data) else: display(zk_data, true_or_false_option(options.friendly)) return 0