HDFS-11003. Expose XmitsInProgress through DataNodeMXBean. Contributed By Brahma Reddy Battula
(cherry picked from commit 5f4ae85bd8
)
This commit is contained in:
parent
a0eee72053
commit
64e532393b
|
@ -2081,8 +2081,9 @@ public class DataNode extends ReconfigurableBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int getXmitsInProgress() {
|
@Override //DataNodeMXBean
|
||||||
|
public int getXmitsInProgress() {
|
||||||
return xmitsInProgress.get();
|
return xmitsInProgress.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,12 @@ public interface DataNodeMXBean {
|
||||||
*/
|
*/
|
||||||
public int getXceiverCount();
|
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.
|
* Gets the network error counts on a per-Datanode basis.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -90,7 +90,11 @@ public class TestDataNodeMXBean {
|
||||||
int xceiverCount = (Integer)mbs.getAttribute(mxbeanName,
|
int xceiverCount = (Integer)mbs.getAttribute(mxbeanName,
|
||||||
"XceiverCount");
|
"XceiverCount");
|
||||||
Assert.assertEquals(datanode.getXceiverCount(), 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,
|
String bpActorInfo = (String)mbs.getAttribute(mxbeanName,
|
||||||
"BPServiceActorInfo");
|
"BPServiceActorInfo");
|
||||||
Assert.assertEquals(datanode.getBPServiceActorInfo(), bpActorInfo);
|
Assert.assertEquals(datanode.getBPServiceActorInfo(), bpActorInfo);
|
||||||
|
|
Loading…
Reference in New Issue