Package org.apache.hadoop.hbase.coordination

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


        }
      }

      // TODO: This code is tied to ZK anyway, so for now leaving it as is,
      // will refactor when whole region assignment will be abstracted from ZK
      BaseCoordinatedStateManager cp =
        (BaseCoordinatedStateManager) this.server.getCoordinatedStateManager();
      OpenRegionCoordination openRegionCoordination = cp.getOpenRegionCoordination();

      ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd =
        new ZkOpenRegionCoordination.ZkOpenRegionDetails();
      zkOrd.setVersion(stat.getVersion());
      zkOrd.setServerName(cp.getServer().getServerName());

      return processRegionsInTransition(
        rt, hri, openRegionCoordination, zkOrd);
    } finally {
      lock.unlock();
View Full Code Here


            RegionTransition rt = RegionTransition.parseFrom(data);

            // TODO: This code is tied to ZK anyway, so for now leaving it as is,
            // will refactor when whole region assignment will be abstracted from ZK
            BaseCoordinatedStateManager csm =
              (BaseCoordinatedStateManager) server.getCoordinatedStateManager();
            OpenRegionCoordination openRegionCoordination = csm.getOpenRegionCoordination();

            ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd =
              new ZkOpenRegionCoordination.ZkOpenRegionDetails();
            zkOrd.setVersion(stat.getVersion());
            zkOrd.setServerName(csm.getServer().getServerName());

            handleRegion(rt, openRegionCoordination, zkOrd);
          } catch (KeeperException e) {
            server.abort("Unexpected ZK exception reading unassigned node data", e);
          } catch (DeserializationException e) {
View Full Code Here

    Mockito.when(this.serverManager.isServerOnline(SERVERNAME_A)).thenReturn(false);
    am.getRegionStates().logSplit(SERVERNAME_A); // Assume log splitting is done
    am.getRegionStates().createRegionState(REGIONINFO);
    am.gate.set(false);

    BaseCoordinatedStateManager cp = new ZkCoordinatedStateManager();
    cp.initialize(server);
    cp.start();

    OpenRegionCoordination orc = cp.getOpenRegionCoordination();
    ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkOrd.setServerName(server.getServerName());
    zkOrd.setVersion(version);
View Full Code Here

        hri.getEncodedNameAsBytes()));

    // Let's start the open handler
    HTableDescriptor htd = getRS().tableDescriptors.get(hri.getTable());

    BaseCoordinatedStateManager csm = new ZkCoordinatedStateManager();
    csm.initialize(getRS());
    csm.start();

    ZkOpenRegionCoordination.ZkOpenRegionDetails zkCrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkCrd.setServerName(getRS().getServerName());
    zkCrd.setVersionOfOfflineNode(0);

    getRS().service.submit(new OpenRegionHandler(getRS(), getRS(), hri, htd,
      csm.getOpenRegionCoordination(), zkCrd));

    // The open handler should have removed the region from RIT but kept the region closed
    checkRegionIsClosed();

    // The open handler should have updated the value in ZK.
View Full Code Here

    //  1) There is no ZK node
    //  2) The region in RIT was changed.
    // The order is more or less implementation dependant.
    HTableDescriptor htd = getRS().tableDescriptors.get(hri.getTable());

    BaseCoordinatedStateManager csm = new ZkCoordinatedStateManager();
    csm.initialize(getRS());
    csm.start();

    ZkOpenRegionCoordination.ZkOpenRegionDetails zkCrd =
      new ZkOpenRegionCoordination.ZkOpenRegionDetails();
    zkCrd.setServerName(getRS().getServerName());
    zkCrd.setVersionOfOfflineNode(0);

    getRS().service.submit(new OpenRegionHandler(getRS(), getRS(), hri, htd,
      csm.getOpenRegionCoordination(), zkCrd));

    // The open handler should have removed the region from RIT but kept the region closed
    checkRegionIsClosed();

    // We should not find any znode here.
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

TOP

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

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.