You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by jeff saremi <je...@hotmail.com> on 2017/07/11 17:55:40 UTC

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();


Re: How to get a list of running tasks in hbase shell?

Posted by jeff saremi <je...@hotmail.com>.
Thanks very much Josh

________________________________
From: Josh Elser <el...@apache.org>
Sent: Thursday, July 13, 2017 11:44:52 AM
To: user@hbase.apache.org
Subject: Re: How to get a list of running tasks in hbase shell?

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 <je...@hotmail.com>
> Sent: Tuesday, July 11, 2017 10:55:40 AM
> To: user@hbase.apache.org
> 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();
>
>

Re: How to get a list of running tasks in hbase shell?

Posted by Josh Elser <el...@apache.org>.
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 <je...@hotmail.com>
> Sent: Tuesday, July 11, 2017 10:55:40 AM
> To: user@hbase.apache.org
> 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();
> 
> 

Re: How to get a list of running tasks in hbase shell?

Posted by jeff saremi <je...@hotmail.com>.
would someone throw this dog a bone please? thanks

________________________________
From: jeff saremi <je...@hotmail.com>
Sent: Tuesday, July 11, 2017 10:55:40 AM
To: user@hbase.apache.org
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();