use of org.openkilda.messaging.model.SwitchAvailabilityData in project open-kilda by telstra.
the class SwitchMonitorServiceTest method matchAvailabilityData.
private boolean matchAvailabilityData(SwitchAvailabilityData expect, SwitchAvailabilityData actual) {
SwitchAvailabilityData expectSorted = sortSwitchAvailabilityData(expect);
SwitchAvailabilityData actualSorted = sortSwitchAvailabilityData(actual);
return Objects.equals(expectSorted, actualSorted);
}
use of org.openkilda.messaging.model.SwitchAvailabilityData in project open-kilda by telstra.
the class SwitchMonitor method makeDump.
private SwitchAvailabilityData makeDump() {
SwitchAvailabilityData.SwitchAvailabilityDataBuilder builder = SwitchAvailabilityData.builder();
Set<String> readWriteRegions = new HashSet<>();
for (SwitchAvailabilityEntry entry : readWriteConnects.dump()) {
readWriteRegions.add(entry.getRegionName());
builder.connection(entry);
}
for (SwitchAvailabilityEntry entry : readOnlyConnects.dump()) {
if (readWriteRegions.contains(entry.getRegionName())) {
continue;
}
builder.connection(entry);
}
return builder.build();
}
Aggregations