Ejemplo n.º 1
0
        /// <summary>Create a client proxy for the specified engine.</summary>
        /// <exception cref="System.IO.IOException"/>
        private RPCCallBenchmark.RpcServiceWrapper CreateRpcClient(RPCCallBenchmark.MyOptions
                                                                   opts)
        {
            IPEndPoint addr = NetUtils.CreateSocketAddr(opts.host, opts.GetPort());

            if (opts.rpcEngine == typeof(ProtobufRpcEngine))
            {
                TestProtoBufRpc.TestRpcService proxy = RPC.GetProxy <TestProtoBufRpc.TestRpcService
                                                                     >(0, addr, conf);
                return(new _RpcServiceWrapper_394(proxy));
            }
            else
            {
                if (opts.rpcEngine == typeof(WritableRpcEngine))
                {
                    TestRPC.TestProtocol proxy = RPC.GetProxy <TestRPC.TestProtocol>(TestRPC.TestProtocol
                                                                                     .versionID, addr, conf);
                    return(new _RpcServiceWrapper_407(proxy));
                }
                else
                {
                    throw new RuntimeException("unsupported engine: " + opts.rpcEngine);
                }
            }
        }
Ejemplo n.º 2
0
        public virtual void TestNMAuditLoggerWithIP()
        {
            Configuration conf = new Configuration();

            // start the IPC server
            Org.Apache.Hadoop.Ipc.Server server = new RPC.Builder(conf).SetProtocol(typeof(TestRPC.TestProtocol
                                                                                           )).SetInstance(new TestNMAuditLogger.MyTestRPCServer(this)).SetBindAddress("0.0.0.0"
                                                                                                                                                                      ).SetPort(0).SetNumHandlers(5).SetVerbose(true).Build();
            server.Start();
            IPEndPoint addr = NetUtils.GetConnectAddress(server);

            // Make a client connection and test the audit log
            TestRPC.TestProtocol proxy = (TestRPC.TestProtocol)RPC.GetProxy <TestRPC.TestProtocol
                                                                             >(TestRPC.TestProtocol.versionID, addr, conf);
            // Start the testcase
            proxy.Ping();
            server.Stop();
        }
Ejemplo n.º 3
0
 public _RpcServiceWrapper_407(TestRPC.TestProtocol proxy)
 {
     this.proxy = proxy;
 }