Skip to content
Permalink
Browse files
HBASE-25477 Purge use of VisibleForTesting (#19)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
  • Loading branch information
petersomogyi committed Jan 7, 2021
1 parent 64df29a commit 73cc2c9363ec3f2ce0246a4c36bc793fa2ac1063
Showing 6 changed files with 12 additions and 21 deletions.
@@ -56,7 +56,6 @@
import org.apache.hadoop.hbase.oss.sync.TreeLockManager.Depth;
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.util.Progressable;
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.yetus.audience.InterfaceStability;
import org.slf4j.Logger;
@@ -119,7 +118,7 @@ public void initialize(URI name, Configuration conf) throws IOException {
sync = TreeLockManager.get(fs);
}

@VisibleForTesting
@InterfaceAudience.Private
TreeLockManager getLockManager() {
return sync;
}
@@ -30,7 +30,6 @@
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.oss.Constants;
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.yetus.audience.InterfaceStability;
import org.slf4j.Logger;
@@ -109,7 +108,7 @@ public Path norm(Path path) {
* Convenience function for calling norm on an array. Returned copy of the
* array will also be sorted for deadlock avoidance.
*/
@VisibleForTesting
@InterfaceAudience.Private
private Path[] norm(Path[] paths) {
Path[] newPaths = new Path[paths.length];
for (int i = 0; i < paths.length; i++) {
@@ -204,7 +203,7 @@ public void close() throws IOException {
* @return True if a lock is found, false otherwise
* @throws IOException at any possible IO failure.
*/
@VisibleForTesting
@InterfaceAudience.Private
public abstract boolean writeLockBelow(Path p, Depth depth) throws IOException;

/**
@@ -217,7 +216,7 @@ public void close() throws IOException {
* @return True if a lock is found, false otherwise
* @throws IOException at any possible IO failure.
*/
@VisibleForTesting
@InterfaceAudience.Private
public abstract boolean readLockBelow(Path p, Depth depth) throws IOException;

/**
@@ -38,7 +38,6 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
import org.apache.hadoop.hbase.oss.Constants;
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.yetus.audience.InterfaceStability;
import org.apache.zookeeper.KeeperException;
@@ -210,15 +209,15 @@ protected synchronized boolean writeLockAbove(Path p) throws IOException {
}

@Override
@VisibleForTesting
@InterfaceAudience.Private
public boolean writeLockBelow(Path p, Depth depth) throws IOException {
int maxLevel = (depth == Depth.DIRECTORY) ? 1 : Integer.MAX_VALUE;
boolean b = writeLockBelow(p, 0, maxLevel);
return b;
}

@Override
@VisibleForTesting
@InterfaceAudience.Private
public boolean readLockBelow(Path p, Depth depth) throws IOException {
int maxLevel = (depth == Depth.DIRECTORY) ? 1 : Integer.MAX_VALUE;
boolean b = readLockBelow(p, 0, maxLevel);
@@ -24,7 +24,7 @@
import java.util.Set;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@@ -98,15 +98,15 @@ protected boolean writeLockAbove(Path p) {
}

@Override
@VisibleForTesting
@InterfaceAudience.Private
public boolean writeLockBelow(Path p, Depth depth) {
createLocksIfNeeded(p);
int maxLevel = (depth == Depth.DIRECTORY) ? 1 : Integer.MAX_VALUE;
return writeLockBelow(p, 0, maxLevel);
}

@Override
@VisibleForTesting
@InterfaceAudience.Private
public boolean readLockBelow(Path p, Depth depth) {
createLocksIfNeeded(p);
int maxLevel = (depth == Depth.DIRECTORY) ? 1 : Integer.MAX_VALUE;
@@ -20,7 +20,7 @@

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
import org.apache.yetus.audience.InterfaceAudience;

/**
* Bypasses all synchronization to effectively make HBOSS operations no-ops.
@@ -56,13 +56,13 @@ protected boolean writeLockAbove(Path p) {
}

@Override
@VisibleForTesting
@InterfaceAudience.Private
public boolean writeLockBelow(Path p, Depth depth) {
return false;
}

@Override
@VisibleForTesting
@InterfaceAudience.Private
public boolean readLockBelow(Path p, Depth depth) {
return false;
}
@@ -171,12 +171,6 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase.thirdparty</groupId>
<artifactId>hbase-shaded-miscellaneous</artifactId>
<version>${hbase-thirdparty.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>

0 comments on commit 73cc2c9

Please sign in to comment.