From b4a4debdd984936214808c5c4daac2a56ba77c86 Mon Sep 17 00:00:00 2001 From: bsglz <18031031@qq.com> Date: Sun, 31 May 2020 13:23:04 +0800 Subject: [PATCH] HBASE-24475 Clean up the master thread name getting in SplitLogManager and AssignmentManager (#1810) --- .../org/apache/hadoop/hbase/master/SplitLogManager.java | 6 +----- .../hadoop/hbase/master/assignment/AssignmentManager.java | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java index b2e99b21a57..2bdfa030559 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java @@ -121,12 +121,8 @@ public class SplitLogManager { throws IOException { this.server = master; this.conf = conf; - // Get Server Thread name. Sometimes the Server is mocked so may not extends Thread. - // For example, in tests. - String name = master instanceof Thread? ((Thread)master).getName(): - master.getServerName().toShortString(); this.choreService = - new ChoreService(name + ".splitLogManager."); + new ChoreService(master.getServerName().toShortString() + ".splitLogManager."); if (server.getCoordinatedStateManager() != null) { SplitLogManagerCoordination coordination = getSplitLogManagerCoordination(); Set failedDeletions = Collections.synchronizedSet(new HashSet()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java index fceb87d7de5..f2a77ba361f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java @@ -1907,11 +1907,7 @@ public class AssignmentManager { } private void startAssignmentThread() { - // Get Server Thread name. Sometimes the Server is mocked so may not implement Thread. - // For example, in tests. - String name = master instanceof Thread? ((Thread)master).getName(): - master.getServerName().toShortString(); - assignThread = new Thread(name) { + assignThread = new Thread(master.getServerName().toShortString()) { @Override public void run() { while (isRunning()) {