blob: d17928857f2f11e8007772e7601aa93020e08809 [file] [log] [blame]
Madan Jampani38a88212015-09-15 11:21:27 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Madan Jampani38a88212015-09-15 11:21:27 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.store.host.impl;
17
alshabib8a4a6002015-11-25 14:31:16 -080018import com.google.common.collect.ImmutableSet;
19import com.google.common.collect.Sets;
Madan Jampanic7f49f92015-12-10 11:35:06 -080020
Madan Jampani38a88212015-09-15 11:21:27 -070021import org.apache.felix.scr.annotations.Activate;
22import org.apache.felix.scr.annotations.Component;
23import org.apache.felix.scr.annotations.Deactivate;
24import org.apache.felix.scr.annotations.Reference;
25import org.apache.felix.scr.annotations.ReferenceCardinality;
26import org.apache.felix.scr.annotations.Service;
27import org.onlab.packet.IpAddress;
28import org.onlab.packet.MacAddress;
29import org.onlab.packet.VlanId;
30import org.onlab.util.KryoNamespace;
31import org.onosproject.net.Annotations;
32import org.onosproject.net.ConnectPoint;
33import org.onosproject.net.DefaultAnnotations;
34import org.onosproject.net.DefaultHost;
35import org.onosproject.net.DeviceId;
36import org.onosproject.net.Host;
37import org.onosproject.net.HostId;
Brian O'Connorf107bd72015-09-21 15:31:03 -070038import org.onosproject.net.HostLocation;
Madan Jampani38a88212015-09-15 11:21:27 -070039import org.onosproject.net.host.HostDescription;
40import org.onosproject.net.host.HostEvent;
41import org.onosproject.net.host.HostStore;
42import org.onosproject.net.host.HostStoreDelegate;
Madan Jampani38a88212015-09-15 11:21:27 -070043import org.onosproject.net.provider.ProviderId;
44import org.onosproject.store.AbstractStore;
45import org.onosproject.store.serializers.KryoNamespaces;
alshabib8a4a6002015-11-25 14:31:16 -080046import org.onosproject.store.service.ConsistentMap;
47import org.onosproject.store.service.MapEvent;
48import org.onosproject.store.service.MapEventListener;
49import org.onosproject.store.service.Serializer;
Madan Jampani38a88212015-09-15 11:21:27 -070050import org.onosproject.store.service.StorageService;
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +053051import org.onosproject.store.service.DistributedPrimitive.Status;
Madan Jampani38a88212015-09-15 11:21:27 -070052import org.slf4j.Logger;
53
alshabib8a4a6002015-11-25 14:31:16 -080054import java.util.Collection;
55import java.util.HashSet;
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +053056import java.util.Iterator;
alshabib8a4a6002015-11-25 14:31:16 -080057import java.util.Map;
58import java.util.Objects;
59import java.util.Set;
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +053060import java.util.concurrent.ConcurrentHashMap;
61import java.util.concurrent.ScheduledExecutorService;
62import java.util.function.Consumer;
alshabib8a4a6002015-11-25 14:31:16 -080063import java.util.function.Predicate;
64import java.util.stream.Collectors;
65
66import static com.google.common.base.Preconditions.checkNotNull;
67import static com.google.common.base.Preconditions.checkState;
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +053068import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
69import static org.onlab.util.Tools.groupedThreads;
alshabib8a4a6002015-11-25 14:31:16 -080070import static org.onosproject.net.DefaultAnnotations.merge;
71import static org.onosproject.net.host.HostEvent.Type.*;
72import static org.slf4j.LoggerFactory.getLogger;
Madan Jampani38a88212015-09-15 11:21:27 -070073
74/**
75 * Manages the inventory of hosts using a {@code EventuallyConsistentMap}.
76 */
77@Component(immediate = true)
78@Service
alshabib8a4a6002015-11-25 14:31:16 -080079public class DistributedHostStore
Madan Jampani38a88212015-09-15 11:21:27 -070080 extends AbstractStore<HostEvent, HostStoreDelegate>
81 implements HostStore {
82
83 private final Logger log = getLogger(getClass());
84
85 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
86 protected StorageService storageService;
87
Madan Jampanic6371882016-06-03 21:30:17 -070088 private ConsistentMap<HostId, DefaultHost> hostsConsistentMap;
alshabib8a4a6002015-11-25 14:31:16 -080089 private Map<HostId, DefaultHost> hosts;
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +053090 private Map<IpAddress, Set<Host>> hostsByIp;
alshabib8a4a6002015-11-25 14:31:16 -080091 private MapEventListener<HostId, DefaultHost> hostLocationTracker =
Madan Jampani38a88212015-09-15 11:21:27 -070092 new HostLocationTracker();
93
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +053094 private ScheduledExecutorService executor;
95
96 private Consumer<Status> statusChangeListener;
97
Madan Jampani38a88212015-09-15 11:21:27 -070098 @Activate
99 public void activate() {
100 KryoNamespace.Builder hostSerializer = KryoNamespace.newBuilder()
Jonathan Hart38feb6e2016-08-29 22:54:16 +0000101 .register(KryoNamespaces.API);
Madan Jampanic6371882016-06-03 21:30:17 -0700102 hostsConsistentMap = storageService.<HostId, DefaultHost>consistentMapBuilder()
Madan Jampani38a88212015-09-15 11:21:27 -0700103 .withName("onos-hosts")
alshabib8a4a6002015-11-25 14:31:16 -0800104 .withRelaxedReadConsistency()
105 .withSerializer(Serializer.using(hostSerializer.build()))
Madan Jampani38a88212015-09-15 11:21:27 -0700106 .build();
Charles Chan35a32322017-08-14 11:42:11 -0700107 hostsConsistentMap.addListener(hostLocationTracker);
Madan Jampanic6371882016-06-03 21:30:17 -0700108 hosts = hostsConsistentMap.asJavaMap();
alshabib8a4a6002015-11-25 14:31:16 -0800109
Charles Chan35c06ac2018-04-19 15:11:23 -0700110 executor = newSingleThreadScheduledExecutor(groupedThreads("onos/hosts", "status-listener", log));
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530111 statusChangeListener = status -> {
112 if (status == Status.ACTIVE) {
113 executor.execute(this::loadHostsByIp);
114 }
115 };
116 hostsConsistentMap.addStatusChangeListener(statusChangeListener);
117 loadHostsByIp();
Madan Jampani38a88212015-09-15 11:21:27 -0700118 log.info("Started");
119 }
120
121 @Deactivate
122 public void deactivate() {
Madan Jampanic6371882016-06-03 21:30:17 -0700123 hostsConsistentMap.removeListener(hostLocationTracker);
Charles Chan35c06ac2018-04-19 15:11:23 -0700124 executor.shutdown();
Charles Chan35a32322017-08-14 11:42:11 -0700125
Madan Jampani38a88212015-09-15 11:21:27 -0700126 log.info("Stopped");
127 }
128
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530129 private void loadHostsByIp() {
130 hostsByIp = new ConcurrentHashMap<IpAddress, Set<Host>>();
131 hostsConsistentMap.asJavaMap().values().forEach(host -> {
132 host.ipAddresses().forEach(ip -> {
133 Set<Host> existingHosts = hostsByIp.get(ip);
134 if (existingHosts == null) {
135 hostsByIp.put(ip, addHosts(host));
136 } else {
137 existingHosts.add(host);
138 }
139 });
140 });
141 }
142
Brian O'Connordab09742015-12-07 20:06:29 -0800143 private boolean shouldUpdate(DefaultHost existingHost,
144 ProviderId providerId,
Brian O'Connordab09742015-12-07 20:06:29 -0800145 HostDescription hostDescription,
146 boolean replaceIPs) {
147 if (existingHost == null) {
148 return true;
149 }
150
Charles Chan69ebcbb2017-04-27 14:33:21 -0700151 // Avoid overriding configured host with learnt host
152 if (existingHost.configured() && !hostDescription.configured()) {
Charles Chan29ecdee2017-02-22 18:46:56 -0800153 return false;
154 }
155
Brian O'Connordab09742015-12-07 20:06:29 -0800156 if (!Objects.equals(existingHost.providerId(), providerId) ||
157 !Objects.equals(existingHost.mac(), hostDescription.hwAddress()) ||
158 !Objects.equals(existingHost.vlan(), hostDescription.vlan()) ||
Jonghwan Hyun2c95acf2018-03-14 16:47:34 -0700159 !Objects.equals(existingHost.innerVlan(), hostDescription.innerVlan()) ||
160 !Objects.equals(existingHost.tpid(), hostDescription.tpid()) ||
Charles Chancd06c692017-04-27 20:46:06 -0700161 !Objects.equals(existingHost.locations(), hostDescription.locations())) {
Brian O'Connordab09742015-12-07 20:06:29 -0800162 return true;
163 }
164
165 if (replaceIPs) {
166 if (!Objects.equals(hostDescription.ipAddress(),
167 existingHost.ipAddresses())) {
168 return true;
169 }
170 } else {
171 if (!existingHost.ipAddresses().containsAll(hostDescription.ipAddress())) {
172 return true;
173 }
174 }
175
176 // check to see if any of the annotations provided by hostDescription
177 // differ from those in the existing host
178 return hostDescription.annotations().keys().stream()
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530179 .anyMatch(k -> !Objects.equals(hostDescription.annotations().value(k),
180 existingHost.annotations().value(k)));
Brian O'Connordab09742015-12-07 20:06:29 -0800181
182
183 }
184
Charles Chan009c3082015-11-10 14:18:04 -0800185 // TODO No longer need to return HostEvent
Madan Jampani38a88212015-09-15 11:21:27 -0700186 @Override
187 public HostEvent createOrUpdateHost(ProviderId providerId,
Brian O'Connorf107bd72015-09-21 15:31:03 -0700188 HostId hostId,
189 HostDescription hostDescription,
190 boolean replaceIPs) {
Madan Jampanic6371882016-06-03 21:30:17 -0700191 hostsConsistentMap.computeIf(hostId,
Charles Chan69ebcbb2017-04-27 14:33:21 -0700192 existingHost -> shouldUpdate(existingHost, providerId,
Brian O'Connordab09742015-12-07 20:06:29 -0800193 hostDescription, replaceIPs),
194 (id, existingHost) -> {
Brian O'Connorf107bd72015-09-21 15:31:03 -0700195
Madan Jampanic7f49f92015-12-10 11:35:06 -0800196 final Set<IpAddress> addresses;
197 if (existingHost == null || replaceIPs) {
198 addresses = ImmutableSet.copyOf(hostDescription.ipAddress());
199 } else {
200 addresses = Sets.newHashSet(existingHost.ipAddresses());
201 addresses.addAll(hostDescription.ipAddress());
202 }
Brian O'Connorf107bd72015-09-21 15:31:03 -0700203
Madan Jampanic7f49f92015-12-10 11:35:06 -0800204 final Annotations annotations;
205 if (existingHost != null) {
206 annotations = merge((DefaultAnnotations) existingHost.annotations(),
207 hostDescription.annotations());
208 } else {
209 annotations = hostDescription.annotations();
210 }
Jonathan Hart38feb6e2016-08-29 22:54:16 +0000211
Madan Jampanic7f49f92015-12-10 11:35:06 -0800212 return new DefaultHost(providerId,
213 hostId,
214 hostDescription.hwAddress(),
215 hostDescription.vlan(),
Charles Chancd06c692017-04-27 20:46:06 -0700216 hostDescription.locations(),
Madan Jampanic7f49f92015-12-10 11:35:06 -0800217 addresses,
Jonghwan Hyun2c95acf2018-03-14 16:47:34 -0700218 hostDescription.innerVlan(),
219 hostDescription.tpid(),
Charles Chanb1e99242017-07-07 14:11:09 -0700220 hostDescription.configured(),
Madan Jampanic7f49f92015-12-10 11:35:06 -0800221 annotations);
222 });
Charles Chan009c3082015-11-10 14:18:04 -0800223 return null;
Madan Jampani38a88212015-09-15 11:21:27 -0700224 }
225
Charles Chan009c3082015-11-10 14:18:04 -0800226 // TODO No longer need to return HostEvent
Madan Jampani38a88212015-09-15 11:21:27 -0700227 @Override
228 public HostEvent removeHost(HostId hostId) {
Charles Chan009c3082015-11-10 14:18:04 -0800229 hosts.remove(hostId);
230 return null;
Madan Jampani38a88212015-09-15 11:21:27 -0700231 }
232
Charles Chan009c3082015-11-10 14:18:04 -0800233 // TODO No longer need to return HostEvent
Madan Jampani38a88212015-09-15 11:21:27 -0700234 @Override
samanwita palc40e5ed2015-09-24 11:01:51 -0700235 public HostEvent removeIp(HostId hostId, IpAddress ipAddress) {
Charles Chan009c3082015-11-10 14:18:04 -0800236 hosts.compute(hostId, (id, existingHost) -> {
samanwita palc40e5ed2015-09-24 11:01:51 -0700237 if (existingHost != null) {
238 checkState(Objects.equals(hostId.mac(), existingHost.mac()),
239 "Existing and new MAC addresses differ.");
240 checkState(Objects.equals(hostId.vlanId(), existingHost.vlan()),
241 "Existing and new VLANs differ.");
242
samanwita pale7c08de2015-09-24 21:59:49 -0700243 Set<IpAddress> addresses = existingHost.ipAddresses();
samanwita palc40e5ed2015-09-24 11:01:51 -0700244 if (addresses != null && addresses.contains(ipAddress)) {
samanwita pale7c08de2015-09-24 21:59:49 -0700245 addresses = new HashSet<>(existingHost.ipAddresses());
samanwita palc40e5ed2015-09-24 11:01:51 -0700246 addresses.remove(ipAddress);
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530247 removeIpFromHostsByIp(existingHost, ipAddress);
samanwita palc40e5ed2015-09-24 11:01:51 -0700248 return new DefaultHost(existingHost.providerId(),
249 hostId,
250 existingHost.mac(),
251 existingHost.vlan(),
Charles Chancd06c692017-04-27 20:46:06 -0700252 existingHost.locations(),
samanwita palc40e5ed2015-09-24 11:01:51 -0700253 ImmutableSet.copyOf(addresses),
Charles Chancd06c692017-04-27 20:46:06 -0700254 existingHost.configured(),
samanwita palc40e5ed2015-09-24 11:01:51 -0700255 existingHost.annotations());
256 } else {
257 return existingHost;
258 }
259 }
260 return null;
261 });
Charles Chan009c3082015-11-10 14:18:04 -0800262 return null;
samanwita palc40e5ed2015-09-24 11:01:51 -0700263 }
264
265 @Override
Charles Chan47933752017-11-30 15:37:50 -0800266 public void appendLocation(HostId hostId, HostLocation location) {
267 log.debug("Appending location {} to host {}", location, hostId);
268 hosts.compute(hostId, (id, existingHost) -> {
269 if (existingHost != null) {
270 checkState(Objects.equals(hostId.mac(), existingHost.mac()),
271 "Existing and new MAC addresses differ.");
272 checkState(Objects.equals(hostId.vlanId(), existingHost.vlan()),
273 "Existing and new VLANs differ.");
274
Charles Chan9bd0e5a2018-04-25 18:51:46 -0400275 // Move within the same switch
276 // Simply replace old location that is on the same device
277 Set<HostLocation> newLocations = Sets.newHashSet(location);
278 existingHost.locations().stream().filter(loc -> !loc.deviceId().equals(location.deviceId()))
279 .forEach(newLocations::add);
Charles Chan47933752017-11-30 15:37:50 -0800280
281 return new DefaultHost(existingHost.providerId(),
282 hostId, existingHost.mac(), existingHost.vlan(),
Charles Chan9bd0e5a2018-04-25 18:51:46 -0400283 newLocations, existingHost.ipAddresses(),
Charles Chan47933752017-11-30 15:37:50 -0800284 existingHost.configured(), existingHost.annotations());
285 }
286 return null;
287 });
288 }
289
290 @Override
Charles Chan888e20a2017-05-01 15:44:23 -0700291 public void removeLocation(HostId hostId, HostLocation location) {
Charles Chan47933752017-11-30 15:37:50 -0800292 log.debug("Removing location {} from host {}", location, hostId);
Charles Chan888e20a2017-05-01 15:44:23 -0700293 hosts.compute(hostId, (id, existingHost) -> {
294 if (existingHost != null) {
295 checkState(Objects.equals(hostId.mac(), existingHost.mac()),
296 "Existing and new MAC addresses differ.");
297 checkState(Objects.equals(hostId.vlanId(), existingHost.vlan()),
298 "Existing and new VLANs differ.");
299
300 Set<HostLocation> locations = new HashSet<>(existingHost.locations());
301 locations.remove(location);
302
303 // Remove entire host if we are removing the last location
304 return locations.isEmpty() ? null :
305 new DefaultHost(existingHost.providerId(),
306 hostId, existingHost.mac(), existingHost.vlan(),
307 locations, existingHost.ipAddresses(),
308 existingHost.configured(), existingHost.annotations());
309 }
310 return null;
311 });
312 }
313
314 @Override
Madan Jampani38a88212015-09-15 11:21:27 -0700315 public int getHostCount() {
316 return hosts.size();
317 }
318
319 @Override
320 public Iterable<Host> getHosts() {
321 return ImmutableSet.copyOf(hosts.values());
322 }
323
324 @Override
325 public Host getHost(HostId hostId) {
326 return hosts.get(hostId);
327 }
328
329 @Override
330 public Set<Host> getHosts(VlanId vlanId) {
331 return filter(hosts.values(), host -> Objects.equals(host.vlan(), vlanId));
332 }
333
334 @Override
335 public Set<Host> getHosts(MacAddress mac) {
336 return filter(hosts.values(), host -> Objects.equals(host.mac(), mac));
337 }
338
339 @Override
340 public Set<Host> getHosts(IpAddress ip) {
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530341 Set<Host> hosts = hostsByIp.get(ip);
342 return hosts != null ? ImmutableSet.copyOf(hosts) : ImmutableSet.of();
Madan Jampani38a88212015-09-15 11:21:27 -0700343 }
344
345 @Override
346 public Set<Host> getConnectedHosts(ConnectPoint connectPoint) {
Charles Chan009c3082015-11-10 14:18:04 -0800347 Set<Host> filtered = hosts.entrySet().stream()
Charles Chancd06c692017-04-27 20:46:06 -0700348 .filter(entry -> entry.getValue().locations().contains(connectPoint))
Charles Chan009c3082015-11-10 14:18:04 -0800349 .map(Map.Entry::getValue)
350 .collect(Collectors.toSet());
351 return ImmutableSet.copyOf(filtered);
Madan Jampani38a88212015-09-15 11:21:27 -0700352 }
353
354 @Override
355 public Set<Host> getConnectedHosts(DeviceId deviceId) {
Charles Chan009c3082015-11-10 14:18:04 -0800356 Set<Host> filtered = hosts.entrySet().stream()
Charles Chancd06c692017-04-27 20:46:06 -0700357 .filter(entry -> entry.getValue().locations().stream()
358 .map(HostLocation::deviceId).anyMatch(dpid -> dpid.equals(deviceId)))
Charles Chan009c3082015-11-10 14:18:04 -0800359 .map(Map.Entry::getValue)
360 .collect(Collectors.toSet());
HIGUCHI Yutafe2122c2015-09-30 13:46:22 -0700361 return ImmutableSet.copyOf(filtered);
Madan Jampani38a88212015-09-15 11:21:27 -0700362 }
363
Madan Jampani38a88212015-09-15 11:21:27 -0700364 private Set<Host> filter(Collection<DefaultHost> collection, Predicate<DefaultHost> predicate) {
365 return collection.stream().filter(predicate).collect(Collectors.toSet());
366 }
367
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530368 private Set<Host> addHosts(Host host) {
369 Set<Host> hosts = Sets.newConcurrentHashSet();
370 hosts.add(host);
371 return hosts;
372 }
373
374 private Set<Host> updateHosts(Set<Host> existingHosts, Host host) {
375 Iterator<Host> iterator = existingHosts.iterator();
376 while (iterator.hasNext()) {
377 Host existingHost = iterator.next();
378 if (existingHost.id().equals(host.id())) {
379 iterator.remove();
380 }
381 }
382 existingHosts.add(host);
383 return existingHosts;
384 }
385
386 private Set<Host> removeHosts(Set<Host> existingHosts, Host host) {
387 if (existingHosts != null) {
388 Iterator<Host> iterator = existingHosts.iterator();
389 while (iterator.hasNext()) {
390 Host existingHost = iterator.next();
391 if (existingHost.id().equals(host.id())) {
392 iterator.remove();
393 }
394 }
395 }
396
Ray Milkey74e59132018-01-17 15:24:52 -0800397 if (existingHosts == null || existingHosts.isEmpty()) {
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530398 return null;
399 }
400 return existingHosts;
401 }
402
403 private void updateHostsByIp(DefaultHost host) {
404 host.ipAddresses().forEach(ip -> {
405 hostsByIp.compute(ip, (k, v) -> v == null ? addHosts(host)
406 : updateHosts(v, host));
407 });
408 }
409
410 private void removeHostsByIp(DefaultHost host) {
411 host.ipAddresses().forEach(ip -> {
412 hostsByIp.computeIfPresent(ip, (k, v) -> removeHosts(v, host));
413 });
414 }
415
416 private void removeIpFromHostsByIp(DefaultHost host, IpAddress ip) {
417 hostsByIp.computeIfPresent(ip, (k, v) -> removeHosts(v, host));
418 }
419
alshabib8a4a6002015-11-25 14:31:16 -0800420 private class HostLocationTracker implements MapEventListener<HostId, DefaultHost> {
Madan Jampani38a88212015-09-15 11:21:27 -0700421 @Override
alshabib8a4a6002015-11-25 14:31:16 -0800422 public void event(MapEvent<HostId, DefaultHost> event) {
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530423 DefaultHost host = checkNotNull(event.value().value());
alshabib1400ce92015-12-16 15:05:47 -0800424 switch (event.type()) {
425 case INSERT:
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530426 updateHostsByIp(host);
Charles Chan009c3082015-11-10 14:18:04 -0800427 notifyDelegate(new HostEvent(HOST_ADDED, host));
alshabib1400ce92015-12-16 15:05:47 -0800428 break;
429 case UPDATE:
Deepa Vaddireddy0a71c8b2017-01-19 21:20:45 +0530430 updateHostsByIp(host);
431 DefaultHost prevHost = checkNotNull(event.oldValue().value());
Charles Chancd06c692017-04-27 20:46:06 -0700432 if (!Objects.equals(prevHost.locations(), host.locations())) {
alshabib1400ce92015-12-16 15:05:47 -0800433 notifyDelegate(new HostEvent(HOST_MOVED, host, prevHost));
434 } else if (!Objects.equals(prevHost, host)) {
435 notifyDelegate(new HostEvent(HOST_UPDATED, host, prevHost));
436 }
437 break;
438 case REMOVE:
Charles Chan21720342017-05-13 00:19:09 -0700439 removeHostsByIp(host);
Yuta HIGUCHI215a7e42016-07-20 19:54:06 -0700440 notifyDelegate(new HostEvent(HOST_REMOVED, host));
alshabib1400ce92015-12-16 15:05:47 -0800441 break;
442 default:
443 log.warn("Unknown map event type: {}", event.type());
Madan Jampani38a88212015-09-15 11:21:27 -0700444 }
445 }
446 }
447}