知识点
相关文章
更多最近更新
更多Hadoop中的RPC实现——客户端通信组件
2019-03-28 14:01|来源: 网络
在Hadoop中为了方便集群中各个组件之间的通信,它采用了RPC,当然为了提高组件之间的通信效率以及考虑到组件自身的负载等情况,Hadoop在其内部实现了一个基于IPC模型的RPC。关于这个RPC组件的整体情况我已经介绍过了,相关阅读:http://www.linuxidc.com/search.aspx?Where=Nkey&Keyword=Hadoop 。而在本文,我将结合源代码详细地介绍它在客户端的实现。
先来看看与RPC客户端相关联的一些类吧!
1.Client类
- private Hashtable<ConnectionId, Connection> connections = new Hashtable<ConnectionId, Connection>(); //与远程服务器连接的缓存池
- private Class<? extends Writable> valueClass; //远程方法调用发回后返回值解析器
- final private int maxIdleTime; //连接的最大空闲时间
- final private int maxRetries; //Socket连接时,最大Retry次数
- private boolean tcpNoDelay; //设置TCP连接是否延迟
- private int pingInterval; //ping服务端的间隔
相关问答
更多-
取决于语言,它是否有任何内置设施来编组参数和方法和对象标识符。 C / C ++没有内置的这种支持,所以我们有例如用于定义COM接口的MIDL。 编译它将创建用于将方法调用语义转换为/从IPC / RPC消息传递的代理和存根代码。 编译高级语言可能会产生足以在运行时生成封送处理的反射元数据,因此编程语言是 IDL。 Depends on the language, whether it has any built-in facility for marshaling arguments and method ...
-
2个样品在这里 有两种不同的实现。 阅读整个线程+检查附件 2 Samples here There are two different implementations. Read the whole thread + check the attachments
-
Windows有它自己的RPC版本。 它仅在Windows盒子之间正常工作。 为了互操作性,您需要查看CORBA或WCF。 Windows has its own version of RPC. It works fine between Windows boxes only. For interoperability you need to look at CORBA or WCF.
-
获取RPC客户端的进程名称(Get Process Name for RPC Client)[2023-08-29]
要获取RPC客户端的进程名称,必须使用RpcServerInqCallAttributes查询进程ID,使用进程ID获取进程句柄的OpenProcess ,以及使用进程句柄获取完整进程名称的QueryFullProcessImageName 。 To get the process name for an RPC client, you must use RpcServerInqCallAttributes to query the process ID, OpenProcess with the proc ... -
多客户端RPC(Multi client RPC)[2021-11-30]
如果我理解正确,您希望多个客户端注册相同的过程,然后在其中调用特定的过程。 WAMP使用相同的URI进行此过程是不可能的。 对于您想要做的事情,预期的方法是使用包含客户端ID的URI,例如,如果您的过程是“com.example.calculate_load”,则客户端将注册“com.example.client_1.calculate_load”(或“com。 example.calculate_load.client_1“),您将通过过程URI寻址客户端。 多个客户端可以在相同的URI下注册相同的过程, ... -
我目前正在使用thrift( thrift4go )来实现server-> client和client-> server RPC功能。 默认情况下,thrift只执行客户端 - >服务器调用,就像net / rpc一样。 由于我还需要服务器 - >客户端通信,我做了一些研究并找到了比迪烟节 。 Bidi-thrift解释了如何连接java服务器+ java客户端以进行双向thrift通信。 什么比迪烟节俭,它的局限性。 TCP连接具有接收和输出通信线路(RC和TX)。 bidi-thrift的想法是拆分RS ...
-
按照John Bollinger最后的评论:“ (...)服务器只能通过客户端对RPC调用的响应来中继消息。”(......) “ 所以基本上不会,客户不能直接与其他客户进行沟通。 他们可以通过调用服务器来发送和询问信息,并且通过这些请求可以从一个客户端“通信”到另一个客户端。 As per John Bollinger's very helpful last comment: "(...) the server can relay messages only via its responses to RP ...
-
你有没有尝试过Flink的Hadoop-2版本? 看看下载页面 。 有一个名为flink-0.9.0-milestone-1-bin-hadoop2.tgz应该可以与Hadoop 2一起使用。 Have you tried the Hadoop-2 build of Flink? Have a look at the downloads page. There is a build called flink-0.9.0-milestone-1-bin-hadoop2.tgz that should work ...
-
假设您的用户名是hdfs ,请将&user.name=hdfs添加到您的URL。 写操作需要有效用户。 您的Java代码有效,因为它从unix环境中提取您的用户信息。 如果您在任何地方看到用户dr.who ,可能是因为您没有在请求中设置user.name 。 Assuming your user name is hdfs, add &user.name=hdfs to your URL. Write operations require a valid user. Your java code works ...
-
您可以使用socket.setTimeout()方法。 from thrift.transport.THttpClient import THttpClient socket = THttpClient(server_url) socket.setTimeout(SERVICE_TIMEOUT_IN_mS) transport = TTransport.TBufferedTransport(socket) protocol = TBinaryProtocol.TBinaryProtocol(transpor ...