2 * Copyright (c) 2014 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.md.sal.dom.store.impl;
11 * Holds configuration properties when creating an {@link InMemoryDOMDataStore} instance via the
12 * {@link InMemoryDOMDataStoreFactory}.
14 * @author Thomas Pantelis
15 * @see InMemoryDOMDataStoreFactory
17 * @deprecated Use {@link org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties} instead.
19 @Deprecated(forRemoval = true)
20 public final class InMemoryDOMDataStoreConfigProperties {
22 public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
23 public static final int DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
24 public static final int DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE = 1000;
25 public static final int DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE = 5000;
27 private static final InMemoryDOMDataStoreConfigProperties DEFAULT =
28 create(DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
29 DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE,
30 DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE,
31 DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE);
33 private final int maxDataChangeExecutorQueueSize;
34 private final int maxDataChangeExecutorPoolSize;
35 private final int maxDataChangeListenerQueueSize;
36 private final int maxDataStoreExecutorQueueSize;
39 * Constructs an instance with the given property values.
41 * @param maxDataChangeExecutorPoolSize
42 * maximum thread pool size for the data change notification executor.
43 * @param maxDataChangeExecutorQueueSize
44 * maximum queue size for the data change notification executor.
45 * @param maxDataChangeListenerQueueSize
46 * maximum queue size for the data change listeners.
47 * @param maxDataStoreExecutorQueueSize
48 * maximum queue size for the data store executor.
50 public static InMemoryDOMDataStoreConfigProperties create(int maxDataChangeExecutorPoolSize,
51 int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize,
52 int maxDataStoreExecutorQueueSize) {
53 return new InMemoryDOMDataStoreConfigProperties(maxDataChangeExecutorPoolSize,
54 maxDataChangeExecutorQueueSize, maxDataChangeListenerQueueSize,
55 maxDataStoreExecutorQueueSize);
58 public static InMemoryDOMDataStoreConfigProperties create(int maxDataChangeExecutorPoolSize,
59 int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize) {
60 return new InMemoryDOMDataStoreConfigProperties(maxDataChangeExecutorPoolSize,
61 maxDataChangeExecutorQueueSize, maxDataChangeListenerQueueSize,
62 DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE);
66 * Returns the InMemoryDOMDataStoreConfigProperties instance with default values.
68 public static InMemoryDOMDataStoreConfigProperties getDefault() {
72 private InMemoryDOMDataStoreConfigProperties(int maxDataChangeExecutorPoolSize,
73 int maxDataChangeExecutorQueueSize, int maxDataChangeListenerQueueSize,
74 int maxDataStoreExecutorQueueSize) {
75 this.maxDataChangeExecutorQueueSize = maxDataChangeExecutorQueueSize;
76 this.maxDataChangeExecutorPoolSize = maxDataChangeExecutorPoolSize;
77 this.maxDataChangeListenerQueueSize = maxDataChangeListenerQueueSize;
78 this.maxDataStoreExecutorQueueSize = maxDataStoreExecutorQueueSize;
82 * Returns the maximum queue size for the data change notification executor.
84 public int getMaxDataChangeExecutorQueueSize() {
85 return maxDataChangeExecutorQueueSize;
89 * Returns the maximum thread pool size for the data change notification executor.
91 public int getMaxDataChangeExecutorPoolSize() {
92 return maxDataChangeExecutorPoolSize;
96 * Returns the maximum queue size for the data change listeners.
98 public int getMaxDataChangeListenerQueueSize() {
99 return maxDataChangeListenerQueueSize;
103 * Returns the maximum queue size for the data store executor.
105 public int getMaxDataStoreExecutorQueueSize() {
106 return maxDataStoreExecutorQueueSize;