Java 类org.apache.hadoop.hbase.ipc.protobuf.generated.TestProtos.EmptyRequestProto 实例源码

项目:DominoHBase    文件:TestProtoBufRpc.java   
public static void testProtoBufRpc(TestRpcService client) throws Exception {  
  // 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
  try {
    client.error(null, emptyRequest);
    Assert.fail("Expected exception is not thrown");
  } catch (ServiceException e) {
  }
}
项目:ditb    文件:TestProtoBufRpc.java   
@Test
public void testProtoBufRpc() throws Exception {
  RpcClient rpcClient = RpcClientFactory.createClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
        ServerName.valueOf(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis()),
      User.getCurrent(), 0);
    TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub =
      TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel);
    // Test ping method
    TestProtos.EmptyRequestProto emptyRequest =
      TestProtos.EmptyRequestProto.newBuilder().build();
    stub.ping(null, emptyRequest);

    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("hello").build();
    EchoResponseProto echoResponse = stub.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");

    // Test error method - error should be thrown as RemoteException
    try {
      stub.error(null, emptyRequest);
      Assert.fail("Expected exception is not thrown");
    } catch (ServiceException e) {
    }
  } finally {
    rpcClient.close();
  }
}
项目:pbase    文件:TestProtoBufRpc.java   
@Test
public void testProtoBufRpc() throws Exception {
  RpcClient rpcClient = RpcClientFactory.createClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
        ServerName.valueOf(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis()),
      User.getCurrent(), 0);
    TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub =
      TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel);
    // Test ping method
    TestProtos.EmptyRequestProto emptyRequest =
      TestProtos.EmptyRequestProto.newBuilder().build();
    stub.ping(null, emptyRequest);

    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("hello").build();
    EchoResponseProto echoResponse = stub.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");

    // Test error method - error should be thrown as RemoteException
    try {
      stub.error(null, emptyRequest);
      Assert.fail("Expected exception is not thrown");
    } catch (ServiceException e) {
    }
  } finally {
    rpcClient.close();
  }
}
项目:HIndex    文件:TestProtoBufRpc.java   
@Test
public void testProtoBufRpc() throws Exception {
  RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
        ServerName.valueOf(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis()),
      User.getCurrent(), 0);
    TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub =
      TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel);
    // Test ping method
    TestProtos.EmptyRequestProto emptyRequest =
      TestProtos.EmptyRequestProto.newBuilder().build();
    stub.ping(null, emptyRequest);

    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("hello").build();
    EchoResponseProto echoResponse = stub.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");

    // Test error method - error should be thrown as RemoteException
    try {
      stub.error(null, emptyRequest);
      Assert.fail("Expected exception is not thrown");
    } catch (ServiceException e) {
    }
  } finally {
    rpcClient.stop();
  }
}
项目:PyroDB    文件:TestProtoBufRpc.java   
@Test
public void testProtoBufRpc() throws Exception {
  RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
        ServerName.valueOf(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis()),
      User.getCurrent(), 0);
    TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub =
      TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel);
    // Test ping method
    TestProtos.EmptyRequestProto emptyRequest =
      TestProtos.EmptyRequestProto.newBuilder().build();
    stub.ping(null, emptyRequest);

    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("hello").build();
    EchoResponseProto echoResponse = stub.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");

    // Test error method - error should be thrown as RemoteException
    try {
      stub.error(null, emptyRequest);
      Assert.fail("Expected exception is not thrown");
    } catch (ServiceException e) {
    }
  } finally {
    rpcClient.stop();
  }
}
项目:c5    文件:TestProtoBufRpc.java   
@Test
public void testProtoBufRpc() throws Exception {
  RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
        ServerName.valueOf(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis()),
      User.getCurrent(), 0);
    TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub =
      TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel);
    // Test ping method
    TestProtos.EmptyRequestProto emptyRequest =
      TestProtos.EmptyRequestProto.newBuilder().build();
    stub.ping(null, emptyRequest);

    // Test echo method
    EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("hello").build();
    EchoResponseProto echoResponse = stub.echo(null, echoRequest);
    Assert.assertEquals(echoResponse.getMessage(), "hello");

    // Test error method - error should be thrown as RemoteException
    try {
      stub.error(null, emptyRequest);
      Assert.fail("Expected exception is not thrown");
    } catch (ServiceException e) {
    }
  } finally {
    rpcClient.stop();
  }
}
项目:ditb    文件:TestRpcHandlerException.java   
@Override
public EmptyResponseProto ping(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:ditb    文件:TestRpcHandlerException.java   
@Override
public EmptyResponseProto error(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:ditb    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto ping(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:ditb    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto error(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}
项目:ditb    文件:AbstractTestIPC.java   
@Override
public EmptyResponseProto ping(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:ditb    文件:AbstractTestIPC.java   
@Override
public EmptyResponseProto error(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:ditb    文件:AbstractTestIPC.java   
@Override
public EmptyResponseProto ping(RpcController unused, EmptyRequestProto request)
    throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:ditb    文件:AbstractTestIPC.java   
@Override
public EmptyResponseProto error(RpcController unused, EmptyRequestProto request)
    throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}
项目:ditb    文件:IntegrationTestRpcClient.java   
@Override
public EmptyResponseProto ping(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:ditb    文件:IntegrationTestRpcClient.java   
@Override
public EmptyResponseProto error(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:pbase    文件:TestRpcHandlerException.java   
@Override
public EmptyResponseProto ping(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:pbase    文件:TestRpcHandlerException.java   
@Override
public EmptyResponseProto error(RpcController controller, EmptyRequestProto request)
    throws ServiceException {
  return null;
}
项目:pbase    文件:TestIPC.java   
@Override
public EmptyResponseProto ping(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:pbase    文件:TestIPC.java   
@Override
public EmptyResponseProto error(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:pbase    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto ping(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:pbase    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto error(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}
项目:HIndex    文件:TestIPC.java   
@Override
public EmptyResponseProto ping(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:HIndex    文件:TestIPC.java   
@Override
public EmptyResponseProto error(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:HIndex    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto ping(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:HIndex    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto error(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}
项目:hbase    文件:ProtobufCoprocessorService.java   
@Override
public void ping(RpcController controller, TestProtos.EmptyRequestProto request,
    RpcCallback<TestProtos.EmptyResponseProto> done) {
  done.run(TestProtos.EmptyResponseProto.getDefaultInstance());
}
项目:hbase    文件:ProtobufCoprocessorService.java   
@Override
public void error(RpcController controller, TestProtos.EmptyRequestProto request,
    RpcCallback<TestProtos.EmptyResponseProto> done) {
  CoprocessorRpcUtils.setControllerException(controller, new IOException("Test exception"));
  done.run(null);
}
项目:hbase    文件:ProtobufCoprocessorService.java   
@Override
public void addr(RpcController controller, EmptyRequestProto request,
    RpcCallback<AddrResponseProto> done) {
  done.run(AddrResponseProto.newBuilder()
      .setAddr(RpcServer.getRemoteAddress().get().getHostAddress()).build());
}
项目:PyroDB    文件:TestIPC.java   
@Override
public EmptyResponseProto ping(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:PyroDB    文件:TestIPC.java   
@Override
public EmptyResponseProto error(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:PyroDB    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto ping(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:PyroDB    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto error(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}
项目:c5    文件:TestIPC.java   
@Override
public EmptyResponseProto ping(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:c5    文件:TestIPC.java   
@Override
public EmptyResponseProto error(RpcController controller,
    EmptyRequestProto request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:c5    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto ping(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:c5    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto error(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}
项目:DominoHBase    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto ping(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  return EmptyResponseProto.newBuilder().build();
}
项目:DominoHBase    文件:TestProtoBufRpc.java   
@Override
public EmptyResponseProto error(RpcController unused,
    EmptyRequestProto request) throws ServiceException {
  throw new ServiceException("error", new IOException("error"));
}