@Test public void sealedReplicaChangeTest() { assumeTrue(!useComposite && !overrideEnabled && listenCrossColo); assertStateEquivalency(helixCluster.getDownInstances(), helixCluster.getUpInstances()); AmbryPartition partition = (AmbryPartition) clusterManager.getWritablePartitionIds(null).get(0); List<String> instances = helixCluster.getInstancesForPartition((partition.toPathString())); helixCluster.setReplicaState(partition, instances.get(0), ReplicaStateType.SealedState, true, false); assertFalse("If any one replica is SEALED, the whole partition should be SEALED", clusterManager.getWritablePartitionIds(null).contains(partition)); assertEquals("If any one replica is SEALED, the whole partition should be SEALED", PartitionState.READ_ONLY, partition.getPartitionState()); helixCluster.setReplicaState(partition, instances.get(1), ReplicaStateType.SealedState, true, false); assertFalse("If any one replica is SEALED, the whole partition should be SEALED", clusterManager.getWritablePartitionIds(null).contains(partition)); assertEquals("If any one replica is SEALED, the whole partition should be SEALED", PartitionState.READ_ONLY, partition.getPartitionState()); helixCluster.setReplicaState(partition, instances.get(1), ReplicaStateType.SealedState, false, false); assertFalse("If any one replica is SEALED, the whole partition should be SEALED", clusterManager.getWritablePartitionIds(null).contains(partition)); assertEquals("If any one replica is SEALED, the whole partition should be SEALED", PartitionState.READ_ONLY, partition.getPartitionState()); helixCluster.setReplicaState(partition, instances.get(0), ReplicaStateType.SealedState, false, false); assertTrue("If no replica is SEALED, the whole partition should be Writable", clusterManager.getWritablePartitionIds(null).contains(partition)); assertEquals("If no replica is SEALED, the whole partition should be Writable", PartitionState.READ_WRITE, partition.getPartitionState()); assertStateEquivalency(helixCluster.getDownInstances(), helixCluster.getUpInstances()); }
@Override public List<PartitionId> getWritablePartitionIds(String partitionClass) { return partitionSelectionHelper.getWritablePartitions(partitionClass); }
HelixClusterManager implements ClusterMap { @Override public List<PartitionId> getWritablePartitionIds(String partitionClass) { return partitionSelectionHelper.getWritablePartitions(partitionClass); } }
HelixClusterManager implements ClusterMap { @Override public List<PartitionId> getWritablePartitionIds(String partitionClass) { return partitionSelectionHelper.getWritablePartitions(partitionClass); } HelixClusterManager(ClusterMapConfig clusterMapConfig, String instanceName, HelixFactory helixFactory,
      MetricRegistry metricRegistry); }
HelixClusterManager implements ClusterMap { @Override public List<PartitionId> getWritablePartitionIds(String partitionClass) { return partitionSelectionHelper.getWritablePartitions(partitionClass); } HelixClusterManager(ClusterMapConfig clusterMapConfig, String instanceName, HelixFactory helixFactory,
      MetricRegistry metricRegistry); @Override boolean hasDatacenter(String datacenterName); @Override byte getLocalDatacenterId(); @Override String getDatacenterName(byte id); @Override AmbryDataNode getDataNodeId(String hostname, int port); @Override List<AmbryReplica> getReplicaIds(DataNodeId dataNodeId); @Override List<AmbryDataNode> getDataNodeIds(); @Override MetricRegistry getMetricRegistry(); @Override void onReplicaEvent(ReplicaId replicaId, ReplicaEventType event); @Override JSONObject getSnapshot(); @Override PartitionId getPartitionIdFromStream(InputStream stream); @Override List<PartitionId> getWritablePartitionIds(String partitionClass); @Override PartitionId getRandomWritablePartition(String partitionClass, List<PartitionId> partitionsToExclude); @Override List<PartitionId> getAllPartitionIds(String partitionClass); @Override ReplicaId getBootstrapReplica(String partitionIdStr, DataNodeId dataNodeId); @Override void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener); @Override void close(); }
HelixClusterManager implements ClusterMap { @Override public List<PartitionId> getWritablePartitionIds(String partitionClass) { return partitionSelectionHelper.getWritablePartitions(partitionClass); } HelixClusterManager(ClusterMapConfig clusterMapConfig, String instanceName, HelixFactory helixFactory,
      MetricRegistry metricRegistry); @Override boolean hasDatacenter(String datacenterName); @Override byte getLocalDatacenterId(); @Override String getDatacenterName(byte id); @Override AmbryDataNode getDataNodeId(String hostname, int port); @Override List<AmbryReplica> getReplicaIds(DataNodeId dataNodeId); @Override List<AmbryDataNode> getDataNodeIds(); @Override MetricRegistry getMetricRegistry(); @Override void onReplicaEvent(ReplicaId replicaId, ReplicaEventType event); @Override JSONObject getSnapshot(); @Override PartitionId getPartitionIdFromStream(InputStream stream); @Override List<PartitionId> getWritablePartitionIds(String partitionClass); @Override PartitionId getRandomWritablePartition(String partitionClass, List<PartitionId> partitionsToExclude); @Override List<PartitionId> getAllPartitionIds(String partitionClass); @Override ReplicaId getBootstrapReplica(String partitionIdStr, DataNodeId dataNodeId); @Override void registerClusterMapListener(ClusterMapChangeListener clusterMapChangeListener); @Override void close();  }