@Override
  public List<ClusterParticipant> getClusterParticipants() throws IOException {
    if (clusterParticipant == null) {
      clusterParticipant = new ClusterParticipant() {
        private final Map<StateModelListenerType, PartitionStateChangeListener> listeners = new HashMap<>();

        @Override
        public void participateAndBlockStateTransition(List<AmbryStatsReport> ambryStatsReports, AccountStatsStore accountStatsStore,
            Callback<AggregatedAccountStorageStats> callback) {
          DataNodeId currentNode =
              getClusterMap().getDataNodeId(clusterMapConfig.clusterMapHostName, clusterMapConfig.clusterMapPort);
          Set<String> partitionsOnNode = getClusterMap().getReplicaIds(currentNode)
              .stream()
              .map(r -> r.getPartitionId().toPathString())
              .collect(Collectors.toSet());
          for (PartitionStateChangeListener listener : listeners.values()) {
            for (String partitionName : partitionsOnNode) {
              listener.onPartitionBecomeLeaderFromStandby(partitionName);
            }
          }
        }

        @Override
        public void unblockStateTransition() {
        }

        @Override
        public void close() {

        }

        @Override
        public boolean setReplicaSealedState(ReplicaId replicaId, ReplicaSealStatus replicaSealStatus) {
          return false;
        }

        @Override
        public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) {
          return false;
        }

        @Override
        public List<String> getSealedReplicas() {
          return Collections.emptyList();
        }

        @Override
        public List<String> getPartiallySealedReplicas() {
          return Collections.emptyList();
        }

        @Override
        public List<String> getStoppedReplicas() {
          return Collections.emptyList();
        }

        @Override
        public void registerPartitionStateChangeListener(StateModelListenerType listenerType,
            PartitionStateChangeListener partitionStateChangeListener) {
          listeners.put(listenerType, partitionStateChangeListener);
        }

        @Override
        public Map<StateModelListenerType, PartitionStateChangeListener> getPartitionStateChangeListeners() {
          return listeners;
        }

        @Override
        public ReplicaSyncUpManager getReplicaSyncUpManager() {
          return null;
        }

        @Override
        public boolean updateDataNodeInfoInCluster(ReplicaId replicaId, boolean shouldExist) {
          // static clustermap doesn't support updating node info dynamically.
          return false;
        }
      };
    }
    return Collections.singletonList(clusterParticipant);
  }
Instantiate an instance of this factory.
@param partitionLayout the {@link PartitionLayout} to use.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/StaticClusterAgentsFactory.java