HBASE-19919 Tidying up logging; ADDENDUM Fix tests w/ mocked Servers
This commit is contained in:
parent
06dec20582
commit
12f3c82a86
|
@ -121,8 +121,12 @@ public class SplitLogManager {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
this.server = master;
|
this.server = master;
|
||||||
this.conf = conf;
|
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 =
|
this.choreService =
|
||||||
new ChoreService(((HasThread)master).getName() + ".splitLogManager.");
|
new ChoreService(name + ".splitLogManager.");
|
||||||
if (server.getCoordinatedStateManager() != null) {
|
if (server.getCoordinatedStateManager() != null) {
|
||||||
SplitLogManagerCoordination coordination = getSplitLogManagerCoordination();
|
SplitLogManagerCoordination coordination = getSplitLogManagerCoordination();
|
||||||
Set<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());
|
Set<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());
|
||||||
|
|
|
@ -1624,7 +1624,11 @@ public class AssignmentManager implements ServerListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startAssignmentThread() {
|
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
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
while (isRunning()) {
|
while (isRunning()) {
|
||||||
|
|
Loading…
Reference in New Issue