Package org.apache.hadoop.hbase.coordination

Examples of org.apache.hadoop.hbase.coordination.ZkCoordinatedStateManager


    RegionServerServices rsServices = HTU.createMockRegionServerService();

    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName());

    ZkCoordinatedStateManager csm = new ZkCoordinatedStateManager();
    csm.initialize(server);
    csm.start();

    ZkOpenRegionCoordination.ZkOpenRegionDetails zkCrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkCrd.setServerName(server.getServerName());

    // Create the handler
    OpenRegionHandler handler =
      new OpenRegionHandler(server, rsServices, TEST_HRI, TEST_HTD,
        csm.getOpenRegionCoordination(), zkCrd) {
        @Override
        HRegion openRegion() {
          // Fake failure of opening a region due to an IOE, which is caught
          return null;
        }
View Full Code Here


    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName());

    // Create the handler
    ZkCoordinatedStateManager csm = new ZkCoordinatedStateManager();
    csm.initialize(server);
    csm.start();

    ZkOpenRegionCoordination.ZkOpenRegionDetails zkCrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkCrd.setServerName(server.getServerName());

    OpenRegionHandler handler = new OpenRegionHandler(server, rsServices, TEST_HRI, TEST_HTD,
      csm.getOpenRegionCoordination(), zkCrd) {
        @Override
        boolean updateMeta(final HRegion r) {
          // Fake failure of updating META
          return false;
        }
View Full Code Here

    Server server = new MockServer(HTU);
    RegionServerServices rsServices = HTU.createMockRegionServerService();
    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName());
    // Create the handler
    ZkCoordinatedStateManager csm = new ZkCoordinatedStateManager();
    csm.initialize(server);
    csm.start();

    ZkOpenRegionCoordination.ZkOpenRegionDetails zkCrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkCrd.setServerName(server.getServerName());

    OpenRegionHandler handler = new OpenRegionHandler(server, rsServices, TEST_HRI, TEST_HTD,
      csm.getOpenRegionCoordination(), zkCrd) {
      @Override
      boolean updateMeta(HRegion r) {
        return false;
      };
View Full Code Here

    Server server = new MockServer(HTU);
    RegionServerServices rsServices = HTU.createMockRegionServerService(server.getServerName());
    // Create it OFFLINE, which is what it expects
    ZKAssign.createNodeOffline(server.getZooKeeper(), TEST_HRI, server.getServerName());
    // Create the handler
    ZkCoordinatedStateManager csm = new ZkCoordinatedStateManager();
    csm.initialize(server);
    csm.start();

    ZkOpenRegionCoordination.ZkOpenRegionDetails zkCrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkCrd.setServerName(server.getServerName());
View Full Code Here

    if (conf.getBoolean("hbase.assignment.usezk", true)) {
      return;
    }
    conf.setInt("hbase.regionstatestore.meta.connection", 3);
    final RegionStateStore rss =
        new RegionStateStore(new MyRegionServer(conf, new ZkCoordinatedStateManager()));
    rss.start();
    // Create 10 threads and make each do 10 puts related to region state update
    Thread[] th = new Thread[10];
    List<String> nameList = new ArrayList<String>();
    List<TableName> tableNameList = new ArrayList<TableName>();
View Full Code Here

      // to the passed hri -- so insert the region into the online region Set.
      rss.addToOnlineRegions(spy);
      // Assert the Server is NOT stopped before we call close region.
      assertFalse(server.isStopped());

      ZkCoordinatedStateManager consensusProvider = new ZkCoordinatedStateManager();
      consensusProvider.initialize(server);
      consensusProvider.start();

      ZkCloseRegionCoordination.ZkCloseRegionDetails zkCrd =
        new ZkCloseRegionCoordination.ZkCloseRegionDetails();
      zkCrd.setPublishStatusInZk(false);
      zkCrd.setExpectedVersion(-1);

      CloseRegionHandler handler = new CloseRegionHandler(server, rss, hri, false,
            consensusProvider.getCloseRegionCoordination(), zkCrd);
      boolean throwable = false;
      try {
        handler.process();
      } catch (Throwable t) {
        throwable = true;
View Full Code Here

      String nodeName = ZKAssign.getNodeName(zkw, region.getRegionInfo()
          .getEncodedName());
      ZKUtil.getDataAndWatch(zkw, nodeName, stat);

      // use the version for the OpenedRegionHandler
      BaseCoordinatedStateManager csm = new ZkCoordinatedStateManager();
      csm.initialize(server);
      csm.start();

      OpenRegionCoordination orc = csm.getOpenRegionCoordination();
      ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd =
        new ZkOpenRegionCoordination.ZkOpenRegionDetails();
      zkOrd.setServerName(server.getServerName());
      zkOrd.setVersion(stat.getVersion());
      OpenedRegionHandler handler = new OpenedRegionHandler(server, am, region
View Full Code Here

   */
  @Test(timeout = 30000)
  public void testUpdatesRemoteMeta() throws Exception {
    conf.setInt("hbase.regionstatestore.meta.connection", 3);
    final RegionStateStore rss =
        new RegionStateStore(new MyRegionServer(conf, new ZkCoordinatedStateManager()));
    rss.start();
    // Create 10 threads and make each do 10 puts related to region state update
    Thread[] th = new Thread[10];
    List<String> nameList = new ArrayList<String>();
    List<TableName> tableNameList = new ArrayList<TableName>();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.coordination.ZkCoordinatedStateManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.