Examples of EchoRequestProto


Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

    // Test ping method
    EmptyRequestProto emptyRequest = EmptyRequestProto.newBuilder().build();
    client.ping(null, emptyRequest);
   
    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder()
        .setMessage("hello").build();
    EchoResponseProto echoResponse = client.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");
   
    // Test error method - error should be thrown as RemoteException
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

    // Test ping method
    EmptyRequestProto emptyRequest = EmptyRequestProto.newBuilder().build();
    client.ping2(null, emptyRequest);
   
    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder()
        .setMessage("hello").build();
    EchoResponseProto echoResponse = client.echo2(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");
   
    // Ensure RPC metrics are updated
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

 
  @Test(timeout=6000)
  public void testExtraLongRpc() throws Exception {
    TestRpcService2 client = getClient2();
    final String shortString = StringUtils.repeat("X", 4);
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder()
        .setMessage(shortString).build();
    // short message goes through
    EchoResponseProto echoResponse = client.echo2(null, echoRequest);
    Assert.assertEquals(shortString, echoResponse.getMessage());
   
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

    if (opts.rpcEngine == ProtobufRpcEngine.class) {
      final TestRpcService proxy = RPC.getProxy(TestRpcService.class, 0, addr, conf);
      return new RpcServiceWrapper() {
        @Override
        public String doEcho(String msg) throws Exception {
          EchoRequestProto req = EchoRequestProto.newBuilder()
            .setMessage(msg)
            .build();
          EchoResponseProto responseProto = proxy.echo(null, req);
          return responseProto.getMessage();
        }
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

    if (opts.rpcEngine == ProtobufRpcEngine.class) {
      final TestRpcService proxy = RPC.getProxy(TestRpcService.class, 0, addr, conf);
      return new RpcServiceWrapper() {
        @Override
        public String doEcho(String msg) throws Exception {
          EchoRequestProto req = EchoRequestProto.newBuilder()
            .setMessage(msg)
            .build();
          EchoResponseProto responseProto = proxy.echo(null, req);
          return responseProto.getMessage();
        }
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

    // Test ping method
    EmptyRequestProto emptyRequest = EmptyRequestProto.newBuilder().build();
    client.ping(null, emptyRequest);
   
    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder()
        .setMessage("hello").build();
    EchoResponseProto echoResponse = client.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");
   
    // Test error method - error should be thrown as RemoteException
View Full Code Here

Examples of org.apache.hadoop.ipc.protobuf.TestProtos.EchoRequestProto

    // Test ping method
    EmptyRequestProto emptyRequest = EmptyRequestProto.newBuilder().build();
    client.ping2(null, emptyRequest);
   
    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder()
        .setMessage("hello").build();
    EchoResponseProto echoResponse = client.echo2(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");
   
    // Ensure RPC metrics are updated
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.