Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.NotServingRegionException


     */
    @Override
    public boolean next(List<KeyValue> outResults) throws IOException {
      if (closing.get() || closed.get()) {
        close();
        throw new NotServingRegionException(regionInfo.getRegionNameAsString() +
          " is closing=" + closing.get() + " or closed=" + closed.get());
      }
      results.clear();
      boolean returnResult = nextInternal();
      if (!returnResult && filter != null && filter.filterRow()) {
View Full Code Here


    this.lock.readLock().lock();
    try {
      Integer key = Integer.valueOf(Bytes.hashCode(regionName));
      region = onlineRegions.get(key);
      if (region == null) {
        throw new NotServingRegionException(regionName);
      }
      return region;
    } finally {
      this.lock.readLock().unlock();
    }
View Full Code Here

  Integer obtainRowLock(final byte [] row) throws IOException {
    checkRow(row);
    splitsAndClosesLock.readLock().lock();
    try {
      if (this.closed.get()) {
        throw new NotServingRegionException("Region " + this + " closed");
      }
      Integer key = Bytes.mapKey(row);
      synchronized (locksToRows) {
        while (locksToRows.containsKey(key)) {
          try {
View Full Code Here

      // split, merge or compact region doesn't need to check the closing/closed state or lock the
      // region
      return;
    }
    if (this.closing.get()) {
      throw new NotServingRegionException(getRegionNameAsString() + " is closing");
    }
    lock(lock.readLock());
    if (this.closed.get()) {
      lock.readLock().unlock();
      throw new NotServingRegionException(getRegionNameAsString() + " is closed");
    }
  }
View Full Code Here

   * @throws InterruptedIOException if interrupted while waiting for a lock
   */
  private void startBulkRegionOperation(boolean writeLockNeeded)
      throws NotServingRegionException, RegionTooBusyException, InterruptedIOException {
    if (this.closing.get()) {
      throw new NotServingRegionException(getRegionNameAsString() + " is closing");
    }
    if (writeLockNeeded) lock(lock.writeLock());
    else lock(lock.readLock());
    if (this.closed.get()) {
      if (writeLockNeeded) lock.writeLock().unlock();
      else lock.readLock().unlock();
      throw new NotServingRegionException(getRegionNameAsString() + " is closed");
    }
  }
View Full Code Here

    this.lock.readLock().lock();
    try {
      Integer key = Integer.valueOf(Bytes.hashCode(regionName));
      region = onlineRegions.get(key);
      if (region == null) {
        throw new NotServingRegionException(regionName);
      }
      return region;
    } finally {
      this.lock.readLock().unlock();
    }
View Full Code Here

    HRegion region = null;
    this.lock.readLock().lock();
    try {
      region = onlineRegions.get(Integer.valueOf(Bytes.hashCode(regionName)));
      if (region == null) {
        throw new NotServingRegionException(regionName);
      }
      return region;
    } finally {
      this.lock.readLock().unlock();
    }
View Full Code Here

    }

    public boolean next(List<KeyValue> outResults) throws IOException {
      if (closing.get() || closed.get()) {
        close();
        throw new NotServingRegionException(regionInfo.getRegionNameAsString() +
          " is closing=" + closing.get() + " or closed=" + closed.get());
      }
      results.clear();
      boolean returnResult = nextInternal();
      if (!returnResult && filter != null && filter.filterRow()) {
View Full Code Here

      long expiration = timeout + System.currentTimeMillis();
      while (System.currentTimeMillis() < expiration) {
        try {
          HRegionInfo rsRegion = rs.getRegionInfo(region.getRegionName());
          if (rsRegion == null)
            throw new NotServingRegionException();
        } catch (Exception e) {
          success = true;
          return;
        }
        Thread.sleep(1000);
View Full Code Here

   * Acquires a read lock and checks if the region is closing or closed.
   * @throws NotServingRegionException when the region is closing or closed
   */
  private void startRegionOperation() throws NotServingRegionException {
    if (this.closing.get()) {
      throw new NotServingRegionException(regionInfo.getRegionNameAsString() +
          " is closing");
    }
    lock.readLock().lock();
    if (this.closed.get()) {
      lock.readLock().unlock();
      throw new NotServingRegionException(regionInfo.getRegionNameAsString() +
          " is closed");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.NotServingRegionException

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.