首页 \ 问答 \ 什么是“并行”的“任务”(What is the “task” in Storm parallelism)

什么是“并行”的“任务”(What is the “task” in Storm parallelism)

我正在尝试学习叽叽t witter的风暴,遵循伟大的文章“ 了解风暴拓扑的并行性 ”

但是,我对“任务”的概念有些困惑。 任务是组件的运行实例(spout还是螺栓)? 执行者有多个任务实际上是说执行者多次执行相同的组件,我是否正确?

此外,在一般的并行性意义上,Storm将为一个喷口或螺栓生成一个专用的线程(执行器),但是由具有多个任务的执行器(线程)对并行性的贡献是什么? 我认为在一个线程中有多个任务,因为一个线程顺序执行,只能使线程成为一种“缓存”资源,避免为下一个任务运行产生新的线程。 我对么?

我可以在花更多的时间调查之后,自己清理这些混乱,但是你知道我们都喜欢stackoverflow ;-)

提前致谢。


I'm trying to learn twitter storm by following the great article "Understanding the parallelism of a Storm topology"

However I'm a bit confused by the concept of "task". Is a task an running instance of the component(spout or bolt) ? A executor having multiple tasks actually is saying the same component is executed for multiple times by the executor, am I correct ?

Moreover in a general parallelism sense, Storm will spawn a dedicated thread(executor) for a spout or bolt, but what is contributed to the parallelism by an executor(thread) having multiple tasks ? I think having multiple tasks in a thread, since a thread executes sequentially, only make the thread a kind of "cached" resource, which avoids spawning new thread for next task run. Am I correct?

I may clear those confusion by myself after taking more time to investigate, but you know, we both love stackoverflow ;-)

Thanks in advance.


原文:https://stackoverflow.com/questions/17257448
更新时间:2023-07-17 08:07

最满意答案

您只需将文本复制并粘贴到.txt文件中即可。

然后打电话:

library(tidyverse)
a <- readLines("test.txt") %>%
  # Convert to df
  as.data.frame(stringsAsFactors = FALSE) %>%
  # Filter empty rows
  filter(nchar(.) != 0)

科林


You can simply copy and paste your text in a .txt file.

Then call :

library(tidyverse)
a <- readLines("test.txt") %>%
  # Convert to df
  as.data.frame(stringsAsFactors = FALSE) %>%
  # Filter empty rows
  filter(nchar(.) != 0)

Colin

相关问答

更多
  • 您只需将文本复制并粘贴到.txt文件中即可。 然后打电话: library(tidyverse) a <- readLines("test.txt") %>% # Convert to df as.data.frame(stringsAsFactors = FALSE) %>% # Filter empty rows filter(nchar(.) != 0) 科林 You can simply copy and paste your text in a .txt file. Then c ...
  • 您可以将自动检测与BigQuery加载API一起使用,即使用bq cli工具的示例如下所示: ~$ cat /tmp/x.json {"name":"xyz","mobile":"xxx","location":"abc"} {"name":"xyz","mobile":"xxx","age":"22"} ~$ bq load --autodetect --source_format=NEWLINE_DELIMITED_JSON tmp.x /tmp/x.json Upload complete. ~$ ...
  • Pig是为处理模式较少的数据集而构建的......在hive中我们强制执行一个存储在derby中的模式,或者可以配置为存储在mysql中。现在还不清楚你在寻找什么! Pig is built to processes schema less data sets..whereas in hive we enforce a schema which is stored in derby or can be configured to store in mysql..Now it is not clear wha ...
  • 预处理 函数get_names()打开文件,检查分割行的最大长度。 然后我读取第一行并从最大长度添加缺失值。 第一行的最后一个值是) ,所以我用firstline[:-1]删除它,然后我按+1 rng = range(1, m - lenfirstline + 2)添加范围缺失列。 +2是因为范围从值1开始。 然后你可以使用函数read_csv ,skipp第一行和名称使用get_names()输出。 import pandas as pd import csv #preprocessing def ge ...
  • 我说如果你需要运行SQL查询来计算min / max / avg之类的东西,或者根据值执行排序,限制或连接,那么你应该创建100+列。 这就是我要做的。 您没有说明您使用的是哪个品牌的数据库,但大多数应该在表中支持100多列,而没有低效率的风险。 请不要使用Entity-Attribute-Value反模式 - 一些人会建议的键/值设计。 将任意键/值对的任意集合插入到这样的设计中是很好的和容易的,但是对于每个属性具有一列的传统表格中的任何简单查询,使用EAV设计变得极其困难且效率低下。 您还失去了使用SQ ...
  • gregexpr是基本的R regex函数,它返回关于字符串中多个匹配位置的信息。 要提取它们,您可以使用regmatches ,但由于gregexpr返回每个匹配的第一个字符的索引,因此您可以简单搜索非空格字符组\\S+ ,选择第三个索引,然后减去一个以获得数字前面的字符: sapply(gregexpr('\\S+', x), `[`, 3) - 1 #> [1] 30 34 31 gregexpr is the base R regex function that returns informati ...
  • 传统的EDI不是非结构化的。 EDI通常遵循特定定义数据结构的某种标准(X12,EDIFACT,TRADACOMS等)。 XML,CSV和分隔文件也是结构化的。 他们有一个定义的字段分隔符和一个记录终止符。 非结构化数据的一个示例是具有专有格式的多个数据的Excel文件。 没有记录标识符,数据解析器将无法理解数据是什么。 它会以数据/文本的形式出现,但不会有映射器需要翻译/集成的任何上下文。 Word文档或PDF也可以被视为“非结构化”。 Traditional EDI is NOT unstructure ...
  • 您计划的模式可以满足您的需求。 SELECT可以是: SELECT * FROM user U WHERE EXISTS ( SELECT 1 FROM user_has_metadata UHM WHERE U.id=UHM.user_id AND UHM.value = "Fr" ) AND EXISTS ( SELECT 1 FROM user_has_metadata UHM2 WHERE U.id=UH ...
  • 您可以在SQL Server中使用XPath来访问XML数据节点。 这是一个使用您的数据的示例。 declare @test xml set @test = '1ProductDesc' SELECT @test.value('(/product/productID/node())[1]', 'nvarchar(max)') as productID, @test.value('(/pr ...
  • Cassandra充其量只能搜索半结构化数据。 这也是通过使用群集密钥和二级索引。 群集密钥绝对是搜索半结构化数据的有效方式。 在不指定分区键的情况下搜索二级索引数据效率不高。 有一些解决方案可以帮助DSE Search(Solr with Cassandr)和Stargate。 如果其中一列是非结构化文本,这两种解决方案也可能有所帮助。 否则,使用Cassandra进行非结构化数据并不是一个好主意,因为没有密钥可能无法搜索。 Cassandra can at best be searchable for ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)