HBASE-4386 Fix a potential NPE in TaskMonitor
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1179479 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ead9159ecd
commit
3d156a5a24
|
@ -339,6 +339,7 @@ Release 0.92.0 - Unreleased
|
|||
HBASE-4494 AvroServer:: get fails with NPE on a non-existent row
|
||||
(Kay Kay)
|
||||
HBASE-4481 TestMergeTool failed in 0.92 build 20
|
||||
HBASE-4386 Fix a potential NPE in TaskMonitor (todd)
|
||||
|
||||
TESTS
|
||||
HBASE-4450 test for number of blocks read: to serve as baseline for expected
|
||||
|
|
|
@ -72,7 +72,9 @@ public class TaskMonitor {
|
|||
new Class<?>[] { MonitoredTask.class },
|
||||
new PassthroughInvocationHandler<MonitoredTask>(stat));
|
||||
TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
|
||||
tasks.add(pair);
|
||||
synchronized (this) {
|
||||
tasks.add(pair);
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
|
||||
|
@ -84,7 +86,9 @@ public class TaskMonitor {
|
|||
new Class<?>[] { MonitoredRPCHandler.class },
|
||||
new PassthroughInvocationHandler<MonitoredRPCHandler>(stat));
|
||||
TaskAndWeakRefPair pair = new TaskAndWeakRefPair(stat, proxy);
|
||||
tasks.add(pair);
|
||||
synchronized (this) {
|
||||
tasks.add(pair);
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
|
||||
|
@ -142,7 +146,7 @@ public class TaskMonitor {
|
|||
public void dumpAsText(PrintWriter out) {
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
List<MonitoredTask> tasks = TaskMonitor.get().getTasks();
|
||||
List<MonitoredTask> tasks = getTasks();
|
||||
for (MonitoredTask task : tasks) {
|
||||
out.println("Task: " + task.getDescription());
|
||||
out.println("Status: " + task.getState() + ":" + task.getStatus());
|
||||
|
|
Loading…
Reference in New Issue