Jonathan Hart

IntentManager: Don't compile all failed intents on every event

Also don't compile all failed on any Host event. Intents that care about
hosts should have that host tracked and react to changes in that host only.

ONOS-2978

Change-Id: I1f6b2b2fa31987cffff0f9a7a9aa0191dc1edbcf
......@@ -256,15 +256,16 @@ public class IntentManager
submit(intent);
}
// If required, compile all currently failed intents.
for (Intent intent : getIntents()) {
IntentState state = getIntentState(intent.key());
if ((compileAllFailed && RECOMPILE.contains(state))
|| intentAllowsPartialFailure(intent)) {
if (WITHDRAW.contains(state)) {
withdraw(intent);
} else {
submit(intent);
if (compileAllFailed) {
// If required, compile all currently failed intents.
for (Intent intent : getIntents()) {
IntentState state = getIntentState(intent.key());
if (RECOMPILE.contains(state) || intentAllowsPartialFailure(intent)) {
if (WITHDRAW.contains(state)) {
withdraw(intent);
} else {
submit(intent);
}
}
}
}
......
......@@ -415,9 +415,7 @@ public class ObjectiveTracker implements ObjectiveTrackerService {
@Override
public void event(HostEvent event) {
HostId id = event.subject().id();
HostEvent.Type type = event.type();
boolean available = (type == HostEvent.Type.HOST_ADDED);
executorService.execute(new DeviceAvailabilityHandler(id, available));
executorService.execute(new DeviceAvailabilityHandler(id, false));
}
}
......