2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.datastore.jmx.mbeans;
10 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
11 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
14 * Implementation of DatastoreConfigurationMXBean.
16 * @author Thomas Pantelis
18 public class DatastoreConfigurationMXBeanImpl extends AbstractMXBean implements DatastoreConfigurationMXBean {
19 public static final String JMX_CATEGORY_CONFIGURATION = "Configuration";
21 private DatastoreContext context;
23 public DatastoreConfigurationMXBeanImpl(String mxBeanType) {
24 super("Datastore", mxBeanType, JMX_CATEGORY_CONFIGURATION);
27 public void setContext(DatastoreContext context) {
28 this.context = context;
32 public long getShardTransactionIdleTimeoutInSeconds() {
33 return context.getShardTransactionIdleTimeout().toSeconds();
37 public long getOperationTimeoutInSeconds() {
38 return context.getOperationTimeoutInSeconds();
42 public long getShardHeartbeatIntervalInMillis() {
43 return context.getShardRaftConfig().getHeartBeatInterval().toMillis();
47 public int getShardJournalRecoveryLogBatchSize() {
48 return context.getShardRaftConfig().getJournalRecoveryLogBatchSize();
52 public long getShardIsolatedLeaderCheckIntervalInMillis() {
53 return context.getShardRaftConfig().getIsolatedCheckIntervalInMillis();
57 public long getShardElectionTimeoutFactor() {
58 return context.getShardRaftConfig().getElectionTimeoutFactor();
62 public int getShardSnapshotDataThresholdPercentage() {
63 return context.getShardRaftConfig().getSnapshotDataThresholdPercentage();
67 public long getShardSnapshotBatchCount() {
68 return context.getShardRaftConfig().getSnapshotBatchCount();
72 public long getShardTransactionCommitTimeoutInSeconds() {
73 return context.getShardTransactionCommitTimeoutInSeconds();
77 public int getShardTransactionCommitQueueCapacity() {
78 return context.getShardTransactionCommitQueueCapacity();
82 public long getShardInitializationTimeoutInSeconds() {
83 return context.getShardInitializationTimeout().duration().toSeconds();
87 public long getShardLeaderElectionTimeoutInSeconds() {
88 return context.getShardLeaderElectionTimeout().duration().toSeconds();
92 public boolean isPersistent() {
93 return context.isPersistent();
97 public long getTransactionCreationInitialRateLimit() {
98 return context.getTransactionCreationInitialRateLimit();
102 public int getMaxShardDataChangeExecutorPoolSize() {
103 return context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize();
107 public int getMaxShardDataChangeExecutorQueueSize() {
108 return context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize();
112 public int getMaxShardDataChangeListenerQueueSize() {
113 return context.getDataStoreProperties().getMaxDataChangeListenerQueueSize();
117 public int getMaxShardDataStoreExecutorQueueSize() {
118 return context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize();