Skip to content

Commit

Permalink
HBASE-26646 WALPlayer should obtain token from filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
mymeiyi committed Jan 5, 2022
1 parent ce2bbaf commit ff3d7c9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.security.TokenCache;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.yetus.audience.InterfaceAudience;
Expand Down Expand Up @@ -344,6 +345,9 @@ public Job createSubmittableJob(String[] args) throws IOException {
try {
TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(),
Class.forName(codecCls));
// get delegation token for the filesystem
TokenCache.obtainTokensForNamenodes(job.getCredentials(), new Path[] { new Path(inputDirs) },
conf);
} catch (Exception e) {
throw new IOException("Cannot determine wal codec class " + codecCls, e);
}
Expand Down

0 comments on commit ff3d7c9

Please sign in to comment.