From 650c9f27fd5aa408c6cc41b2d8d77019da597de4 Mon Sep 17 00:00:00 2001 From: Elliott Clark Date: Thu, 26 Mar 2015 11:48:19 -0700 Subject: [PATCH] HBASE-13342 Fix incorrect interface annotations --- dev-support/test-patch.sh | 25 +++++++++++++++++++ .../handler/RegionReplicaFlushHandler.java | 2 +- .../hbase/regionserver/wal/ReplayHLogKey.java | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 3c01359165d..cd464018885 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -420,6 +420,29 @@ checkAntiPatterns () { return 0 } +############################################################################### +### Check that there are no incorrect annotations +checkInterfaceAudience () { + echo "" + echo "" + echo "======================================================================" + echo "======================================================================" + echo " Checking against hadoop InterfaceAudience." + echo "======================================================================" + echo "======================================================================" + echo "" + echo "" + warnings=`$GREP 'import org.apache.hadoop.classification' $PATCH_DIR/patch` + if [[ $warnings != "" ]]; then + JIRA_COMMENT="$JIRA_COMMENT + + {color:red}-1 InterfaceAudience{color}. The patch appears to contain InterfaceAudience from hadoop rather than hbase: + $warnings." + return 1 + fi + return 0 +} + ############################################################################### ### Check there are no javadoc warnings checkJavadocWarnings () { @@ -909,6 +932,8 @@ checkJavadocWarnings (( RESULT = RESULT + $? )) checkCheckstyleErrors (( RESULT = RESULT + $? )) +checkInterfaceAudience +(( RESULT = RESULT + $? )) checkFindbugsWarnings (( RESULT = RESULT + $? )) checkReleaseAuditWarnings diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/RegionReplicaFlushHandler.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/RegionReplicaFlushHandler.java index 9661b30b072..e0921b09256 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/RegionReplicaFlushHandler.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/handler/RegionReplicaFlushHandler.java @@ -23,11 +23,11 @@ import java.io.InterruptedIOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.TableNotFoundException; +import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.ClusterConnection; import org.apache.hadoop.hbase.client.FlushRegionCallable; import org.apache.hadoop.hbase.client.RegionReplicaUtil; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReplayHLogKey.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReplayHLogKey.java index 4506b19ac08..55c057b470b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReplayHLogKey.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ReplayHLogKey.java @@ -22,8 +22,8 @@ import java.io.IOException; import java.util.List; import java.util.UUID; -import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.classification.InterfaceAudience; /** * An HLogKey specific to WalEdits coming from replay.