当前位置: 首页>>代码示例>>Java>>正文


Java InMemoryDOMDataStoreConfigProperties类代码示例

本文整理汇总了Java中org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties的典型用法代码示例。如果您正苦于以下问题:Java InMemoryDOMDataStoreConfigProperties类的具体用法?Java InMemoryDOMDataStoreConfigProperties怎么用?Java InMemoryDOMDataStoreConfigProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InMemoryDOMDataStoreConfigProperties类属于org.opendaylight.controller.md.sal.dom.store.impl包,在下文中一共展示了InMemoryDOMDataStoreConfigProperties类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createInstance

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
@Override
public java.lang.AutoCloseable createInstance() {
    InMemoryDOMDataStore dataStore = InMemoryDOMDataStoreFactory.create("DOM-CFG",
        LogicalDatastoreType.CONFIGURATION, getSchemaServiceDependency(), getDebugTransactions(),
        InMemoryDOMDataStoreConfigProperties.create(getMaxDataChangeExecutorPoolSize(),
            getMaxDataChangeExecutorQueueSize(), getMaxDataChangeListenerQueueSize(),
            getMaxDataStoreExecutorQueueSize()));

    InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryConfigDataStore", dataStore);
    dataStore.setCloseable(statsBean);

    return dataStore;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:InMemoryConfigDataStoreProviderModule.java

示例2: createInstance

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
@Override
public java.lang.AutoCloseable createInstance() {
    InMemoryDOMDataStore dataStore = InMemoryDOMDataStoreFactory.create("DOM-OPER",
        LogicalDatastoreType.OPERATIONAL, getSchemaServiceDependency(), getDebugTransactions(),
        InMemoryDOMDataStoreConfigProperties.create(getMaxDataChangeExecutorPoolSize(),
            getMaxDataChangeExecutorQueueSize(), getMaxDataChangeListenerQueueSize(),
            getMaxDataStoreExecutorQueueSize()));

    InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryOperationalDataStore", dataStore);

    dataStore.setCloseable(statsBean);

    return dataStore;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:InMemoryOperationalDataStoreProviderModule.java

示例3: build

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
@Override
public DatastoreContext build() {
    datastoreContext.dataStoreProperties = InMemoryDOMDataStoreConfigProperties.create(
            maxShardDataChangeExecutorPoolSize, maxShardDataChangeExecutorQueueSize,
            maxShardDataChangeListenerQueueSize, maxShardDataStoreExecutorQueueSize);

    if (datastoreContext.dataStoreName != null) {
        GLOBAL_DATASTORE_NAMES.add(datastoreContext.dataStoreName);
    }

    return datastoreContext;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:DatastoreContext.java

示例4: testNewBuilderWithDefaultSettings

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
@Test
public void testNewBuilderWithDefaultSettings() {
    DatastoreContext context = DatastoreContext.newBuilder().build();

    assertEquals(DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT, context.getShardTransactionIdleTimeout());
    assertEquals(DEFAULT_OPERATION_TIMEOUT_IN_MS, context.getOperationTimeoutInMillis());
    assertEquals(DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS, context.getShardTransactionCommitTimeoutInSeconds());
    assertEquals(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE,
            context.getShardRaftConfig().getJournalRecoveryLogBatchSize());
    assertEquals(DEFAULT_SNAPSHOT_BATCH_COUNT, context.getShardRaftConfig().getSnapshotBatchCount());
    assertEquals(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS,
            context.getShardRaftConfig().getHeartBeatInterval().length());
    assertEquals(DEFAULT_SHARD_TX_COMMIT_QUEUE_CAPACITY, context.getShardTransactionCommitQueueCapacity());
    assertEquals(DEFAULT_SHARD_INITIALIZATION_TIMEOUT.duration().toMillis(),
            context.getShardInitializationTimeout().duration().toMillis());
    assertEquals(DEFAULT_SHARD_LEADER_ELECTION_TIMEOUT.duration().toMillis(),
            context.getShardLeaderElectionTimeout().duration().toMillis());
    assertEquals(DEFAULT_PERSISTENT, context.isPersistent());
    assertEquals(DEFAULT_CONFIGURATION_READER, context.getConfigurationReader());
    assertEquals(DEFAULT_ISOLATED_LEADER_CHECK_INTERVAL_IN_MILLIS,
            context.getShardRaftConfig().getIsolatedCheckIntervalInMillis());
    assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE,
            context.getShardRaftConfig().getSnapshotDataThresholdPercentage());
    assertEquals(DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR, context.getShardRaftConfig().getElectionTimeoutFactor());
    assertEquals(DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT, context.getTransactionCreationInitialRateLimit());
    assertEquals(DatastoreContext.DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT,
            context.getShardBatchedModificationCount());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
            context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE,
            context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE,
            context.getDataStoreProperties().getMaxDataChangeListenerQueueSize());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE,
            context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize());
    assertEquals(DEFAULT_MAX_MESSAGE_SLICE_SIZE, context.getMaximumMessageSliceSize());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:38,代码来源:DatastoreContextTest.java

示例5: verifyCustomSettings

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
private static void verifyCustomSettings(DatastoreContext context) {
    assertEquals(DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT.toMillis() + 1,
            context.getShardTransactionIdleTimeout().toMillis());
    assertEquals(TimeUnit.MILLISECONDS.toSeconds(DEFAULT_OPERATION_TIMEOUT_IN_MS) + 1,
            TimeUnit.MILLISECONDS.toSeconds(context.getOperationTimeoutInMillis()));
    assertEquals(DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS + 1,
            context.getShardTransactionCommitTimeoutInSeconds());
    assertEquals(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE + 1,
            context.getShardRaftConfig().getJournalRecoveryLogBatchSize());
    assertEquals(DEFAULT_SNAPSHOT_BATCH_COUNT + 1, context.getShardRaftConfig().getSnapshotBatchCount());
    assertEquals(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS + 1,
            context.getShardRaftConfig().getHeartBeatInterval().length());
    assertEquals(DEFAULT_SHARD_TX_COMMIT_QUEUE_CAPACITY + 1, context.getShardTransactionCommitQueueCapacity());
    assertEquals(DEFAULT_SHARD_INITIALIZATION_TIMEOUT.duration().toMillis() + 1,
            context.getShardInitializationTimeout().duration().toMillis());
    assertEquals(DEFAULT_SHARD_LEADER_ELECTION_TIMEOUT.duration().toMillis() + 1,
            context.getShardLeaderElectionTimeout().duration().toMillis());
    assertEquals(!DEFAULT_PERSISTENT, context.isPersistent());
    assertEquals(DEFAULT_CONFIGURATION_READER, context.getConfigurationReader());
    assertEquals(DEFAULT_ISOLATED_LEADER_CHECK_INTERVAL_IN_MILLIS + 1,
            context.getShardRaftConfig().getIsolatedCheckIntervalInMillis());
    assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE + 1,
            context.getShardRaftConfig().getSnapshotDataThresholdPercentage());
    assertEquals(DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR + 1,
            context.getShardRaftConfig().getElectionTimeoutFactor());
    assertEquals(DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT + 1, context.getTransactionCreationInitialRateLimit());
    assertEquals(DatastoreContext.DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT + 1,
            context.getShardBatchedModificationCount());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE + 1,
            context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE + 1,
            context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE + 1,
            context.getDataStoreProperties().getMaxDataChangeListenerQueueSize());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE + 1,
            context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize());
    assertEquals(DEFAULT_MAX_MESSAGE_SLICE_SIZE + 1, context.getMaximumMessageSliceSize());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:39,代码来源:DatastoreContextTest.java

