TaskMonitor is probably relying on the fact that it's invoked inside of
the RegionServer/Master process (note the maven module and the fact that
it's a template file for the webUI).
You would have to invoke an RPC to the server to get the list of Tasks.
I'm not sure if such an RPC already exists.
On 7/13/17 12:45 PM, jeff saremi wrote:
would someone throw this dog a bone please? thanks
________________________________
From: jeff saremi <[email protected]>
Sent: Tuesday, July 11, 2017 10:55:40 AM
To: [email protected]
Subject: How to get a list of running tasks in hbase shell?
I sent this earlier in another thread. Thought i'd create its own to get an
answer. thanks
How do you get an instance of TaskMonitor in Jruby (bin/hbase shell)?
I tried the following and didn't result in anything:
-------------------------------------------------------------------------------------------------------------
taskmonitor = org.apache.hadoop.hbase.monitoring.TaskMonitor.get
taskmonitor.get_tasks.each do |task|
printf("%s\r\n", task.to_string)
end
exit
-------------------------------------------------------------------------------------------------------------
I was trying to mimic the following code in
"hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/common/TaskMonitorTmpl.jamon"
TaskMonitor taskMonitor = TaskMonitor.get();
...
List<? extends MonitoredTask> tasks = taskMonitor.getTasks();