HDFS-11003. Expose XmitsInProgress through DataNodeMXBean. Contributed By Brahma Reddy Battula

This commit is contained in:
Brahma Reddy Battula 2016-10-15 22:28:33 +05:30
parent 5ad037df25
commit 5f4ae85bd8
3 changed files with 14 additions and 3 deletions

View File

@ -2101,8 +2101,9 @@ public class DataNode extends ReconfigurableBase
}
}
}
int getXmitsInProgress() {
@Override //DataNodeMXBean
public int getXmitsInProgress() {
return xmitsInProgress.get();
}

View File

@ -100,6 +100,12 @@ public interface DataNodeMXBean {
*/
public int getXceiverCount();
/**
* Returns an estimate of the number of data replication/reconstruction tasks
* running currently.
*/
public int getXmitsInProgress();
/**
* Gets the network error counts on a per-Datanode basis.
*/

View File

@ -96,7 +96,11 @@ public class TestDataNodeMXBean {
int xceiverCount = (Integer)mbs.getAttribute(mxbeanName,
"XceiverCount");
Assert.assertEquals(datanode.getXceiverCount(), xceiverCount);
// Ensure mxbean's XmitsInProgress is same as the DataNode's
// live value.
int xmitsInProgress =
(Integer) mbs.getAttribute(mxbeanName, "XmitsInProgress");
Assert.assertEquals(datanode.getXmitsInProgress(), xmitsInProgress);
String bpActorInfo = (String)mbs.getAttribute(mxbeanName,
"BPServiceActorInfo");
Assert.assertEquals(datanode.getBPServiceActorInfo(), bpActorInfo);