public static void controlReplicationForPartition(List<MockDataNodeId> allNodes, PartitionId partitionId,
      SSLConfig clientSSLConfig, SSLSocketFactory clientSSLSocketFactory, boolean enable) throws Exception {
    List<ConnectedChannel> channels = new ArrayList<>();
    for (DataNodeId node : allNodes) {
      Port port = new Port(node.getHttp2Port(), PortType.HTTP2);
      ConnectedChannel channel =
          getBlockingChannelBasedOnPortType(port, "localhost", clientSSLSocketFactory, clientSSLConfig);
      channel.connect();
      channels.add(channel);
    }
    controlReplicationForPartition(channels, partitionId, enable);
    for (ConnectedChannel channel : channels) {
      channel.disconnect();
    }
  }
Enable or disable replication on the replicas
@param allNodes the nodes to send the replication control requests.
@param partitionId the partition that the control request is targeting.
@param clientSSLConfig the client {@link SSLConfig}
@param clientSSLSocketFactory the {@link SSLSocketFactory}
@param enable if true, enable the replication. If false, disable the replication
@throws Exception any exception
ambry-test-utils/src/main/java/com/github/ambry/server/ServerTestUtil.java