use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPoolBuilder in project genius by opendaylight.
the class IdHolderSyncJob method call.
@Override
public List<ListenableFuture<Void>> call() {
IdPoolBuilder idPool = new IdPoolBuilder().setKey(new IdPoolKey(localPoolName));
idHolder.refreshDataStore(idPool);
InstanceIdentifier<IdPool> localPoolInstanceIdentifier = idUtils.getIdPoolInstance(localPoolName);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
tx.merge(CONFIGURATION, localPoolInstanceIdentifier, idPool.build(), true);
idUtils.incrementPoolUpdatedMap(localPoolName);
if (LOG.isDebugEnabled()) {
LOG.debug("IdHolder synced {}", idHolder);
}
}));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPoolBuilder in project genius by opendaylight.
the class LocalPoolCreateJob method call.
@Override
public List<ListenableFuture<Void>> call() {
String localPoolName = idLocalPool.getPoolName();
if (LOG.isDebugEnabled()) {
LOG.debug("Started localPoolCreateJob for {}", localPoolName);
}
InstanceIdentifier<IdPool> localPoolInstanceIdentifier = idUtils.getIdPoolInstance(localPoolName);
IdPoolBuilder idPool = new IdPoolBuilder().setKey(new IdPoolKey(localPoolName)).setBlockSize(blockSize).setParentPoolName(parentPoolName).setPoolName(localPoolName);
idLocalPool.getAvailableIds().refreshDataStore(idPool);
idLocalPool.getReleasedIds().refreshDataStore(idPool);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.CONFIGURATION, localPoolInstanceIdentifier, idPool.build(), WriteTransaction.CREATE_MISSING_PARENTS)));
}
Aggregations