Search in sources :

Example 1 with RaftServerMXBean

use of org.apache.ratis.server.RaftServerMXBean in project incubator-ratis by apache.

the class TestRaftServerJmx method runRegister.

static void runRegister(boolean expectToSucceed, String name, JmxRegister jmx) {
    final RaftServerMXBean mBean = new RaftServerMXBean() {

        @Override
        public String getId() {
            return null;
        }

        @Override
        public String getLeaderId() {
            return null;
        }

        @Override
        public long getCurrentTerm() {
            return 0;
        }

        @Override
        public String getGroupId() {
            return null;
        }

        @Override
        public String getRole() {
            return null;
        }

        @Override
        public List<String> getFollowers() {
            return null;
        }
    };
    final RaftPeerId id = RaftPeerId.valueOf(name);
    final RaftGroupId groupId = RaftGroupId.randomId();
    final boolean succeeded = RaftServerImpl.registerMBean(id, groupId, mBean, jmx);
    Assert.assertEquals(expectToSucceed, succeeded);
}
Also used : RaftGroupId(org.apache.ratis.protocol.RaftGroupId) RaftPeerId(org.apache.ratis.protocol.RaftPeerId) RaftServerMXBean(org.apache.ratis.server.RaftServerMXBean)

Aggregations

RaftGroupId (org.apache.ratis.protocol.RaftGroupId)1 RaftPeerId (org.apache.ratis.protocol.RaftPeerId)1 RaftServerMXBean (org.apache.ratis.server.RaftServerMXBean)1