示例6: testUpdateWithInvalidValues

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
@Test
public void testUpdateWithInvalidValues() {
    DatastoreContext context = DatastoreContext.newBuilder()
            .logicalStoreType(LogicalDatastoreType.OPERATIONAL).build();
    final DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(context);

    final Map<String, Object> properties = new HashMap<>();
    properties.put("shard-transaction-idle-timeout-in-minutes", "0"); // bad - must be > 0
    properties.put("shard-journal-recovery-log-batch-size", "199");
    properties.put("shard-transaction-commit-timeout-in-seconds", "bogus"); // bad - NaN
    properties.put("shard-snapshot-batch-count", "212"); // good
    properties.put("operation-timeout-in-seconds", "4"); // bad - must be >= 5
    properties.put("shard-heartbeat-interval-in-millis", "99"); // bad - must be >= 100
    properties.put("shard-transaction-commit-queue-capacity", "567"); // good
    properties.put("shard-snapshot-data-threshold-percentage", "101"); // bad - must be 0-100
    properties.put("shard-initialization-timeout-in-seconds", "-1"); // bad - must be > 0
    properties.put("max-shard-data-change-executor-pool-size", "bogus"); // bad - NaN
    properties.put("unknownProperty", "1"); // bad - invalid property name

    final boolean updated = introspector.update(properties);
    assertEquals("updated", true, updated);
    context = introspector.getContext();

    assertEquals(DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT, context.getShardTransactionIdleTimeout());
    assertEquals(199, context.getShardRaftConfig().getJournalRecoveryLogBatchSize());
    assertEquals(DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS, context.getShardTransactionCommitTimeoutInSeconds());
    assertEquals(212, context.getShardRaftConfig().getSnapshotBatchCount());
    assertEquals(DEFAULT_OPERATION_TIMEOUT_IN_MS, context.getOperationTimeoutInMillis());
    assertEquals(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS,
            context.getShardRaftConfig().getHeartBeatInterval().length());
    assertEquals(567, context.getShardTransactionCommitQueueCapacity());
    assertEquals(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE,
            context.getShardRaftConfig().getSnapshotDataThresholdPercentage());
    assertEquals(DEFAULT_SHARD_INITIALIZATION_TIMEOUT, context.getShardInitializationTimeout());
    assertEquals(InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE,
            context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:38,代码来源:DatastoreContextIntrospectorTest.java

示例7: getDataStoreProperties

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
public InMemoryDOMDataStoreConfigProperties getDataStoreProperties() {
    return dataStoreProperties;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:4,代码来源:DatastoreContext.java

示例8: testNewBuilderWithCustomSettings

import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties; //导入依赖的package包/类
@Test
public void testNewBuilderWithCustomSettings() {
    DatastoreContext.Builder builder = DatastoreContext.newBuilder();

    builder.shardTransactionIdleTimeout(DEFAULT_SHARD_TRANSACTION_IDLE_TIMEOUT.toMillis() + 1,
            TimeUnit.MILLISECONDS);
    builder.operationTimeoutInSeconds((int) (TimeUnit.MILLISECONDS.toSeconds(DEFAULT_OPERATION_TIMEOUT_IN_MS) + 1));
    builder.shardTransactionCommitTimeoutInSeconds(DEFAULT_SHARD_TX_COMMIT_TIMEOUT_IN_SECONDS + 1);
    builder.shardJournalRecoveryLogBatchSize(DEFAULT_JOURNAL_RECOVERY_BATCH_SIZE + 1);
    builder.shardSnapshotBatchCount(DEFAULT_SNAPSHOT_BATCH_COUNT + 1);
    builder.shardHeartbeatIntervalInMillis(DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS + 1);
    builder.shardTransactionCommitQueueCapacity(DEFAULT_SHARD_TX_COMMIT_QUEUE_CAPACITY + 1);
    builder.shardInitializationTimeout(DEFAULT_SHARD_INITIALIZATION_TIMEOUT
            .duration().toMillis() + 1, TimeUnit.MILLISECONDS);
    builder.shardInitializationTimeout(DEFAULT_SHARD_INITIALIZATION_TIMEOUT.duration().toMillis() + 1,
            TimeUnit.MILLISECONDS);
    builder.shardLeaderElectionTimeout(DEFAULT_SHARD_LEADER_ELECTION_TIMEOUT.duration().toMillis() + 1,
            TimeUnit.MILLISECONDS);
    builder.persistent(!DEFAULT_PERSISTENT);
    builder.shardIsolatedLeaderCheckIntervalInMillis(DEFAULT_ISOLATED_LEADER_CHECK_INTERVAL_IN_MILLIS + 1);
    builder.shardSnapshotDataThresholdPercentage(DEFAULT_SHARD_SNAPSHOT_DATA_THRESHOLD_PERCENTAGE + 1);
    builder.shardElectionTimeoutFactor(DEFAULT_SHARD_ELECTION_TIMEOUT_FACTOR + 1);
    builder.transactionCreationInitialRateLimit(DEFAULT_TX_CREATION_INITIAL_RATE_LIMIT + 1);
    builder.shardBatchedModificationCount(DEFAULT_SHARD_BATCHED_MODIFICATION_COUNT + 1);
    builder.maxShardDataChangeExecutorPoolSize(
            InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE + 1);
    builder.maxShardDataChangeExecutorQueueSize(
            InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE + 1);
    builder.maxShardDataChangeListenerQueueSize(
            InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE + 1);
    builder.maxShardDataStoreExecutorQueueSize(
            InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_STORE_EXECUTOR_QUEUE_SIZE + 1);
    builder.maximumMessageSliceSize(DEFAULT_MAX_MESSAGE_SLICE_SIZE + 1);

    DatastoreContext context = builder.build();

    verifyCustomSettings(context);

    builder = DatastoreContext.newBuilderFrom(context);

    DatastoreContext newContext = builder.build();

    verifyCustomSettings(newContext);

    Assert.assertNotSame(context, newContext);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:47,代码来源:DatastoreContextTest.java


注:本文中的org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreConfigProperties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。