class MetadataUpdateReplicaLocationManager implements ReplicaLocationManager {

  @Override
  public Path getPartitionLocation(Partition sourcePartition) {
    if (tableType == UNPARTITIONED) {
      throw new UnsupportedOperationException("Not a partitioned table.");
    }
    try {
      Partition partition = replicaMetastoreClient.getPartition(replicaDatabaseName, replicaTableName,
          sourcePartition.getValues());
      // We return the existing replica location so it won't change as we are only updating metadata
      return new Path(partition.getSd().getLocation());
    } catch (TException e) {
      throw new CircusTrainException("Partition should exist on replica but doesn't", e);
    }
  }

  public  MetadataUpdateReplicaLocationManager(
      CloseableMetaStoreClient replicaMetastoreClient,
      TableType tableType,
      String tablePath,
      String replicaDatabaseName,
      String replicaTableName);

}