HBASE-26646 WALPlayer should obtain token from filesystem (#4003)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
meiyi 2022-01-07 17:37:29 +08:00 committed by meiyi
parent f3639bc80c
commit b68c4aae06
1 changed files with 3 additions and 0 deletions

View File

@ -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<WALKey, WALEdit> {
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);