From c55acb0b0363525f8d3ff52cbcbd05f3bbdb20a4 Mon Sep 17 00:00:00 2001 From: Yu Li Date: Thu, 12 Jul 2018 10:14:36 +0800 Subject: [PATCH] HBASE-20838 Include hbase-server in precommit test if CommonFSUtils is changed --- dev-support/hbase-personality.sh | 12 ++++++++++++ .../org/apache/hadoop/hbase/util/CommonFSUtils.java | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 8004167e167..1ca32ee33cd 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -180,6 +180,18 @@ function personality_modules if [ -n "${BUILD_ID}" ]; then extra="${extra} -Dbuild.id=${BUILD_ID}" fi + + # If the set of changed files includes CommonFSUtils then add the hbase-server + # module to the set of modules (if not already included) to be tested + for f in "${CHANGED_FILES[@]}" + do + if [[ "${f}" =~ CommonFSUtils ]]; then + if [[ ! "${MODULES[*]}" =~ hbase-server ]] && [[ ! "${MODULES[*]}" =~ \. ]]; then + MODULES+=("hbase-server") + fi + break + fi + done fi for module in "${MODULES[@]}"; do diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java index 76a3601e505..2e480e6cb7d 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java @@ -51,6 +51,10 @@ import org.apache.hbase.thirdparty.com.google.common.collect.Lists; /** * Utility methods for interacting with the underlying file system. + *

+ * Note that {@link #setStoragePolicy(FileSystem, Path, String)} is tested in TestFSUtils and + * pre-commit will run the hbase-server tests if there's code change in this class. See + * HBASE-20838 for more details. */ @InterfaceAudience.Private public abstract class CommonFSUtils {