HBASE-24475 Clean up the master thread name getting in SplitLogManager and AssignmentManager (#1810)

This commit is contained in:
bsglz 2020-05-31 13:23:04 +08:00 committed by GitHub
parent c120260bce
commit b4a4debdd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View File

@ -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<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());

View File

@ -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()) {