Updated some of the SDN-IP log messages inside the IntentSynchronizer.

Also, fixed a typo in file TestIntentServiceHelper.java

Change-Id: I0c0f7ad0f5e02f80465fb643184e20924fd49153
This commit is contained in:
Pavlin Radoslavov 2014-11-26 11:59:11 -08:00
parent 6b7920ddaf
commit caf6337c46
2 changed files with 13 additions and 3 deletions

View File

@ -316,6 +316,12 @@ public class IntentSynchronizer {
} }
fetchedIntents.put(new IntentKey(intent), intent); fetchedIntents.put(new IntentKey(intent), intent);
} }
if (log.isDebugEnabled()) {
for (Intent intent: fetchedIntents.values()) {
log.debug("SDN-IP Intent Synchronizer: fetched intent: {}",
intent);
}
}
computeIntentsDelta(localIntents, fetchedIntents, computeIntentsDelta(localIntents, fetchedIntents,
storeInMemoryIntents, addIntents, storeInMemoryIntents, addIntents,
@ -370,6 +376,8 @@ public class IntentSynchronizer {
intent); intent);
} }
if (!isElectedLeader) { if (!isElectedLeader) {
log.debug("SDN-IP Intent Synchronizer: cannot withdraw intents: " +
"not elected leader anymore");
isActivatedLeader = false; isActivatedLeader = false;
return; return;
} }
@ -380,14 +388,16 @@ public class IntentSynchronizer {
builder = IntentOperations.builder(); builder = IntentOperations.builder();
for (Intent intent : addIntents) { for (Intent intent : addIntents) {
builder.addSubmitOperation(intent); builder.addSubmitOperation(intent);
log.debug("SDN-IP Intent Synchronizer: submitting intent: {}",
intent);
} }
if (!isElectedLeader) { if (!isElectedLeader) {
log.debug("SDN-IP Intent Synchronizer: cannot submit intents: " +
"not elected leader anymore");
isActivatedLeader = false; isActivatedLeader = false;
return; return;
} }
intentOperations = builder.build(); intentOperations = builder.build();
log.debug("SDN-IP Intent Synchronizer: submitting intents: {}",
intentOperations);
intentService.execute(intentOperations); intentService.execute(intentOperations);
if (isElectedLeader) { if (isElectedLeader) {

View File

@ -48,7 +48,7 @@ public final class TestIntentServiceHelper {
} }
/* /*
* EasyMock matcher that matches {@link Inten} but * EasyMock matcher that matches {@link Intent} but
* ignores the {@link IntentId} when matching. * ignores the {@link IntentId} when matching.
* <p/> * <p/>
* The normal intent equals method tests that the intent IDs are equal, * The normal intent equals method tests that the intent IDs are equal,