Skip to content

Commit

Permalink
HBASE-28389 HBase backup yarn queue parameter ignored (#6131)
Browse files Browse the repository at this point in the history
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 9dccc67)
  • Loading branch information
2005hithlj committed Jul 31, 2024
1 parent 5e4e956 commit 2744740
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ private int parseAndRun() throws IOException {

if (cmd.hasOption(OPTION_YARN_QUEUE_NAME)) {
String queueName = cmd.getOptionValue(OPTION_YARN_QUEUE_NAME);
// Set system property value for MR job
System.setProperty("mapreduce.job.queuename", queueName);
// Set MR job queuename to configuration
getConf().set("mapreduce.job.queuename", queueName);
}

// parse main restore command options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ public void execute() throws IOException {
throw new IOException(INCORRECT_USAGE);
}

if (cmdline.hasOption(OPTION_YARN_QUEUE_NAME)) {
String queueName = cmdline.getOptionValue(OPTION_YARN_QUEUE_NAME);
// Set MR job queuename to configuration
getConf().set("mapreduce.job.queuename", queueName);
}

// Create connection
conn = ConnectionFactory.createConnection(getConf());
if (requiresNoActiveSession()) {
Expand Down Expand Up @@ -333,12 +339,6 @@ public void execute() throws IOException {

boolean ignoreChecksum = cmdline.hasOption(OPTION_IGNORECHECKSUM);

if (cmdline.hasOption(OPTION_YARN_QUEUE_NAME)) {
String queueName = cmdline.getOptionValue(OPTION_YARN_QUEUE_NAME);
// Set system property value for MR job
System.setProperty("mapreduce.job.queuename", queueName);
}

try (BackupAdminImpl admin = new BackupAdminImpl(conn)) {
BackupRequest.Builder builder = new BackupRequest.Builder();
BackupRequest request = builder.withBackupType(BackupType.valueOf(args[1].toUpperCase()))
Expand Down

0 comments on commit 2744740

Please sign in to comment.