final SyncupEntry syncupEntry) throws InterruptedException {
try {
compressionGuard.acquire();
- final boolean newFutureNecessary = updateCompressionState(flowcapableNodePath, syncupEntry);
- if (newFutureNecessary) {
+ final boolean newTaskNecessary = updateCompressionState(flowcapableNodePath, syncupEntry);
+ if (newTaskNecessary) {
super.syncup(flowcapableNodePath, syncupEntry);
}
return Futures.immediateFuture(true);
}
/**
- * If there is config delta in compression queue for the device and new configuration is coming,
- * update its zip queue entry. Create/replace zip queue entry for the device with operational delta otherwise.
+ * If a syncup entry for corresponding the device is present in compression queue and new configuration diff is
+ * coming - update the entry in compression queue (zip). Create new (no entry in queue for device) or replace
+ * entry (config vs. operational is coming) in queue otherwise.
*/
private boolean updateCompressionState(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
final SyncupEntry syncupEntry) {
final SyncupEntry previousEntry = compressionQueue.get(flowcapableNodePath);
-
- if (previousEntry != null && syncupEntry.isOptimizedConfigDelta() && previousEntry.isOptimizedConfigDelta()) {
+ if (previousEntry != null && syncupEntry.isOptimizedConfigDelta()) {
updateOptimizedConfigDelta(flowcapableNodePath, syncupEntry, previousEntry);
} else {
compressionQueue.put(flowcapableNodePath, syncupEntry);
final CountDownLatch latchForFirst = new CountDownLatch(1);
final CountDownLatch latchForNext = new CountDownLatch(1);
- final SyncupEntry first = new SyncupEntry(dataBefore, configDS, null, configDS);
+ final SyncupEntry first = new SyncupEntry(dataBefore, configDS, null, operationalDS);
final SyncupEntry second = new SyncupEntry(dataAfter, configDS, dataBefore, configDS);
final SyncupEntry third = new SyncupEntry(null, configDS, dataAfter, configDS);
final SyncupEntry fourth = new SyncupEntry(dataAfter2, configDS, null, configDS);