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


Java AdminProtos.OpenRegionResponse方法代码示例

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


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

示例1: testMultipleOpen

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Test that we can send multiple openRegion to the region server.
 * This is used when:
 * - there is a SocketTimeout: in this case, the master does not know if the region server
 * received the request before the timeout.
 * - We have a socket error during the operation: same stuff: we don't know
 * - a master failover: if we find a znode in thz M_ZK_REGION_OFFLINE, we don't know if
 * the region server has received the query or not. Only solution to be efficient: re-ask
 * immediately.
 */
@Test(timeout = 60000)
public void testMultipleOpen() throws Exception {

  // We close
  closeNoZK();
  checkRegionIsClosed();

  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  // We're sending multiple requests in a row. The region server must handle this nicely.
  for (int i = 0; i < 10; i++) {
    AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(getRS().getServerName(), hri, 0, null);
    AdminProtos.OpenRegionResponse responseOpen = getRS().openRegion(null, orr);
    Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);

    AdminProtos.OpenRegionResponse.RegionOpeningState ors = responseOpen.getOpeningState(0);
    Assert.assertTrue("request " + i + " failed",
        ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED) ||
            ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.ALREADY_OPENED)
    );
  }

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

示例2: testMultipleOpen

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Test that we can send multiple openRegion to the region server.
 * This is used when:
 * - there is a SocketTimeout: in this case, the master does not know if the region server
 * received the request before the timeout.
 * - We have a socket error during the operation: same stuff: we don't know
 * - a master failover: if we find a znode in thz M_ZK_REGION_OFFLINE, we don't know if
 * the region server has received the query or not. Only solution to be efficient: re-ask
 * immediately.
 */
@Test(timeout = 60000)
public void testMultipleOpen() throws Exception {

  // We close
  closeNoZK();
  checkRegionIsClosed();

  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  // We're sending multiple requests in a row. The region server must handle this nicely.
  for (int i = 0; i < 10; i++) {
    AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(getRS().getServerName(), hri, 0, null);
    AdminProtos.OpenRegionResponse responseOpen = getRS().rpcServices.openRegion(null, orr);
    Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);

    AdminProtos.OpenRegionResponse.RegionOpeningState ors = responseOpen.getOpeningState(0);
    Assert.assertTrue("request " + i + " failed",
        ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED) ||
            ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.ALREADY_OPENED)
    );
  }

  checkRegionIsOpened();
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:36,代码来源:TestRegionServerNoMaster.java

示例3: testMultipleOpen

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Test that we can send multiple openRegion to the region server.
 * This is used when:
 * - there is a SocketTimeout: in this case, the master does not know if the region server
 * received the request before the timeout.
 * - We have a socket error during the operation: same stuff: we don't know
 * - a master failover: if we find a znode in thz M_ZK_REGION_OFFLINE, we don't know if
 * the region server has received the query or not. Only solution to be efficient: re-ask
 * immediately.
 */
@Test(timeout = 60000)
public void testMultipleOpen() throws Exception {

  // We close
  closeNoZK();
  checkRegionIsClosed();

  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  // We're sending multiple requests in a row. The region server must handle this nicely.
  for (int i = 0; i < 10; i++) {
    AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(hri, 0, null);
    AdminProtos.OpenRegionResponse responseOpen = getRS().openRegion(null, orr);
    Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);

    AdminProtos.OpenRegionResponse.RegionOpeningState ors = responseOpen.getOpeningState(0);
    Assert.assertTrue("request " + i + " failed",
        ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED) ||
            ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.ALREADY_OPENED)
    );
  }

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

示例4: testMultipleOpen

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Test that we can send multiple openRegion to the region server.
 * This is used when:
 * - there is a SocketTimeout: in this case, the master does not know if the region server
 * received the request before the timeout.
 * - We have a socket error during the operation: same stuff: we don't know
 * - a master failover: if we find a znode in thz M_ZK_REGION_OFFLINE, we don't know if
 * the region server has received the query or not. Only solution to be efficient: re-ask
 * immediately.
 */
@Test(timeout = 20000)
public void testMultipleOpen() throws Exception {

  // We close
  closeNoZK();
  checkRegionIsClosed();

  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  // We're sending multiple requests in a row. The region server must handle this nicely.
  for (int i = 0; i < 10; i++) {
    AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(hri, 0);
    AdminProtos.OpenRegionResponse responseOpen = getRS().openRegion(null, orr);
    Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);

    AdminProtos.OpenRegionResponse.RegionOpeningState ors = responseOpen.getOpeningState(0);
    Assert.assertTrue("request " + i + " failed",
        ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED) ||
            ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.ALREADY_OPENED)
    );
  }

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

示例5: openRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
private void openRegion(HRegionInfo hri) throws Exception {
  try {
    if (isRegionOpened(hri)) return;
  } catch (Exception e){}
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(
    getRS().getServerName(), hri, 0, null, null);
  AdminProtos.OpenRegionResponse responseOpen = getRS().getRSRpcServices().openRegion(null, orr);
  Assert.assertEquals(responseOpen.getOpeningStateCount(), 1);
  Assert.assertEquals(responseOpen.getOpeningState(0),
    AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED);
  checkRegionIsOpened(hri);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:TestReplicasClient.java

示例6: openRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
public static void openRegion(HBaseTestingUtility HTU, HRegionServer rs, HRegionInfo hri)
    throws Exception {
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, rs.getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr =
      RequestConverter.buildOpenRegionRequest(rs.getServerName(), hri, 0, null, null);
  AdminProtos.OpenRegionResponse responseOpen = rs.rpcServices.openRegion(null, orr);

  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));


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

