Adding logging for PlanCalc and Install
Change-Id: Id69e7893f3e6dd2ad1bd695476ecdbc346f0ea12
diff --git a/src/main/java/net/onrc/onos/intent/runtime/PlanInstallModule.java b/src/main/java/net/onrc/onos/intent/runtime/PlanInstallModule.java
index 45facb5..efe0116 100644
--- a/src/main/java/net/onrc/onos/intent/runtime/PlanInstallModule.java
+++ b/src/main/java/net/onrc/onos/intent/runtime/PlanInstallModule.java
@@ -8,6 +8,9 @@
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import net.floodlightcontroller.core.IFloodlightProviderService;
import net.floodlightcontroller.core.module.FloodlightModuleContext;
import net.floodlightcontroller.core.module.FloodlightModuleException;
@@ -29,6 +32,8 @@
private PlanCalcRuntime planCalc;
private PlanInstallRuntime planInstall;
private EventListener eventListener;
+ private final static Logger log = LoggerFactory.getLogger(PlanInstallModule.class);
+
private static final String PATH_INTENT_CHANNEL_NAME = "onos.pathintent";
@@ -64,12 +69,15 @@
}
private void processIntents(IntentOperationList intents) {
+ log.debug("Processing OperationList {}", intents);
List<Set<FlowEntry>> plan = planCalc.computePlan(intents);
+ log.debug("Plan: {}", plan);
planInstall.installPlan(plan);
}
@Override
public void entryAdded(IntentOperationList value) {
+ log.debug("Added OperationList {}", value);
intentQueue.add(value);
}
diff --git a/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java b/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java
index 3e4ff4a..82e0d23 100644
--- a/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java
+++ b/src/main/java/net/onrc/onos/intent/runtime/PlanInstallRuntime.java
@@ -12,6 +12,9 @@
import net.onrc.onos.ofcontroller.networkgraph.NetworkGraph;
import net.onrc.onos.ofcontroller.util.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
*
* @author Brian O'Connor <bocon@onlab.us>
@@ -22,6 +25,7 @@
NetworkGraph graph;
IFlowPusherService pusher;
IFloodlightProviderService provider;
+ private final static Logger log = LoggerFactory.getLogger(PlanInstallRuntime.class);
public PlanInstallRuntime(NetworkGraph graph,
IFloodlightProviderService provider,
@@ -33,6 +37,7 @@
public void installPlan(List<Set<FlowEntry>> plan) {
Map<Long,IOFSwitch> switches = provider.getSwitches();
+ log.debug("IOFSwitches: {}", switches);
for(Set<FlowEntry> phase : plan) {
Set<Pair<IOFSwitch, net.onrc.onos.ofcontroller.util.FlowEntry>> entries = new HashSet<>();
// convert flow entries and create pairs
@@ -40,6 +45,7 @@
entries.add(new Pair<>(switches.get(entry.getSwitch().getDpid()),
entry.getFlowEntry()));
}
+ log.debug("Pushing flow entries: {}", entries);
// push flow entries to switches
pusher.pushFlowEntries(entries);
// TODO: wait for confirmation messages before proceeding