* @throws NotServingRegionException when the region is closing or closed
*/
private void startBulkRegionOperation(boolean writeLockNeeded)
throws NotServingRegionException {
if (this.closing.get()) {
throw new NotServingRegionException(regionInfo.getRegionNameAsString() +
" is closing");
}
if (writeLockNeeded) lock.writeLock().lock();
else lock.readLock().lock();
if (this.closed.get()) {
if (writeLockNeeded) lock.writeLock().unlock();
else lock.readLock().unlock();
throw new NotServingRegionException(regionInfo.getRegionNameAsString() +
" is closed");
}
}