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


Java AdminProtos.CloseRegionRequest方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.AdminProtos.CloseRegionRequest方法的典型用法代码示例。如果您正苦于以下问题:Java AdminProtos.CloseRegionRequest方法的具体用法?Java AdminProtos.CloseRegionRequest怎么用?Java AdminProtos.CloseRegionRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.protobuf.generated.AdminProtos的用法示例。


在下文中一共展示了AdminProtos.CloseRegionRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCloseByMasterWithoutZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testCloseByMasterWithoutZNode() throws Exception {

  // Transition in ZK on. This should fail, as there is no znode
  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    getRS().getServerName(), regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().rpcServices.closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  // now waiting. After a while, the transition should be done
  while (!getRS().getRegionsInTransitionInRS().isEmpty()) {
    Thread.sleep(1);
  }

  // the region is still available, the close got rejected at the end
  Assert.assertTrue("The close should have failed", getRS().getRegion(regionName).isAvailable());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例2: testOpenCloseByMasterWithZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testOpenCloseByMasterWithZNode() throws Exception {

  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    getRS().getServerName(), regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().rpcServices.closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  checkRegionIsClosed(HTU, getRS(), hri);

  ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(),
    getRS().getServerName());

  openRegion(HTU, getRS(), hri);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例3: testOpenCloseByMasterWithZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testOpenCloseByMasterWithZNode() throws Exception {

  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    getRS().getServerName(), regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().rpcServices.closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  checkRegionIsClosed();

  ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(),
    getRS().getServerName());

  reopenRegion();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例4: testCloseByMasterWithoutZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testCloseByMasterWithoutZNode() throws Exception {

  // Transition in ZK on. This should fail, as there is no znode
  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    getRS().getServerName(), regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  // now waiting. After a while, the transition should be done
  while (!getRS().getRegionsInTransitionInRS().isEmpty()) {
    Thread.sleep(1);
  }

  // the region is still available, the close got rejected at the end
  Assert.assertTrue("The close should have failed", getRS().getRegion(regionName).isAvailable());
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例5: testOpenCloseByMasterWithZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testOpenCloseByMasterWithZNode() throws Exception {

  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    getRS().getServerName(), regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  checkRegionIsClosed();

  ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(),
    getRS().getServerName());

  reopenRegion();
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例6: testCloseByMasterWithoutZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testCloseByMasterWithoutZNode() throws Exception {

  // Transition in ZK on. This should fail, as there is no znode
  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
      regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  // now waiting. After a while, the transition should be done
  while (!getRS().getRegionsInTransitionInRS().isEmpty()) {
    Thread.sleep(1);
  }

  // the region is still available, the close got rejected at the end
  Assert.assertTrue("The close should have failed", getRS().getRegion(regionName).isAvailable());
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例7: testOpenCloseByMasterWithZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testOpenCloseByMasterWithZNode() throws Exception {

  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
      regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  checkRegionIsClosed();

  ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(),
    getRS().getServerName());

  reopenRegion();
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例8: testCloseByMasterWithoutZNode

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 20000)
public void testCloseByMasterWithoutZNode() throws Exception {

  // Transition in ZK on. This should fail, as there is no znode
  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
      regionName, true);
  AdminProtos.CloseRegionResponse responseClose = getRS().closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  // now waiting. After a while, the transition should be done
  while (!getRS().getRegionsInTransitionInRS().isEmpty()) {
    Thread.sleep(1);
  }

  // the region is still available, the close got rejected at the end
  Assert.assertTrue("The close should have failed", getRS().getRegion(regionName).isAvailable());
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例9: testMultipleCloseFromMaster

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 20000)
public void testMultipleCloseFromMaster() throws Exception {

  // As opening, we must support multiple requests on the same region
  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  for (int i = 0; i < 10; i++) {
    AdminProtos.CloseRegionRequest crr =
        RequestConverter.buildCloseRegionRequest(regionName, 0, null, true);
    try {
      AdminProtos.CloseRegionResponse responseClose = getRS().closeRegion(null, crr);
      Assert.assertEquals("The first request should succeeds", 0, i);
      Assert.assertTrue("request " + i + " failed",
          responseClose.getClosed() || responseClose.hasClosed());
    } catch (ServiceException se) {
      Assert.assertTrue("The next queries should throw an exception.", i > 0);
    }
  }

  checkRegionIsClosed();

  Assert.assertTrue(
      ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName())
  );

  reopenRegion();
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:27,代码来源:TestRegionServerNoMaster.java

示例10: parseFromProtoRequest

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Parse ZK-related fields from request.
 */
@Override
public CloseRegionDetails parseFromProtoRequest(AdminProtos.CloseRegionRequest request) {
  ZkCloseRegionCoordination.ZkCloseRegionDetails zkCrd =
    new ZkCloseRegionCoordination.ZkCloseRegionDetails();
  zkCrd.setPublishStatusInZk(request.getTransitionInZK());
  int versionOfClosingNode = -1;
  if (request.hasVersionOfClosingNode()) {
    versionOfClosingNode = request.getVersionOfClosingNode();
  }
  zkCrd.setExpectedVersion(versionOfClosingNode);

  return zkCrd;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:ZkCloseRegionCoordination.java

示例11: closeRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
private void closeRegion(HRegionInfo hri) throws Exception {
  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    getRS().getServerName(), hri.getEncodedName(), true);
  AdminProtos.CloseRegionResponse responseClose = getRS()
      .getRSRpcServices().closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  checkRegionIsClosed(hri.getEncodedName());

  ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(), null);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:TestReplicasClient.java

示例12: closeRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
public static void closeRegion(HBaseTestingUtility HTU, HRegionServer rs, HRegionInfo hri)
    throws Exception {
  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, rs.getServerName());
  AdminProtos.CloseRegionRequest crr = RequestConverter.buildCloseRegionRequest(
    rs.getServerName(), hri.getEncodedName(), true);
  AdminProtos.CloseRegionResponse responseClose = rs.rpcServices.closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());
  checkRegionIsClosed(HTU, rs, hri);
  ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(), null);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:TestRegionServerNoMaster.java

