首页 \ 问答 \ Storm拓扑中的可选流(Optional stream in Storm topology)

Storm拓扑中的可选流(Optional stream in Storm topology)

我们有一个相当简单的风暴拓扑结构,只有一个头痛。

我们的一个螺栓可以找到它正在处理的数据是有效的,并且每个东西都正常地在流中继续,或者它可以发现它是无效但可修复的。 在这种情况下,我们需要发送它进行一些额外的处理。

我们尝试使用单独的bolt和stream将此步骤作为拓扑的一部分。

declarer.declareStream(NORMAL_STREAM, getStreamFields());
declarer.declareStream(ERROR_STREAM, getErrorStreamFields());

在execute方法的最后跟着一些类似下面的东西。

if(errorOutput != null) {
    collector.emit(ERROR_STREAM, input, errorOutput);
}
else {
    collector.emit(NORMAL_STREAM, input, output);
}

collector.ack(input);

这确实有效但是它具有破坏性的效果,导致所有不沿着这个错误路径的元组失败并且无休止地重新发送喷口。

我认为这是因为错误螺栓不能发送它没有收到的消息的acks但是acker的东西在将ack发送回spout之前等待拓扑中的所有螺栓。 至少取出错误处理螺栓会导致所有东西正确地回到喷口。

实现这样的事情的最佳方法是什么?


We have a fairly simple storm topology with one head ache.

One of our bolts can either find the data it is processing to be valid and every thing carries on down the stream as normal or it can find it to be invalid but fixable. In which case we need to send it for some additional processing.

We tried making this step part of the topology with a separate bolt and stream.

declarer.declareStream(NORMAL_STREAM, getStreamFields());
declarer.declareStream(ERROR_STREAM, getErrorStreamFields());

Followed by some thing like the following at the end of the execute method.

if(errorOutput != null) {
    collector.emit(ERROR_STREAM, input, errorOutput);
}
else {
    collector.emit(NORMAL_STREAM, input, output);
}

collector.ack(input);

This does work however it has a breaking effect of causing all of the tuples that do not go down this error path to fail and get re-sent by the spout endlessly.

I think this is because the error bolt can not send acks for messages it doesn't receive but the acker thing waits for all the bolts in a topology to ack before sending the ack back to the spout. At the very least taking out the error processing bolt causes every thing to get acked back to the spout correctly.

What is the best way to achieve some thing like this?


原文:https://stackoverflow.com/questions/28047372
更新时间:2022-10-05 14:10

最满意答案

似乎有一个错误: https//code.google.com/p/gmaps-api-issues/issues/detail?id = 5313

编辑

如果您过滤掉距离小于1米的顶点,则会出现错误。 我将在今晚稍后编写一些代码来解决这个问题并将其放在这里。

UPDATE

此错误是在Google问题跟踪器中处理的

https://issuetracker.google.com/issues/35821816

它已修复在Google Play服务 - 9.2.56中

https://developers.google.com/maps/documentation/android-api/releases#june_27_2016


There appears to be a bug open for it: https://code.google.com/p/gmaps-api-issues/issues/detail?id=5313

EDIT

It appears if you filter vertices that are closer than 1 meter to each other the the bug is resolved. I will write some code to fix this later tonight and put it here.

UPDATE

This bug was handled in Google issue tracker

https://issuetracker.google.com/issues/35821816

It was fixed in Google Play Services - 9.2.56

https://developers.google.com/maps/documentation/android-api/releases#june_27_2016

相关问答

更多
  • 这看起来像你的HTML样式表有问题style={{height: 100% , width: 100% }} 。 您可以尝试将您的地图样式替换为1000px以进行测试。 return ( } mapElement={
  • 我用谷歌搜索后解决了这个问题。 关键是在mainView中使用Container View ,并在containerView中使用以下代码初始化地图: var camera = GMSCameraPosition.cameraWithLatitude(-33.86, longitude: 151.20, zoom: 6) var mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera) ...
  • 所以我找到了问题的答案,没有在界面构建器中使用视图,所有都是以编程方式提供的。 这是解决方案: - (void)viewDidLoad {[super viewDidLoad]; mapView = [[GMSMapView alloc] initWithFrame:CGRectZero]; [mapView setFrame:CGRectMake(0, 0, 400, 400)]; ////here you will have to specify the bounds of the view thr ...
  • 这里的问题是图标最终位于导航栏后面,因为导航栏是固定的。 只需在主体上添加padding-top可以在导航栏下创建一些空白并修复问题。 The problem here is that the icons end up behind the navbar because the navbar is fixed. Simply adding padding-top to the body should create some whitespace under the navbar and fix your p ...
  • 在指纹更改时使用版本密钥库进行签名时,您必须获取单独的API密钥。 确保还使用正确的密钥安装.apk。 更新:我的意思是你确定你用正确的密钥签署你的APK? 这意味着您确定在生成APK时使用发布密钥库对其进行签名吗? 当您导出它时,您实际上是否真的选择了用于签名的密钥库? You have to obtain a separate API key when signing with the release key store as your fingerprint changes. Make sure to ...
  • 好吧,我在上面的代码片段中发现了一些小错误。 以下是详细信息。 你忘记在domConstruct之前添加“BorderContainer,ContentPane,AccordionContainer”。 以下是工作代码:
  • 更新了JSFiddle 我想你忘了将fontawesome-marker软件包添加到你的小提琴来源。 我更新了JSFiddle并且工作正常。 https://rawgit.com/nathan-muir/fontawesome-markers/master/fontawesome-markers.min.js Updated JSFiddle I think you forgot add the fontawesome-marker package to your fiddle source. I upd ...
  • 请改变你的showHide函数。 function showHide(){ if ( $("#areaall").children().last().index() == $("#areaall .review:visible").last().index()) { $('.next').hide(); } else if ($("#areaall").children().first().index() == $("#areaall .review:visible").first(). ...
  • 似乎有一个错误: https : //code.google.com/p/gmaps-api-issues/issues/detail?id = 5313 编辑 如果您过滤掉距离小于1米的顶点,则会出现错误。 我将在今晚稍后编写一些代码来解决这个问题并将其放在这里。 UPDATE 此错误是在Google问题跟踪器中处理的 https://issuetracker.google.com/issues/35821816 它已修复在Google Play服务 - 9.2.56中 https://developer ...
  • 问题应该在你的主题xml中。 尝试在“values / styles.xml”中定义“.NoActionBar”主题,例如“@ style / Theme.AppCompat.NoActionBar” 另一种方法是在AndroidManifest中定义活动的主题 The problem should be in your theme xml. Try to define the ".NoActionBar" theme in the "values/styles.xml" for example to "@ ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)