Due to a ransomware attack, the wiki was reverted to a July 2022 version. . We apologize for the lack of a more recent valid backup.
...
Once you change the ConcurrentMap to a ConsistentMap, we will need to update the way the map is created in the activate() method. Here is how we can ask the storage service for a ConcurrentMap:
Code Block |
---|
/** * TODO Lab 5: Replace the ConcurrentHashMap with ConsistentMap * * You should use storageService.consistentMapBuilder(), and the * serializer: Serializer.using(KryoNamespaces.API) */ nets = storageService.<String, Set<HostId>>consistentMapBuilder() .withSerializer(Serializer.using(KryoNamespaces.API)) .withName("byon-networks") .build(); networks = nets.asJavaMap(); |
...