• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MasterProtos类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testRPCException

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
@Test
public void testRPCException() throws IOException, InterruptedException, KeeperException {
  ServerName sm = master.getServerName();
  boolean fakeZNodeDelete = false;
  for (int i = 0; i < 20; i++) {
    try {
      BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(sm, User.getCurrent(), 0);
      MasterProtos.MasterService.BlockingInterface stub =
          MasterProtos.MasterService.newBlockingStub(channel);
      assertTrue(stub.isMasterRunning(null, IsMasterRunningRequest.getDefaultInstance())
          .getIsMasterRunning());
      return;
    } catch (ServiceException ex) {
      IOException ie = ProtobufUtil.getRemoteException(ex);
      // No SocketTimeoutException here. RpcServer is already started after the construction of
      // HMaster.
      assertTrue(ie.getMessage().startsWith(
        "org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet"));
      LOG.info("Expected exception: ", ie);
      if (!fakeZNodeDelete) {
        testUtil.getZooKeeperWatcher().getRecoverableZooKeeper()
            .delete(testUtil.getZooKeeperWatcher().getMasterAddressZNode(), -1);
        fakeZNodeDelete = true;
      }
    }
    Thread.sleep(1000);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:TestHMasterRPCException.java


示例2: toSecurityCapabilityList

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
/**
 * Convert SecurityCapabilitiesResponse.Capability to SecurityCapability
 * @param capabilities capabilities returned in the SecurityCapabilitiesResponse message
 * @return the converted list of SecurityCapability elements
 */
public static List<SecurityCapability> toSecurityCapabilityList(
    List<MasterProtos.SecurityCapabilitiesResponse.Capability> capabilities) {
  List<SecurityCapability> scList = new ArrayList<>(capabilities.size());
  for (MasterProtos.SecurityCapabilitiesResponse.Capability c: capabilities) {
    try {
      scList.add(SecurityCapability.valueOf(c.getNumber()));
    } catch (IllegalArgumentException e) {
      // Unknown capability, just ignore it. We don't understand the new capability
      // but don't care since by definition we cannot take advantage of it.
    }
  }
  return scList;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:ProtobufUtil.java


示例3: getServices

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
/**
 * @return list of blocking services and their security info classes that this server supports
 */
private List<BlockingServiceAndInterface> getServices() {
  List<BlockingServiceAndInterface> bssi = new ArrayList<BlockingServiceAndInterface>(3);
  bssi.add(new BlockingServiceAndInterface(
      MasterProtos.MasterService.newReflectiveBlockingService(this),
      MasterProtos.MasterService.BlockingInterface.class));
  bssi.add(new BlockingServiceAndInterface(
      RegionServerStatusProtos.RegionServerStatusService.newReflectiveBlockingService(this),
      RegionServerStatusProtos.RegionServerStatusService.BlockingInterface.class));
  return bssi;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:14,代码来源:HMaster.java


示例4: takeSnapshotAsync

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
@Override
public MasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot) throws IOException {
    throw new UnsupportedOperationException("takeSnapshotAsync");
}
 
开发者ID:aliyun,项目名称:aliyun-tablestore-hbase-client,代码行数:5,代码来源:TablestoreAdmin.java


示例5: takeSnapshotAsync

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
@Override
public MasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)
    throws IOException, SnapshotCreationException {
  throw new UnsupportedOperationException("takeSnapshotAsync");  // TODO
}
 
开发者ID:dmmcerlean,项目名称:cloud-bigtable-client,代码行数:6,代码来源:BigtableAdmin.java


示例6: testRPCException

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");
  CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
  HMaster hm = new HMaster(conf, cp);
  ServerName sm = hm.getServerName();
  RpcClient rpcClient = RpcClientFactory.createClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    int i = 0;
    //retry the RPC a few times; we have seen SocketTimeoutExceptions if we
    //try to connect too soon. Retry on SocketTimeoutException.
    while (i < 20) {
      try {
        BlockingRpcChannel channel =
          rpcClient.createBlockingRpcChannel(sm, User.getCurrent(), 0);
        MasterProtos.MasterService.BlockingInterface stub =
          MasterProtos.MasterService.newBlockingStub(channel);
        stub.isMasterRunning(null, IsMasterRunningRequest.getDefaultInstance());
        fail();
      } catch (ServiceException ex) {
        IOException ie = ProtobufUtil.getRemoteException(ex);
        if (!(ie instanceof SocketTimeoutException)) {
          if (ie.getMessage().startsWith("org.apache.hadoop.hbase.ipc." +
              "ServerNotRunningYetException: Server is not running yet")) {
            // Done.  Got the exception we wanted.
            System.out.println("Expected exception: " + ie.getMessage());
            return;
          } else {
            throw ex;
          }
        } else {
          System.err.println("Got SocketTimeoutException. Will retry. ");
        }
      } catch (Throwable t) {
        fail("Unexpected throwable: " + t);
      }
      Thread.sleep(100);
      i++;
    }
    fail();
  } finally {
    rpcClient.close();
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:48,代码来源:TestHMasterRPCException.java


示例7: testRPCException

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");
  HMaster hm = new HMaster(conf);
  ServerName sm = hm.getServerName();
  RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    int i = 0;
    //retry the RPC a few times; we have seen SocketTimeoutExceptions if we
    //try to connect too soon. Retry on SocketTimeoutException.
    while (i < 20) {
      try {
        BlockingRpcChannel channel =
          rpcClient.createBlockingRpcChannel(sm, User.getCurrent(), 0);
        MasterProtos.MasterService.BlockingInterface stub =
          MasterProtos.MasterService.newBlockingStub(channel);
        stub.isMasterRunning(null, IsMasterRunningRequest.getDefaultInstance());
        fail();
      } catch (ServiceException ex) {
        IOException ie = ProtobufUtil.getRemoteException(ex);
        if (!(ie instanceof SocketTimeoutException)) {
          if (ie.getMessage().startsWith("org.apache.hadoop.hbase.ipc." +
              "ServerNotRunningYetException: Server is not running yet")) {
            // Done.  Got the exception we wanted.
            System.out.println("Expected exception: " + ie.getMessage());
            return;
          } else {
            throw ex;
          }
        } else {
          System.err.println("Got SocketTimeoutException. Will retry. ");
        }
      } catch (Throwable t) {
        fail("Unexpected throwable: " + t);
      }
      Thread.sleep(100);
      i++;
    }
    fail();
  } finally {
    rpcClient.stop();
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:47,代码来源:TestHMasterRPCException.java


示例8: takeSnapshotAsync

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
/**
 * Unsupported.
 */
public MasterProtos.SnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException,
    SnapshotCreationException {
  throw new UnsupportedOperationException();
}
 
开发者ID:intel-hadoop,项目名称:CSBT,代码行数:8,代码来源:CrossSiteHBaseAdmin.java


示例9: testRPCException

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
@Test
public void testRPCException() throws Exception {
  HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set(HConstants.MASTER_PORT, "0");
  CoordinatedStateManager cp = CoordinatedStateManagerFactory.getCoordinatedStateManager(conf);
  HMaster hm = new HMaster(conf, cp);
  ServerName sm = hm.getServerName();
  RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
  try {
    int i = 0;
    //retry the RPC a few times; we have seen SocketTimeoutExceptions if we
    //try to connect too soon. Retry on SocketTimeoutException.
    while (i < 20) {
      try {
        BlockingRpcChannel channel =
          rpcClient.createBlockingRpcChannel(sm, User.getCurrent(), 0);
        MasterProtos.MasterService.BlockingInterface stub =
          MasterProtos.MasterService.newBlockingStub(channel);
        stub.isMasterRunning(null, IsMasterRunningRequest.getDefaultInstance());
        fail();
      } catch (ServiceException ex) {
        IOException ie = ProtobufUtil.getRemoteException(ex);
        if (!(ie instanceof SocketTimeoutException)) {
          if (ie.getMessage().startsWith("org.apache.hadoop.hbase.ipc." +
              "ServerNotRunningYetException: Server is not running yet")) {
            // Done.  Got the exception we wanted.
            System.out.println("Expected exception: " + ie.getMessage());
            return;
          } else {
            throw ex;
          }
        } else {
          System.err.println("Got SocketTimeoutException. Will retry. ");
        }
      } catch (Throwable t) {
        fail("Unexpected throwable: " + t);
      }
      Thread.sleep(100);
      i++;
    }
    fail();
  } finally {
    rpcClient.stop();
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:48,代码来源:TestHMasterRPCException.java


示例10: takeSnapshotAsync

import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; //导入依赖的package包/类
/**
 * Take a snapshot without waiting for the server to complete that snapshot (asynchronous) Only a
 * single snapshot should be taken at a time, or results may be undefined.
 *
 * @param snapshot snapshot to take
 * @return response from the server indicating the max time to wait for the snapshot
 * @throws IOException if the snapshot did not succeed or we lose contact with the master.
 * @throws SnapshotCreationException if snapshot creation failed
 * @throws IllegalArgumentException if the snapshot request is formatted incorrectly
 */
MasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot)
    throws IOException, SnapshotCreationException;
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:Admin.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PluginException类代码示例发布时间:2022-05-22
下一篇:
Java SettingsEditorGroup类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap