当前位置: 首页>>代码示例>>Java>>正文


Java DummyService类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService的典型用法代码示例。如果您正苦于以下问题:Java DummyService类的具体用法?Java DummyService怎么用?Java DummyService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DummyService类属于org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos包,在下文中一共展示了DummyService类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testEndpoint

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testEndpoint() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  final ServerRpcController controller = new ServerRpcController();
  final BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse> rpcCallback =
      new BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse>();
  DummyRegionServerEndpointProtos.DummyService service =
      ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class,
          TEST_UTIL.getHBaseAdmin().coprocessorService(serverName));
  service.dummyCall(controller,
      DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback);
  assertEquals(DUMMY_VALUE, rpcCallback.get().getValue());
  if (controller.failedOnException()) {
    throw controller.getFailedOn();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestRegionServerCoprocessorEndpoint.java

示例2: testEndpointExceptions

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testEndpointExceptions() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  final ServerRpcController controller = new ServerRpcController();
  final BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse> rpcCallback =
      new BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse>();
  DummyRegionServerEndpointProtos.DummyService service =
      ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class,
          TEST_UTIL.getHBaseAdmin().coprocessorService(serverName));
  service.dummyThrow(controller,
      DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback);
  assertEquals(null, rpcCallback.get());
  assertTrue(controller.failedOnException());
  assertEquals(WHAT_TO_THROW.getClass().getName().trim(),
      ((RemoteWithExtrasException) controller.getFailedOn().getCause()).getClassName().trim());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestRegionServerCoprocessorEndpoint.java

示例3: testEndpoint

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testEndpoint() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  final ServerRpcController controller = new ServerRpcController();
  final BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse> rpcCallback =
      new BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse>();
  DummyRegionServerEndpointProtos.DummyService service =
      ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class,
        new HBaseAdmin(CONF).coprocessorService(serverName));
  service.dummyCall(controller,
    DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback);
  assertEquals(DUMMY_VALUE, rpcCallback.get().getValue());
  if (controller.failedOnException()) {
    throw controller.getFailedOn();
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:17,代码来源:TestRegionServerCoprocessorEndpoint.java

示例4: testEndpoint

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testEndpoint() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  final ServerRpcController controller = new ServerRpcController();
  final CoprocessorRpcUtils.BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse>
      rpcCallback = new CoprocessorRpcUtils.BlockingRpcCallback<>();
  DummyRegionServerEndpointProtos.DummyService service =
      ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class,
        TEST_UTIL.getAdmin().coprocessorService(serverName));
  service.dummyCall(controller,
      DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback);
  assertEquals(DUMMY_VALUE, rpcCallback.get().getValue());
  if (controller.failedOnException()) {
    throw controller.getFailedOn();
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:TestRegionServerCoprocessorEndpoint.java

示例5: testEndpointExceptions

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testEndpointExceptions() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  final ServerRpcController controller = new ServerRpcController();
  final CoprocessorRpcUtils.BlockingRpcCallback<DummyRegionServerEndpointProtos.DummyResponse>
      rpcCallback = new CoprocessorRpcUtils.BlockingRpcCallback<>();
  DummyRegionServerEndpointProtos.DummyService service =
      ProtobufUtil.newServiceStub(DummyRegionServerEndpointProtos.DummyService.class,
          TEST_UTIL.getAdmin().coprocessorService(serverName));
  service.dummyThrow(controller,
      DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance(), rpcCallback);
  assertEquals(null, rpcCallback.get());
  assertTrue(controller.failedOnException());
  assertEquals(WHAT_TO_THROW.getClass().getName().trim(),
      ((RemoteWithExtrasException) controller.getFailedOn().getCause()).getClassName().trim());
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:TestRegionServerCoprocessorEndpoint.java

示例6: testRegionServerCoprocessorServiceError

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testRegionServerCoprocessorServiceError() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  DummyRegionServerEndpointProtos.DummyRequest request =
      DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance();
  try {
    admin
        .<DummyRegionServerEndpointProtos.DummyService.Stub, DummyRegionServerEndpointProtos.DummyResponse> coprocessorService(
          DummyRegionServerEndpointProtos.DummyService::newStub,
          (s, c, done) -> s.dummyThrow(c, request, done), serverName).get();
    fail("Should have thrown an exception");
  } catch (Exception e) {
    assertTrue(e.getCause() instanceof RetriesExhaustedException);
    assertTrue(e.getCause().getMessage().contains(WHAT_TO_THROW.getClass().getName().trim()));
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:TestAsyncCoprocessorEndpoint.java

示例7: testRegionServerCoprocessorService

import org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService; //导入依赖的package包/类
@Test
public void testRegionServerCoprocessorService() throws Exception {
  final ServerName serverName = TEST_UTIL.getHBaseCluster().getRegionServer(0).getServerName();
  DummyRegionServerEndpointProtos.DummyRequest request =
      DummyRegionServerEndpointProtos.DummyRequest.getDefaultInstance();
  DummyRegionServerEndpointProtos.DummyResponse response =
      admin
          .<DummyRegionServerEndpointProtos.DummyService.Stub, DummyRegionServerEndpointProtos.DummyResponse> coprocessorService(
            DummyRegionServerEndpointProtos.DummyService::newStub,
            (s, c, done) -> s.dummyCall(c, request, done), serverName).get();
  assertEquals(DUMMY_VALUE, response.getValue());
}
 
开发者ID:apache,项目名称:hbase,代码行数:13,代码来源:TestAsyncCoprocessorEndpoint.java


注:本文中的org.apache.hadoop.hbase.coprocessor.protobuf.generated.DummyRegionServerEndpointProtos.DummyService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。