HDDS-126. Fix findbugs warning in MetadataKeyFilters.java. Contributed by Akira Ajisaka.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ab3885f2 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ab3885f2 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ab3885f2 Branch: refs/heads/YARN-1011 Commit: ab3885f2c8cfd63ff94e548c40db3b4ea52c12e8 Parents: e2289c8 Author: Xiaoyu Yao <x...@apache.org> Authored: Mon Jun 4 08:55:01 2018 -0700 Committer: Xiaoyu Yao <x...@apache.org> Committed: Mon Jun 4 08:55:01 2018 -0700 ---------------------------------------------------------------------- .../src/main/java/org/apache/hadoop/utils/MetadataKeyFilters.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/ab3885f2/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/MetadataKeyFilters.java ---------------------------------------------------------------------- diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/MetadataKeyFilters.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/MetadataKeyFilters.java index d3a2943..153e2f7 100644 --- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/MetadataKeyFilters.java +++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/MetadataKeyFilters.java @@ -19,6 +19,7 @@ package org.apache.hadoop.utils; import com.google.common.base.Preconditions; import com.google.common.base.Strings; +import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.ozone.OzoneConsts; /** @@ -94,7 +95,7 @@ public final class MetadataKeyFilters { if (Strings.isNullOrEmpty(keyPrefix)) { accept = true; } else { - byte [] prefixBytes = keyPrefix.getBytes(); + byte [] prefixBytes = DFSUtil.string2Bytes(keyPrefix); if (currentKey != null && prefixMatch(prefixBytes, currentKey)) { keysHinted++; accept = true; --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org