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

Ported from master.

Change-Id: I1f6b2b2fa31987cffff0f9a7a9aa0191dc1edbcf
......@@ -256,11 +256,11 @@ public class IntentManager
submit(intent);
}
if (compileAllFailed) {
// If required, compile all currently failed intents.
for (Intent intent : getIntents()) {
IntentState state = getIntentState(intent.key());
if ((compileAllFailed && RECOMPILE.contains(state))
|| intentAllowsPartialFailure(intent)) {
if (RECOMPILE.contains(state) || intentAllowsPartialFailure(intent)) {
if (WITHDRAW.contains(state)) {
withdraw(intent);
} else {
......@@ -268,6 +268,7 @@ public class IntentManager
}
}
}
}
//FIXME
// for (ApplicationId appId : batches.keySet()) {
......
......@@ -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));
}
}
......