简体   繁体   English

Java分布式计算平台

[英]Distributed computing platform in Java

I was asked to make a platform to download tweets from the Twitter streaming API. 我被要求建立一个平台,以从Twitter流API下载推文。 The basic idea is to have a controller to generate tasks with information about what do download (keywords) and how to serialize data. 基本思想是让控制器生成任务,其中包含有关下载内容(关键字)以及如何序列化数据的信息。 This tasks are sent to remote servers (same o different network) to execute the task and periodically save tweets in a DB. 该任务被发送到远程服务器(与其他网络相同)以执行任务并定期将推文保存在数据库中。 What I need is this: 我需要的是:

  • Controller: Must have a connection with the Fetchers to send tasks to them. 控制器:必须与Fetcher建立连接才能向其发送任务。 Must validate all fetchers connections. 必须验证所有提取程序连接。
  • Fetcher: Should retrieve tweets from Twitter streaming API based on task keyword. 提取程序:应基于任务关键字从Twitter流API检索推文。 Only one task per fetcher. 每个提取程序仅执行一项任务。 No need to register it manually. 无需手动注册。 Just execute it and run received tasks. 只需执行它并运行收到的任务即可。
  • DB: Must store tweets' JSON periodically. DB:必须定期存储tweets的JSON。 As there would be a lot of fetcher I need something to avoid a bottleneck. 由于会有很多提取程序,因此我需要一些避免瓶颈的方法。

Having said this, what I'm looking for is a good idea on how to implement this. 说了这么多,我要找的是关于如何实现这一点的好主意。 Currently I'm using SSLSockets for the validation process. 目前,我在验证过程中使用SSLSockets。 After this, I close the socket and I use RMI to publish fetchers and store Registries in the server (Controller). 之后,我关闭套接字,并使用RMI发布访存程序并将注册表存储在服务器(控制器)中。 It's working... more or less... but I'm not sure if is a good idea to do it this way. 它正在或多或少地起作用...但是我不确定这样做是否是个好主意。

Do you have any idea about how to implement distributed computing platform? 您对如何实现分布式计算平台有任何想法吗? What should I use? 我应该使用什么?

Thank you. 谢谢。

As far as I know RMI only enables you to execute code that already exists on the fetchers side. 据我所知,RMI仅使您能够执行提取程序端已经存在的代码。 But it sounds like you want to send code to the Fetcher to be executet. 但是听起来您想将代码发送到Fetcher以执行。

In that case I would consider writing an own ClassLoader and send class bytecode to the fetcher which is then loaded and executed. 在那种情况下,我会考虑编写自己的ClassLoader并将类字节码发送到fetcher,然后将其加载并执行。

As a protocoll I would recommend HTTP, there are relativly stable implementations that also support TLS and SSL around and it removes a lot of Socket related pain from you. 作为一种协议,我建议使用HTTP,相对稳定的实现也支持TLS和SSL,从而减轻了许多与套接字相关的麻烦。

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

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