rpc

Hadoop 源代码分析(六)RPC-Client

半城伤御伤魂 提交于 2019-12-09 12:13:06
既然是RPC,自然就有客户端和服务器,当然,org.apache.hadoop.rpc 也就有了类Client 和类Server。在这里我们来仔细考 察org.apache.hadoop.rpc.Client。下面的图包含了org.apache.hadoop.rpc.Client 中的关键类和关键方法。 由于Client 可能和多个Server 通信,典型的一次HDFS 读,需要和NameNode 打交道,也需要和某个/某些DataNode 通信。这 就意味着某一个Client 需要维护多个连接。同时,为了减少不必要的连接,现在Client 的做法是拿ConnectionId(图中最右 侧)来做为Connection 的ID。ConnectionId 包括一个InetSocketAddress(IP 地址+端口号或主机名+端口号)对象和一个用 户信息对象。这就是说,同一个用户到同一个InetSocketAddress 的通信将共享同一个连接。 连接被封装在类Client.Connection 中,所有的RPC 调用,都是通过Connection,进行通信。一个RPC 调用,自然有输入参数, 输出参数和可能的异常,同时,为了区分在同一个Connection 上的不同调用,每个调用都有唯一的id。调用是否结束也需要 一个标记,所有的这些都体现在对象Client.Call 中

Linux重要的服务讲述(1)

喜你入骨 提交于 2019-12-09 11:42:23
NFS 概述 NFS(Network File System)即网络文件系统,它允许网络中的计算机之间通过TCP/IP网络共享资源。在NFS的应用中,本地NFS的客户端应用可以透明地读写位于远端NFS服务器上的文件,就像访问本地文件一样。 最早由sun公司开发,是类unix系统间实现磁盘共享的一种方法 工作原理 如上图,当我们在NFS服务器设置好一个共享目录/data/share后,其他的有权限访问NFS服务器的NFS客户端就可以讲这个目录挂载到自己的本地,并且能看到服务端/data/share下的所有数据,NFS是通过网络来进行Server端和Client端之间的数据传输,既然走网络,双方肯定都要有端口,哪NFS Server怎么知道使用哪个端口来进行数据传输,NFS其实会随机选择端口来进行数据传输,NFS服务器是通过远程过程调用RPC(Remote Procedure Call)协议来实现的,所以,RPC管理服务端的NFS端口分配,客户端要传数据,那么客户端的RPC会先跟服务端的RPC去要服务器的端口,要到端口后,再建立连接,然后传输数据 RPC(Remote Procedure Call)——远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。RPC协议假定某些传输协议的存在,如TCP或UDP,为通信程序之间携带信息数据

Forging a stack trace in Java

梦想与她 提交于 2019-12-09 05:59:35
问题 When you use RMI in Java the remote stack trace of an exception will be prepended when you receive it, somewhat like this: ERROR Client received error when doing stuff: myapp.FooBarException: bla at server.myMethod() at rmi.callHandler() // and now, on the next line comes the client at rmi.sendCall(); at client.doServerMethod() at Thread.run() How is that kind of stacktrace "forgery" done? What do I want it for (apart from just being iterested)? Well, it would help me if I could do this:

Linux重要的服务讲述(1)

二次信任 提交于 2019-12-08 22:26:48
NFS 概述 NFS(Network File System)即网络文件系统,它允许网络中的计算机之间通过TCP/IP网络共享资源。在NFS的应用中,本地NFS的客户端应用可以透明地读写位于远端NFS服务器上的文件,就像访问本地文件一样。 最早由sun公司开发,是类unix系统间实现磁盘共享的一种方法 工作原理 如上图,当我们在NFS服务器设置好一个共享目录/data/share后,其他的有权限访问NFS服务器的NFS客户端就可以讲这个目录挂载到自己的本地,并且能看到服务端/data/share下的所有数据,NFS是通过网络来进行Server端和Client端之间的数据传输,既然走网络,双方肯定都要有端口,哪NFS Server怎么知道使用哪个端口来进行数据传输,NFS其实会随机选择端口来进行数据传输,NFS服务器是通过远程过程调用RPC(Remote Procedure Call)协议来实现的,所以,RPC管理服务端的NFS端口分配,客户端要传数据,那么客户端的RPC会先跟服务端的RPC去要服务器的端口,要到端口后,再建立连接,然后传输数据 RPC(Remote Procedure Call)——远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。RPC协议假定某些传输协议的存在,如TCP或UDP,为通信程序之间携带信息数据

What is the point of LRPC? Why would anyone want to make Remote Procedure Calls to the same machine?

情到浓时终转凉″ 提交于 2019-12-08 17:41:45
问题 From what I understand about RPC (Remote Procedure Calls), is that they provide a way to send function calls, invocations, etc to remote machines. The obvious advantage of this is that you can have a single program that runs on a cluster of machines and can handle more requests, more data, on so on. But I'm puzzled by LRPC - Lightweight RPC. Apparently this stuff exists to speed up RPC on the same machine. As written in the paper I linked to: Lightweight Remote Procedure Call (LRPC) is a

“The RPC server is unavailable” using WMI query

最后都变了- 提交于 2019-12-08 15:15:27
问题 I have a workgroup of web servers running Server 2008 R2 in which I'm trying to manage a script that checks the disk space of all of them. I had set this up a few months ago when the servers were being set up and I believe it was working fine. Now I go and check and it's giving an error saying "The RPC server is unavailable". The script is a C# ASP.NET page, though I've tried comparable calls in PowerShell and it gives the same error. The script works fine to access the information for the

GWT - split client and server to different machines

梦想与她 提交于 2019-12-08 10:48:42
问题 Our lab has a single machine that is open to http connections from outside. However, this machine is quite weak (little memory, slow CPU). We have other machines that are much stronger, but they are behind a firewall and cannot be accessed from outside the lab. I am writing a GWT app whose server is very demanding. Is it possible to install the server on a strong computer, and the client on the weak compuer, and have them connect using RPC? I assume it requires some changes in the web.xml

GWT RPC server side safe deserialization to check field size

会有一股神秘感。 提交于 2019-12-08 07:37:20
问题 Suppose I send objects of the following type from GWT client to server through RPC. The objects get stored to a database. public class MyData2Server implements Serializable { private String myDataStr; public String getMyDataStr() { return myDataStr; } public void setMyDataStr(String newVal) { myDataStr = newVal; } } On the client side, I constrain the field myDataStr to be say 20 character max. I have been reading on web-application security. If I learned something it is client data should

How to properly upgrade AIDL interfaces in Android?

不打扰是莪最后的温柔 提交于 2019-12-08 04:37:47
问题 I have two apps: One is called my-app.apk , the other my-service.apk . The service app just defines a single Android Service, which can be bound by the primary app to execute some methods. This is done using Androids AIDL interface, and it works great - so far. Now I want to change the interface of the service, and I am wondering what I have to watch out for. I changed the file IRemote.aidl of my-service.apk to the following: package com.example.myservice; interface IRemote { void printHello(

Which RPC Library is best and Official for Openerp?

人盡茶涼 提交于 2019-12-08 03:59:54
问题 I found some RPC Library (Python) for driving Odoo/OpenERP. openerplib oerplib erppeek xmlrpclib odoorpc Please let me know, which one is Best/Good/Official? Thanks in advance 回答1: openerplib is a PHP library, probably not what you want if you're planning to use Pyhton. xmlrpclib is Python standard library for XML-RPC. You can perfectly work with it, but it won't be the most pleasant library to work with. See the official docs for more details on it. The other libraries are wrappers around