From ab3885f2c8cfd63ff94e548c40db3b4ea52c12e8 Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Mon, 4 Jun 2018 08:55:01 -0700 Subject: [PATCH] HDDS-126. Fix findbugs warning in MetadataKeyFilters.java. Contributed by Akira Ajisaka. --- .../main/java/org/apache/hadoop/utils/MetadataKeyFilters.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d3a29435de3..153e2f79441 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;