apurtell commented on a change in pull request #2574:
URL: https://github.com/apache/hbase/pull/2574#discussion_r512087407
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -9000,6 +9129,49 @@ public long getReadPoint() {
return getReadPoint(IsolationLevel.READ_COMMITTED);
}
+ /**
+ * Interrupt any region options that have acquired the region lock via
+ * {@link
#startRegionOperation(org.apache.hadoop.hbase.regionserver.Region.Operation)},
+ * or {@link #startBulkRegionOperation(boolean)}.
+ */
+ private void interruptRegionOperations() {
+ for (Thread t: regionLockHolders) {
+ t.interrupt();
+ }
+ }
+
+ /**
+ * Check thread interrupt status and throw an exception if interrupted.
+ * @throws NotServingRegionException if region is closing
+ * @throws InterruptedIOException if interrupted but region is not closing
+ */
+ // Package scope for tests
+ void checkInterrupt() throws NotServingRegionException,
InterruptedIOException {
+ if (Thread.interrupted()) {
+ if (this.closing.get()) {
+ throw new NotServingRegionException(
+ getRegionInfo().getRegionNameAsString() + " is closing");
+ }
+ throw new InterruptedIOException();
+ }
+ }
+
+ /**
+ * Throw the correct exception upon interrupt
+ * @param t cause
+ * @throws NotServingRegionException if region is closing
+ * @throws InterruptedIOException in all cases except if region is closing
Review comment:
Old stuff, will update
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]