Repository: hbase
Updated Branches:
  refs/heads/HBASE-19397-branch-2 754e4f7fb -> 88c4aa7ad (forced update)


HBASE-19919 Tidying up logging; ADDENDUM Fix tests w/ mocked Servers


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/00653a4d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/00653a4d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/00653a4d

Branch: refs/heads/HBASE-19397-branch-2
Commit: 00653a4d18b4e3a97c93d3fd9d44ed9b6149db53
Parents: 66a11f2
Author: Michael Stack <st...@apache.org>
Authored: Sat Feb 3 09:25:16 2018 -0800
Committer: Michael Stack <st...@apache.org>
Committed: Sat Feb 3 09:25:45 2018 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/master/SplitLogManager.java   | 6 +++++-
 .../hadoop/hbase/master/assignment/AssignmentManager.java      | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/00653a4d/hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
----------------------------------------------------------------------
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 63af398..2e2f8bf 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,8 +121,12 @@ public class SplitLogManager {
       throws IOException {
     this.server = master;
     this.conf = conf;
+    // Get Server Thread name. Sometimes the Server is mocked so may not 
implement HasThread.
+    // For example, in tests.
+    String name = master instanceof HasThread? ((HasThread)master).getName():
+        master.getServerName().toShortString();
     this.choreService =
-        new ChoreService(((HasThread)master).getName() + ".splitLogManager.");
+        new ChoreService(name + ".splitLogManager.");
     if (server.getCoordinatedStateManager() != null) {
       SplitLogManagerCoordination coordination = 
getSplitLogManagerCoordination();
       Set<String> failedDeletions = Collections.synchronizedSet(new 
HashSet<String>());

http://git-wip-us.apache.org/repos/asf/hbase/blob/00653a4d/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
----------------------------------------------------------------------
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 1f65230..e09b29b 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
@@ -1624,7 +1624,11 @@ public class AssignmentManager implements ServerListener 
{
   }
 
   private void startAssignmentThread() {
-    assignThread = new Thread(((HasThread)this.master).getName()) {
+    // Get Server Thread name. Sometimes the Server is mocked so may not 
implement HasThread.
+    // For example, in tests.
+    String name = master instanceof HasThread? ((HasThread)master).getName():
+        master.getServerName().toShortString();
+    assignThread = new Thread(name) {
       @Override
       public void run() {
         while (isRunning()) {

Reply via email to