HBASE-25937: Clarify UnknownRegionException (#3330)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
belugabehr 2021-06-22 10:36:30 -04:00 committed by GitHub
parent f640eef924
commit d44292ac1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 6 deletions

View File

@ -29,9 +29,21 @@ public class UnknownRegionException extends DoNotRetryRegionException {
private static final long serialVersionUID = 1968858760475205392L; private static final long serialVersionUID = 1968858760475205392L;
/** /**
* @param regionName the name of the region which is unknown * Constructs a new UnknownRegionException with the specified detail message.
*
* @param message the detail message
*/ */
public UnknownRegionException(String regionName) { public UnknownRegionException(String message) {
super(regionName); super(message);
}
/**
* Constructs a new UnknownRegionException with the specified detail message and cause.
*
* @param message the detail message
* @param cause the cause of the exception
*/
public UnknownRegionException(String message, Throwable cause) {
super(message, cause);
} }
} }

View File

@ -37,6 +37,10 @@ public class DoNotRetryRegionException extends DoNotRetryIOException {
super(s); super(s);
} }
public DoNotRetryRegionException(String s, Throwable cause) {
super(s, cause);
}
public DoNotRetryRegionException(Throwable cause) { public DoNotRetryRegionException(Throwable cause) {
super(cause); super(cause);
} }

View File

@ -1628,9 +1628,9 @@ public class AssignmentManager {
regionStateStore.visitMetaForRegion(regionEncodedName, visitor); regionStateStore.visitMetaForRegion(regionEncodedName, visitor);
return regionStates.getRegionState(regionEncodedName) == null ? null : return regionStates.getRegionState(regionEncodedName) == null ? null :
regionStates.getRegionState(regionEncodedName).getRegion(); regionStates.getRegionState(regionEncodedName).getRegion();
} catch(IOException e) { } catch (IOException e) {
LOG.error("Error trying to load region {} from META", regionEncodedName, e); throw new UnknownRegionException(
throw new UnknownRegionException("Error while trying load region from meta"); "Error trying to load region " + regionEncodedName + " from META", e);
} }
} }