hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nauroth <cnaur...@hortonworks.com>
Subject Re: check decommission status
Date Thu, 29 Oct 2015 15:52:42 GMT
Hello Surbhi,

There is no public, stable Java API for this.  If you look at the
implementation of "hdfs dfsadmin -report", it involves downcasting from
the base FileSystem class to the concrete DistributedFileSystem, and then
calling DistributedFileSystem#getDataNodeStats.


You could potentially mimic this code from DFSAdmin, but please keep in
mind that you'd be calling internal APIs that do not come with a strong
stability guarantee.  We might evolve those APIs across releases in ways
that would break your application after upgrading to a later version.

Another more stable approach would be to parse the shell output of "hdfs
dfsadmin -report".  We offer a backward compatibility guarantee on shell

A third approach is to call the NameNode's HTTP server to get a JSON dump
of NameNode JMX metrics.  The NameNodeInfo MBean includes a "DecomNodes"
field with information about decommissioning nodes.  Here is a sample curl
call, assuming a NameNode running on localhost with its HTTP server
listening on port 50070.


More details on our compatibility policy are listed here in case you're


--Chris Nauroth

On 10/29/15, 8:40 AM, "Surbhi Gupta" <surbhi.gupta01@gmail.com> wrote:

>You can try nodetool netstats . If you find streaming happening from the
>decommission node to other node and vise versa then decommission is still
>going on .
>Sent from my iPhone
>> On Oct 28, 2015, at 10:54 PM, ram kumar <ramkumarrock3@gmail.com> wrote:
>> Hi,
>> Is there a java api to get decommission status for a particular data
>> Thanks.

View raw message