示例7: testMultipleOpen

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Test that we can send multiple openRegion to the region server.
 * This is used when:
 * - there is a SocketTimeout: in this case, the master does not know if the region server
 * received the request before the timeout.
 * - We have a socket error during the operation: same stuff: we don't know
 * - a master failover: if we find a znode in thz M_ZK_REGION_OFFLINE, we don't know if
 * the region server has received the query or not. Only solution to be efficient: re-ask
 * immediately.
 */
@Test(timeout = 60000)
public void testMultipleOpen() throws Exception {

  // We close
  closeRegionNoZK();
  checkRegionIsClosed(HTU, getRS(), hri);

  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  // We're sending multiple requests in a row. The region server must handle this nicely.
  for (int i = 0; i < 10; i++) {
    AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(
      getRS().getServerName(), hri, 0, null, null);
    AdminProtos.OpenRegionResponse responseOpen = getRS().rpcServices.openRegion(null, orr);
    Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);

    AdminProtos.OpenRegionResponse.RegionOpeningState ors = responseOpen.getOpeningState(0);
    Assert.assertTrue("request " + i + " failed",
        ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED) ||
            ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.ALREADY_OPENED)
    );
  }

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

示例8: reopenRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Reopen the region. Reused in multiple tests as we always leave the region open after a test.
 */
private void reopenRegion() throws Exception {
  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr =
    RequestConverter.buildOpenRegionRequest(getRS().getServerName(), hri, 0, null, null);
  AdminProtos.OpenRegionResponse responseOpen = getRS().rpcServices.openRegion(null, orr);
  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));


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

示例9: testMultipleOpen

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Test that we can send multiple openRegion to the region server.
 * This is used when:
 * - there is a SocketTimeout: in this case, the master does not know if the region server
 * received the request before the timeout.
 * - We have a socket error during the operation: same stuff: we don't know
 * - a master failover: if we find a znode in thz M_ZK_REGION_OFFLINE, we don't know if
 * the region server has received the query or not. Only solution to be efficient: re-ask
 * immediately.
 */
@Test(timeout = 60000)
public void testMultipleOpen() throws Exception {

  // We close
  closeNoZK();
  checkRegionIsClosed();

  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());

  // We're sending multiple requests in a row. The region server must handle this nicely.
  for (int i = 0; i < 10; i++) {
    AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(
      getRS().getServerName(), hri, 0, null, null);
    AdminProtos.OpenRegionResponse responseOpen = getRS().rpcServices.openRegion(null, orr);
    Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);

    AdminProtos.OpenRegionResponse.RegionOpeningState ors = responseOpen.getOpeningState(0);
    Assert.assertTrue("request " + i + " failed",
        ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED) ||
            ors.equals(AdminProtos.OpenRegionResponse.RegionOpeningState.ALREADY_OPENED)
    );
  }

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

示例10: openRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
private void openRegion(HRegionInfo hri) throws Exception {
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(getRS().getServerName(), hri, 0, null, null);
  AdminProtos.OpenRegionResponse responseOpen = getRS().getRSRpcServices().openRegion(null, orr);
  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));
  checkRegionIsOpened(hri.getEncodedName());
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:11,代码来源:TestRegionReplicas.java

示例11: reopenRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Reopen the region. Reused in multiple tests as we always leave the region open after a test.
 */
private void reopenRegion() throws Exception {
  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(getRS().getServerName(), hri, 0, null);
  AdminProtos.OpenRegionResponse responseOpen = getRS().openRegion(null, orr);
  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));


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

示例12: reopenRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Reopen the region. Reused in multiple tests as we always leave the region open after a test.
 */
private void reopenRegion() throws Exception {
  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr =
    RequestConverter.buildOpenRegionRequest(getRS().getServerName(), hri, 0, null);
  AdminProtos.OpenRegionResponse responseOpen = getRS().rpcServices.openRegion(null, orr);
  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));


  checkRegionIsOpened();
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:18,代码来源:TestRegionServerNoMaster.java

示例13: reopenRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Reopen the region. Reused in multiple tests as we always leave the region open after a test.
 */
private void reopenRegion() throws Exception {
  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(hri, 0, null);
  AdminProtos.OpenRegionResponse responseOpen = getRS().openRegion(null, orr);
  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));


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

示例14: reopenRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
/**
 * Reopen the region. Reused in multiple tests as we always leave the region open after a test.
 */
private void reopenRegion() throws Exception {
  // We reopen. We need a ZK node here, as a open is always triggered by a master.
  ZKAssign.createNodeOffline(HTU.getZooKeeperWatcher(), hri, getRS().getServerName());
  // first version is '0'
  AdminProtos.OpenRegionRequest orr = RequestConverter.buildOpenRegionRequest(hri, 0);
  AdminProtos.OpenRegionResponse responseOpen = getRS().openRegion(null, orr);
  Assert.assertTrue(responseOpen.getOpeningStateCount() == 1);
  Assert.assertTrue(responseOpen.getOpeningState(0).
      equals(AdminProtos.OpenRegionResponse.RegionOpeningState.OPENED));


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

示例15: openRegion

import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; //导入方法依赖的package包/类
@Override
public AdminProtos.OpenRegionResponse openRegion(RpcController rpcController, AdminProtos.OpenRegionRequest openRegionRequest) throws ServiceException {
    throw new UnsupportedOperationException("Not implemented");
}
 
开发者ID:NGDATA,项目名称:hbase-indexer,代码行数:5,代码来源:BaseHRegionServer.java


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