Repository: hbase Updated Branches: refs/heads/branch-1 4edd8a63d -> 24a92ed63
HBASE-16948 Fix inconsistency between HRegion and Region javadoc on getRowLock Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/24a92ed6 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/24a92ed6 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/24a92ed6 Branch: refs/heads/branch-1 Commit: 24a92ed63a2e483d43cf66f220c666c581b33484 Parents: 4edd8a6 Author: Michael Stack <st...@apache.org> Authored: Wed Oct 26 16:09:43 2016 -0700 Committer: Michael Stack <st...@apache.org> Committed: Wed Oct 26 16:11:26 2016 -0700 ---------------------------------------------------------------------- .../hadoop/hbase/regionserver/HRegion.java | 10 -------- .../hadoop/hbase/regionserver/Region.java | 26 +++++++++++++------- 2 files changed, 17 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/24a92ed6/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index ca37eb1..2757eae 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -5310,16 +5310,6 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi return getRowLock(row, false); } - /** - * - * Get a row lock for the specified row. All locks are reentrant. - * - * Before calling this function make sure that a region operation has already been - * started (the calling thread has already acquired the region-close-guard lock). - * @param row The row actions will be performed against - * @param readLock is the lock reader or writer. True indicates that a non-exlcusive - * lock is requested - */ @Override public RowLock getRowLock(byte[] row, boolean readLock) throws IOException { // Make sure the row is inside of this region before getting the lock for it. http://git-wip-us.apache.org/repos/asf/hbase/blob/24a92ed6/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java index c763ac0..35e2b35 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java @@ -269,15 +269,23 @@ public interface Region extends ConfigurationObserver { } /** - * Tries to acquire a lock on the given row. - * @param waitForLock if true, will block until the lock is available. - * Otherwise, just tries to obtain the lock and returns - * false if unavailable. - * @return the row lock if acquired, - * null if waitForLock was false and the lock was not acquired - * @throws IOException if waitForLock was true and the lock could not be acquired after waiting - */ - RowLock getRowLock(byte[] row, boolean waitForLock) throws IOException; + * + * Get a row lock for the specified row. All locks are reentrant. + * + * Before calling this function make sure that a region operation has already been + * started (the calling thread has already acquired the region-close-guard lock). + * + * NOTE: the boolean passed here has changed. It used to be a boolean that + * stated whether or not to wait on the lock. Now it is whether it an exclusive + * lock is requested. + * + * @param row The row actions will be performed against + * @param readLock is the lock reader or writer. True indicates that a non-exclusive + * lock is requested + * @see #startRegionOperation() + * @see #startRegionOperation(Operation) + */ + RowLock getRowLock(byte[] row, boolean readLock) throws IOException; /** * If the given list of row locks is not null, releases all locks.