Search in sources :

Example 1 with RegionOpeningException

use of org.apache.hadoop.hbase.exceptions.RegionOpeningException in project hbase by apache.

the class HRegionServer method getRegionByEncodedName.

protected Region getRegionByEncodedName(byte[] regionName, String encodedRegionName) throws NotServingRegionException {
    Region region = this.onlineRegions.get(encodedRegionName);
    if (region == null) {
        MovedRegionInfo moveInfo = getMovedRegion(encodedRegionName);
        if (moveInfo != null) {
            throw new RegionMovedException(moveInfo.getServerName(), moveInfo.getSeqNum());
        }
        Boolean isOpening = this.regionsInTransitionInRS.get(Bytes.toBytes(encodedRegionName));
        String regionNameStr = regionName == null ? encodedRegionName : Bytes.toStringBinary(regionName);
        if (isOpening != null && isOpening.booleanValue()) {
            throw new RegionOpeningException("Region " + regionNameStr + " is opening on " + this.serverName);
        }
        throw new NotServingRegionException("Region " + regionNameStr + " is not online on " + this.serverName);
    }
    return region;
}
Also used : RegionOpeningException(org.apache.hadoop.hbase.exceptions.RegionOpeningException) NotServingRegionException(org.apache.hadoop.hbase.NotServingRegionException) RegionMovedException(org.apache.hadoop.hbase.exceptions.RegionMovedException) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean)

Example 2 with RegionOpeningException

use of org.apache.hadoop.hbase.exceptions.RegionOpeningException in project hbase by apache.

the class TestMetaCache method metaCachePreservingExceptions.

public static List<Throwable> metaCachePreservingExceptions() {
    return new ArrayList<Throwable>() {

        {
            add(new RegionOpeningException(" "));
            add(new RegionTooBusyException());
            add(new ThrottlingException(" "));
            add(new MultiActionResultTooLarge(" "));
            add(new RetryImmediatelyException(" "));
            add(new CallQueueTooBigException());
        }
    };
}
Also used : RegionOpeningException(org.apache.hadoop.hbase.exceptions.RegionOpeningException) ArrayList(java.util.ArrayList) ThrottlingException(org.apache.hadoop.hbase.quotas.ThrottlingException)

Aggregations

RegionOpeningException (org.apache.hadoop.hbase.exceptions.RegionOpeningException)2 ArrayList (java.util.ArrayList)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 NotServingRegionException (org.apache.hadoop.hbase.NotServingRegionException)1 RegionMovedException (org.apache.hadoop.hbase.exceptions.RegionMovedException)1 ThrottlingException (org.apache.hadoop.hbase.quotas.ThrottlingException)1