From b68c4aae06e24ab3f52a597b41baaaddcdee2405 Mon Sep 17 00:00:00 2001 From: meiyi Date: Fri, 7 Jan 2022 17:37:29 +0800 Subject: [PATCH] HBASE-26646 WALPlayer should obtain token from filesystem (#4003) Signed-off-by: Duo Zhang --- .../java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java index ffc202ab0dc..373bf4ffb17 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/WALInputFormat.java @@ -45,6 +45,7 @@ import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; +import org.apache.hadoop.mapreduce.security.TokenCache; import org.apache.hadoop.util.StringUtils; import org.apache.yetus.audience.InterfaceAudience; import org.slf4j.Logger; @@ -274,6 +275,8 @@ public class WALInputFormat extends InputFormat { Configuration conf = context.getConfiguration(); boolean ignoreMissing = conf.getBoolean(WALPlayer.IGNORE_MISSING_FILES, false); Path[] inputPaths = getInputPaths(conf); + // get delegation token for the filesystem + TokenCache.obtainTokensForNamenodes(context.getCredentials(), inputPaths, conf); long startTime = conf.getLong(startKey, Long.MIN_VALUE); long endTime = conf.getLong(endKey, Long.MAX_VALUE);