简体   繁体   English

Java 8中的Streams:在集群上使用parallelstream()的简单解决方案?

[英]Streams in Java 8: simple solution to use parallelstream() on a cluster?

parallelstream() provides seamless parallelization of operations on the stream across the cores of a single machine. parallelstream()提供跨单个机器核心的流的操作的无缝并行化。

How can I extend this logic so that parallelstream() distributes these operations to all the machines of a cluster? 如何扩展此逻辑以便parallelstream()将这些操作分发到群集的所有计算机?

Ideally: 理想的情况是:
- I create a cluster of machines, using framework ?? - 我用框架创建了一个机器集群?
- launching a myCollection.parallelstream().filter(something).collect() distributes the job to all cores of all machines of the cluster and returns the result to the machine piloting the cluster. - 启动myCollection.parallelstream().filter(something).collect()将作业分发到集群中所有机器的所有核心,并将结果返回给引导集群的机器。

Spark seems to do what you want ie distribute work over nodes. Spark似乎做你想做的事情,即在节点上分配工作。 The dsl looks similar to java 8 streams. dsl看起来类似于java 8流。 You can also have a look to akka streams. 您还可以查看akka流。 With akka streams doesn't allow you to do what you want out of the box but it offers you a toolbox to help you with a nice dsl. 使用akka流不允许您开箱即用,但它为您提供了一个工具箱,可以帮助您找到一个漂亮的dsl。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM