@Override
  public void persist(String mountPath, List<ReplicaTokenInfo> tokenInfoList) throws IOException {
    try {
      ByteArrayOutputStream tokenOutputStream = new ByteArrayOutputStream(4096);
      replicaTokenSerde.serializeTokens(tokenInfoList, tokenOutputStream);

      InputStream inputStream = new ByteArrayInputStream(tokenOutputStream.toByteArray());
      cloudDestination.persistTokens(mountPath, replicaTokenFileName, inputStream);
      logger.debug("Persisted replica tokens for {} to cloud destination.", mountPath);
    } catch (CloudStorageException e) {
      logger.error("IO error persisting replica tokens at mount path " + mountPath, e);
    }
  }
Constructor for {@link CloudTokenPersistor}.
@param replicaTokenFileName the token's file name.
@param partitionGroupedByMountPath A map between mount path and list of partitions under this mount path.
@param replicationMetrics metrics including token persist time.
@param clusterMap the {@link ClusterMap} to deserialize tokens.
@param tokenHelper the {@link FindTokenHelper} to deserialize tokens.
ambry-cloud/src/main/java/com/github/ambry/cloud/CloudTokenPersistor.java