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 java.util.concurrent.TimeUnit;
11 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
12 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
15 * Implementation of DatastoreConfigurationMXBean.
17 * @author Thomas Pantelis
19 public class DatastoreConfigurationMXBeanImpl extends AbstractMXBean implements DatastoreConfigurationMXBean {
20 public static final String JMX_CATEGORY_CONFIGURATION = "Configuration";
22 private DatastoreContext context;
24 public DatastoreConfigurationMXBeanImpl(String mxBeanType) {
25 super("Datastore", mxBeanType, JMX_CATEGORY_CONFIGURATION);
28 public void setContext(DatastoreContext context) {
29 this.context = context;
33 public long getShardTransactionIdleTimeoutInSeconds() {
34 return context.getShardTransactionIdleTimeout().toSeconds();
38 public long getOperationTimeoutInSeconds() {
39 return TimeUnit.MILLISECONDS.toSeconds(context.getOperationTimeoutInMillis());
43 public long getShardHeartbeatIntervalInMillis() {
44 return context.getShardRaftConfig().getHeartBeatInterval().toMillis();
48 public int getShardJournalRecoveryLogBatchSize() {
49 return context.getShardRaftConfig().getJournalRecoveryLogBatchSize();
53 public long getShardIsolatedLeaderCheckIntervalInMillis() {
54 return context.getShardRaftConfig().getIsolatedCheckIntervalInMillis();
58 public long getShardElectionTimeoutFactor() {
59 return context.getShardRaftConfig().getElectionTimeoutFactor();
63 public int getShardSnapshotDataThresholdPercentage() {
64 return context.getShardRaftConfig().getSnapshotDataThresholdPercentage();
68 public long getShardSnapshotBatchCount() {
69 return context.getShardRaftConfig().getSnapshotBatchCount();
73 public long getShardTransactionCommitTimeoutInSeconds() {
74 return context.getShardTransactionCommitTimeoutInSeconds();
78 public long getShardCommitQueueExpiryTimeoutInSeconds() {
79 return TimeUnit.SECONDS.convert(context.getShardCommitQueueExpiryTimeoutInMillis(), TimeUnit.MILLISECONDS);
83 public int getShardTransactionCommitQueueCapacity() {
84 return context.getShardTransactionCommitQueueCapacity();
88 public long getShardInitializationTimeoutInSeconds() {
89 return context.getShardInitializationTimeout().duration().toSeconds();
93 public long getShardLeaderElectionTimeoutInSeconds() {
94 return context.getShardLeaderElectionTimeout().duration().toSeconds();
98 public boolean isPersistent() {
99 return context.isPersistent();
103 public long getTransactionCreationInitialRateLimit() {
104 return context.getTransactionCreationInitialRateLimit();
108 public boolean getTransactionContextDebugEnabled() {
109 return context.isTransactionDebugContextEnabled();
113 public int getMaxShardDataChangeExecutorPoolSize() {
114 return context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize();
118 public int getMaxShardDataChangeExecutorQueueSize() {
119 return context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize();
123 public int getMaxShardDataChangeListenerQueueSize() {
124 return context.getDataStoreProperties().getMaxDataChangeListenerQueueSize();
128 public int getMaxShardDataStoreExecutorQueueSize() {
129 return context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize();