本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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");
}