HIGUCHI Yuta
Committed by Gerrit Code Review

Cosmetic fixes for DefaultClusterMetadataProvider

Change-Id: I3d4d49fb38ec258f5a9a7c6007a40255d6465801
...@@ -46,7 +46,6 @@ import org.onosproject.store.service.Versioned; ...@@ -46,7 +46,6 @@ import org.onosproject.store.service.Versioned;
46 import org.slf4j.Logger; 46 import org.slf4j.Logger;
47 47
48 import com.google.common.collect.ImmutableSet; 48 import com.google.common.collect.ImmutableSet;
49 -import com.google.common.collect.Sets;
50 49
51 /** 50 /**
52 * Provider of default {@link ClusterMetadata cluster metadata}. 51 * Provider of default {@link ClusterMetadata cluster metadata}.
...@@ -65,7 +64,7 @@ public class DefaultClusterMetadataProvider implements ClusterMetadataProvider { ...@@ -65,7 +64,7 @@ public class DefaultClusterMetadataProvider implements ClusterMetadataProvider {
65 private static final String DEFAULT_ONOS_INTERFACE = "eth0"; 64 private static final String DEFAULT_ONOS_INTERFACE = "eth0";
66 private static final int DEFAULT_ONOS_PORT = 9876; 65 private static final int DEFAULT_ONOS_PORT = 9876;
67 private static final ProviderId PROVIDER_ID = new ProviderId("default", "none"); 66 private static final ProviderId PROVIDER_ID = new ProviderId("default", "none");
68 - private AtomicReference<Versioned<ClusterMetadata>> cachedMetadata = new AtomicReference<>(); 67 + private final AtomicReference<Versioned<ClusterMetadata>> cachedMetadata = new AtomicReference<>();
69 68
70 @Activate 69 @Activate
71 public void activate() { 70 public void activate() {
...@@ -73,9 +72,9 @@ public class DefaultClusterMetadataProvider implements ClusterMetadataProvider { ...@@ -73,9 +72,9 @@ public class DefaultClusterMetadataProvider implements ClusterMetadataProvider {
73 ControllerNode localNode = 72 ControllerNode localNode =
74 new DefaultControllerNode(new NodeId(localIp), IpAddress.valueOf(localIp), DEFAULT_ONOS_PORT); 73 new DefaultControllerNode(new NodeId(localIp), IpAddress.valueOf(localIp), DEFAULT_ONOS_PORT);
75 // p0 partition 74 // p0 partition
76 - Partition basePartition = new DefaultPartition(PartitionId.from(0), Sets.newHashSet(localNode.id())); 75 + Partition basePartition = new DefaultPartition(PartitionId.from(0), ImmutableSet.of(localNode.id()));
77 // p1 partition 76 // p1 partition
78 - Partition extendedPartition = new DefaultPartition(PartitionId.from(1), Sets.newHashSet(localNode.id())); 77 + Partition extendedPartition = new DefaultPartition(PartitionId.from(1), ImmutableSet.of(localNode.id()));
79 ClusterMetadata metadata = new ClusterMetadata(PROVIDER_ID, 78 ClusterMetadata metadata = new ClusterMetadata(PROVIDER_ID,
80 "default", 79 "default",
81 ImmutableSet.of(localNode), 80 ImmutableSet.of(localNode),
......