示例13: closeRegionNoZK

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Close the region without using ZK
 */
private void closeRegionNoZK() throws Exception {
  // no transition in ZK
  AdminProtos.CloseRegionRequest crr =
      RequestConverter.buildCloseRegionRequest(getRS().getServerName(), regionName, false);
  AdminProtos.CloseRegionResponse responseClose = getRS().rpcServices.closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  // now waiting & checking. After a while, the transition should be done and the region closed
  checkRegionIsClosed(HTU, getRS(), hri);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:TestRegionServerNoMaster.java

示例14: testMultipleCloseFromMaster

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Test(timeout = 60000)
public void testMultipleCloseFromMaster() throws Exception {

  // As opening, we must support multiple requests on the same region
  ZKAssign.createNodeClosing(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  for (int i = 0; i < 10; i++) {
    AdminProtos.CloseRegionRequest crr =
        RequestConverter.buildCloseRegionRequest(getRS().getServerName(), regionName, 0, null, true);
    try {
      AdminProtos.CloseRegionResponse responseClose = getRS().rpcServices.closeRegion(null, crr);
      Assert.assertEquals("The first request should succeeds", 0, i);
      Assert.assertTrue("request " + i + " failed",
          responseClose.getClosed() || responseClose.hasClosed());
    } catch (ServiceException se) {
      Assert.assertTrue("The next queries should throw an exception.", i > 0);
    }
  }

  checkRegionIsClosed(HTU, getRS(), hri);

  Assert.assertTrue(
    ZKAssign.deleteClosedNode(HTU.getZooKeeperWatcher(), hri.getEncodedName(),
      getRS().getServerName())
  );

  openRegion(HTU, getRS(), hri);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:28,代码来源:TestRegionServerNoMaster.java

示例15: closeNoZK

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Close the region without using ZK
 */
private void closeNoZK() throws Exception {
  // no transition in ZK
  AdminProtos.CloseRegionRequest crr =
      RequestConverter.buildCloseRegionRequest(getRS().getServerName(), regionName, false);
  AdminProtos.CloseRegionResponse responseClose = getRS().rpcServices.closeRegion(null, crr);
  Assert.assertTrue(responseClose.getClosed());

  // now waiting & checking. After a while, the transition should be done and the region closed
  checkRegionIsClosed();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:14,代码来源:TestRegionServerNoMaster.java


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