Madan Jampani

Clean up references to the deprecated p0 storage partition

Change-Id: Ifdab952d2bef30104f57aff3cab342df99a20571
......@@ -71,14 +71,12 @@ public class DefaultClusterMetadataProvider implements ClusterMetadataProvider {
String localIp = getSiteLocalAddress();
ControllerNode localNode =
new DefaultControllerNode(new NodeId(localIp), IpAddress.valueOf(localIp), DEFAULT_ONOS_PORT);
// p0 partition
Partition basePartition = new DefaultPartition(PartitionId.from(0), ImmutableSet.of(localNode.id()));
// p1 partition
Partition extendedPartition = new DefaultPartition(PartitionId.from(1), ImmutableSet.of(localNode.id()));
// partition 1
Partition partition = new DefaultPartition(PartitionId.from(1), ImmutableSet.of(localNode.id()));
ClusterMetadata metadata = new ClusterMetadata(PROVIDER_ID,
"default",
ImmutableSet.of(localNode),
ImmutableSet.of(basePartition, extendedPartition));
ImmutableSet.of(partition));
long version = System.currentTimeMillis();
cachedMetadata.set(new Versioned<>(metadata, version));
providerRegistry.register(this);
......
......@@ -90,7 +90,6 @@ public class PartitionManager extends AbstractListenerManager<PartitionEvent, Pa
currentClusterMetadata.get()
.getPartitions()
.stream()
.filter(partition -> !partition.getId().equals(PartitionId.from(0))) // exclude p0
.forEach(partition -> partitions.put(partition.getId(), new StoragePartition(partition,
messagingService,
clusterService,
......
......@@ -151,7 +151,7 @@ cat > $STAGE/config/cluster.json <<EOF
{
"name": "default",
"nodes": [ {"id": "$IP", "ip": "$IP", "port": 9876 } ],
"partitions": [ { "id": 0, "members": [ "$IP" ] }, { "id": 1, "members": [ "$IP" ] } ]
"partitions": [ { "id": 1, "members": [ "$IP" ] } ]
}
EOF
......
......@@ -29,13 +29,7 @@ def get_nodes(ips=None, port=9876):
ips = [ environ[v] for v in get_OC_vars() ]
return [ node(v) for v in ips ]
def generate_base_partition(nodes):
return {
'id': 0,
'members': nodes
}
def generate_extended_partitions(nodes, k):
def generate_partitions(nodes, k):
l = deque(nodes)
perms = []
for i in range(1, len(nodes)+1):
......@@ -49,11 +43,7 @@ def generate_extended_partitions(nodes, k):
if __name__ == '__main__':
nodes = get_nodes(sys.argv[2:])
base_partition = generate_base_partition([v.get('id') for v in nodes])
extended_partitions = generate_extended_partitions([v.get('id') for v in nodes], 3)
partitions = []
partitions.append(base_partition)
partitions.extend(extended_partitions)
partitions = generate_partitions([v.get('id') for v in nodes], 3)
m = hashlib.sha256()
for node in nodes:
m.update(node['ip'])
......