You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Jing Zhao (JIRA)" <ji...@apache.org> on 2017/07/28 01:19:00 UTC
[jira] [Commented] (RATIS-94) Expose basic information over JMX
[ https://issues.apache.org/jira/browse/RATIS-94?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16104277#comment-16104277 ]
Jing Zhao commented on RATIS-94:
--------------------------------
Thanks for working on this, [~elek]. The patch looks good to me in general. Some comments:
# Currently we're using two spaces for indentation.
# In RaftServerMXBean, please make sure we're using the same javadoc style (starting with "/**").
# Can we directly use RaftPeer instead of creating a new RaftPeerInfo?
# "toString().toString()" is redundant.
{code}
171 ObjectName name =
172 new ObjectName("Ratis:service=RaftServer,group=" + getGroupId().toString().toString() + ",id=" + getId().toString());
{code}
# The following code should be "return RaftServerImpl.this.getGroupId().toString();".
{code}
959 @Override
960 public String getGroupId() {
961 return getGroupId().toString();
962 }
{code}
# {{getPeers}} can be renamed to {{getFollowers}}?
{code}
/**
* Addresses of the followers, only for leaders
*/
List<RaftPeerInfo> getPeers();
{code}
# There may be a race condition in the following code: the leaderState may be changed after the null check.
{code}
@Override
public List<RaftPeerInfo> getPeers() {
if (leaderState != null) {
return leaderState.getSenders().stream()
.map(appender -> appender.getFollower())
.map(follower -> new RaftPeerInfo(follower.getPeer().getId().toString(), follower.getPeer().getAddress().toString()))
.collect(Collectors.toList());
{code}
> Expose basic information over JMX
> ---------------------------------
>
> Key: RATIS-94
> URL: https://issues.apache.org/jira/browse/RATIS-94
> Project: Ratis
> Issue Type: Improvement
> Reporter: Elek, Marton
> Assignee: Elek, Marton
> Attachments: RATIS-94-1.patch
>
>
> To make it easier to debug the current state of the nodes the basic RatisServer information should be exposed over the JMX interface. Such as: role (leader,follower), latest term, index, follower peers (in case of LEADER)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)