Examples of ZooKeeperWrapper


Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

    this.metaRescanInterval =
      conf.getInt("hbase.master.meta.thread.rescanfrequency", 60 * 1000);

    this.sleeper = new Sleeper(this.threadWakeFrequency, this.closed);
   
    zooKeeperWrapper = new ZooKeeperWrapper(conf, this);
    zkMasterAddressWatcher = new ZKMasterAddressWatcher(this);
    serverManager = new ServerManager(this);
    regionManager = new RegionManager(this);
   
    writeAddressToZooKeeper(true);
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

      // Can we still be the master? If not, goodbye

      zooKeeperWrapper.close();
      try {
        zooKeeperWrapper = new ZooKeeperWrapper(conf, this);

        if(!writeAddressToZooKeeper(false)) {
          throw new Exception("Another Master is currently active");
        }
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

   * Constructor
   * @param conf
   * @throws IOException
   */
  public ZooKeeperAuthenticator(HBaseConfiguration conf) throws IOException {
    this(conf, new ZooKeeperWrapper(conf, new Watcher() {
      public void process(WatchedEvent event) { }
    }));
    ensureExists(USERS_ZNODE_ROOT);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

    }
    return ensureExists(znode.substring(0, index), mode, data);
  }

  ZooKeeperWrapper initZooKeeperWrapper() throws IOException {
    return new ZooKeeperWrapper(conf, this);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

      }
      this.rootRegionLocation = rootRegion;
    }
   
    public HMasterInterface getMaster() throws MasterNotRunningException {
      ZooKeeperWrapper zk = null;
      try {
        zk = getZooKeeperWrapper();
      } catch (IOException e) {
        throw new MasterNotRunningException(e);
      }

      HServerAddress masterLocation = null;
      synchronized (this.masterLock) {
        for (int tries = 0;
          !this.closed &&
          !this.masterChecked && this.master == null &&
          tries < numRetries;
        tries++) {

          try {
            masterLocation = zk.readMasterAddressOrThrow();

            HMasterInterface tryMaster = (HMasterInterface)HBaseRPC.getProxy(
                HMasterInterface.class, HBaseRPCProtocolVersion.versionID,
                masterLocation.getInetSocketAddress(), this.conf);
           
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

    private HRegionLocation locateRootRegion()
    throws IOException {

      // We lazily instantiate the ZooKeeper object because we don't want to
      // make the constructor have to throw IOException or handle it itself.
      ZooKeeperWrapper zk = getZooKeeperWrapper();

      HServerAddress rootRegionAddress = null;
      for (int tries = 0; tries < numRetries; tries++) {
        int localTimeouts = 0;
        // ask the master which server has the root region
        while (rootRegionAddress == null && localTimeouts < numRetries) {
          // Don't read root region until we're out of safe mode so we know
          // that the meta regions have been assigned.
          boolean outOfSafeMode = zk.checkOutOfSafeMode();
          if (outOfSafeMode) {
            rootRegionAddress = zk.readRootRegionLocation();
          }
          if (rootRegionAddress == null) {
            try {
              if (LOG.isDebugEnabled()) {
                LOG.debug("Sleeping " + getPauseTime(tries) +
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

     * Get this watcher's ZKW, instanciate it if necessary.
     * @return ZKW
     */
    public ZooKeeperWrapper getZooKeeperWrapper() throws IOException {
      if(zooKeeperWrapper == null) {
        zooKeeperWrapper = new ZooKeeperWrapper(conf, this);
      }
      return zooKeeperWrapper;
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

    this.metaRescanInterval =
      conf.getInt("hbase.master.meta.thread.rescanfrequency", 60 * 1000);

    this.sleeper = new Sleeper(this.threadWakeFrequency, this.closed);
   
    zooKeeperWrapper = new ZooKeeperWrapper(conf, this);
    zkMasterAddressWatcher = new ZKMasterAddressWatcher(this);
    serverManager = new ServerManager(this);
    regionManager = new RegionManager(this);
   
    writeAddressToZooKeeper();
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

      reservedSpace.add(new byte[DEFAULT_SIZE_RESERVATION_BLOCK]);
    }
  }

  private void reinitializeZooKeeper() throws IOException {
    zooKeeperWrapper = new ZooKeeperWrapper(conf, this);
    watchMasterAddress();
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.zookeeper.ZooKeeperWrapper

      reservedSpace.add(new byte[DEFAULT_SIZE_RESERVATION_BLOCK]);
    }
  }

  private void reinitializeZooKeeper() throws IOException {
    zooKeeperWrapper = new ZooKeeperWrapper(conf, this);
    watchMasterAddress();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.