永发信息网

storm整合kafka需要哪些包

答案:2  悬赏:20  手机版
解决时间 2021-02-05 20:41
storm整合kafka需要哪些包
最佳答案
答:这个是scala的编译库喝运行时库(kafka是用sbt管理依赖的),所以建议你使用sbt,会自动下载所有依赖
全部回答
public partitionmanager(dynamicpartitionconnections connections, string topologyinstanceid, zkstate state, map stormconf, spoutconfig spoutconfig, partition id) { _partition = id; _connections = connections; _spoutconfig = spoutconfig; _topologyinstanceid = topologyinstanceid; _consumer = connections.register(id.host, id.partition); //注册partition到connections,并生成simpleconsumer _state = state; _stormconf = stormconf; string jsontopologyid = null; long jsonoffset = null; string path = committedpath(); try { map json = _state.readjson(path); log.info("read partition information from: " + path + " --> " + json ); if (json != null) { jsontopologyid = (string) ((map) json.get("topology")).get("id"); jsonoffset = (long) json.get("offset"); // 从zk中读出commited offset } } catch (throwable e) { log.warn("error reading and/or parsing at zknode: " + path, e); } if (jsontopologyid == null || jsonoffset == null) { // zk中没有记录,那么根据spoutconfig.startoffsettime设置offset,earliest或latest _committedto = kafkautils.getoffset(_consumer, spoutconfig.topic, id.partition, spoutconfig); log.info("no partition information found, using configuration to determine offset"); } else if (!topologyinstanceid.equals(jsontopologyid) && spoutconfig.forcefromstart) { _committedto = kafkautils.getoffset(_consumer, spoutconfig.topic, id.partition, spoutconfig.startoffsettime); log.info("topology change detected and reset from start forced, using configuration to determine offset"); } else { _committedto = jsonoffset; } _emittedtooffset = _committedto; // 初始化时,中间状态都是一致的 }
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
日日顺取件柜如果快递存放时间超过24小时交费
坐郑州到杭州的2278次列车,到杭州哪个火车站
苏州规划设计研究院股份有限公司地址在什么地
西塘旅游美食攻略
我今天上班路上不小心踩到屎了,同事都嘲笑我
七夕在家做什么菜好呢!!
直喻的意思是什么啊?知道的请说下!
支付宝账号是以前的手机号现在换了手机可怎么
我女朋友喜欢我叫她亲热点,我应该怎么叫呢?
第一家猪肉烧烤店地址在什么地方,想过去办事
Maybe I will be as tall as Yao Ming.
茂名市保瑞奇瑞地址有知道的么?有点事想过去
感冒好了,但声音还是很沙哑、有什么好的方法
手擘,大腿,耳垠一吃鱼,鸡,鸭就痒,怎么办
江山广告策划公司地址在什么地方,想过去办事
推荐资讯
下列说法错误的是A.分子间存在着引力和斥力B.
台州医院停车场(出口)地址在什么地方,想过去
莒南六小校长吕南照片
一万三的工资,谁知道要交多少钱的税。帮忙算
excavation of...句子语法结构分析
2.73 + 0.89 + 1.27
哈密瓜里面的籽能吃吗 哈密瓜的籽吃了有什么
顺发超市在什么地方啊,我要过去处理事情
qq密码是123456789a的什麼号码
藉稿的意思是什么啊?知道的请说下!
嵌 字是不是多音字怎么读读kan的话,新华
make kites是什么意思为什么kite 前面不用the
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?