Search in sources :

Example 1 with DefaultBatchHandler

use of org.opendaylight.genius.utils.batching.DefaultBatchHandler in project genius by opendaylight.

the class ITMBatchingUtils method registerWithBatchManager.

public static void registerWithBatchManager(DataBroker broker) {
    ITMBatchingUtils.setBroker(broker);
    Integer batchSize = Integer.getInteger("batch.size", DEF_BATCH_SIZE);
    Integer batchInterval = Integer.getInteger("batch.wait.time", DEF_PERIODICITY);
    ResourceBatchingManager resBatchingManager = ResourceBatchingManager.getInstance();
    resBatchingManager.registerBatchableResource("ITM-DEFAULT-OPERATIONAL", defaultOperationalShardBufferQ, new DefaultBatchHandler(broker, LogicalDatastoreType.OPERATIONAL, batchSize, batchInterval));
    resBatchingManager.registerBatchableResource("ITM-DEFAULT-CONFIG", defaultConfigShardBufferQ, new DefaultBatchHandler(broker, LogicalDatastoreType.CONFIGURATION, batchSize, batchInterval));
}
Also used : ResourceBatchingManager(org.opendaylight.genius.utils.batching.ResourceBatchingManager) DefaultBatchHandler(org.opendaylight.genius.utils.batching.DefaultBatchHandler)

Example 2 with DefaultBatchHandler

use of org.opendaylight.genius.utils.batching.DefaultBatchHandler in project netvirt by opendaylight.

the class BgpUtil method init.

@PostConstruct
public void init() {
    ResourceBatchingManager resBatchingManager = ResourceBatchingManager.getInstance();
    Integer batchSize = Integer.getInteger("batch.size", DEFAULT_BATCH_SIZE);
    Integer batchInterval = Integer.getInteger("batch.wait.time", DEFAULT_BATCH_INTERVAL);
    resBatchingManager.registerBatchableResource(RESOURCE_TYPE, bgpResourcesBufferQ, new DefaultBatchHandler(dataBroker, LogicalDatastoreType.CONFIGURATION, batchSize, batchInterval));
}
Also used : ResourceBatchingManager(org.opendaylight.genius.utils.batching.ResourceBatchingManager) DefaultBatchHandler(org.opendaylight.genius.utils.batching.DefaultBatchHandler) PostConstruct(javax.annotation.PostConstruct)

Aggregations

DefaultBatchHandler (org.opendaylight.genius.utils.batching.DefaultBatchHandler)2 ResourceBatchingManager (org.opendaylight.genius.utils.batching.ResourceBatchingManager)2 PostConstruct (javax.annotation.PostConstruct)1