class ReplicaTableFactory {

  Partition newReplicaPartition(
      String eventId,
      Table sourceTable,
      Partition sourcePartition,
      String replicaDatabaseName,
      String replicaTableName,
      Path replicaPartitionLocation,
      ReplicationMode replicationMode) {
    Partition replica = partitionTransformation.transform(new Partition(sourcePartition));
    replica.setDbName(replicaDatabaseName);
    replica.setTableName(replicaTableName);
    if (replica.getSd() != null) {
      replica.getSd().setLocation(toStringOrNull(replicaPartitionLocation));
    }

    String sourcePartitionLocation = sourcePartition.getSd() == null ? ""
        : toStringOrEmpty(sourcePartition.getSd().getLocation());

    // Statistic specific parameters
    replica.putToParameters(STATS_GENERATED_VIA_STATS_TASK, Boolean.TRUE.toString());
    replica.putToParameters(STATS_GENERATED, Boolean.TRUE.toString());
    replica.putToParameters(DO_NOT_UPDATE_STATS, Boolean.TRUE.toString());
    // Replication specific parameters
    replica.putToParameters(LAST_REPLICATED.parameterName(), DateTime.now(DateTimeZone.UTC).toString());
    replica.putToParameters(REPLICATION_EVENT.parameterName(), eventId);
    replica.putToParameters(SOURCE_LOCATION.parameterName(), sourcePartitionLocation);
    replica.putToParameters(SOURCE_TABLE.parameterName(), Warehouse.getQualifiedName(sourceTable));
    replica.putToParameters(SOURCE_METASTORE.parameterName(), sourceMetaStoreUris);
    replica.putToParameters(REPLICATION_MODE.parameterName(), replicationMode.name());
    return replica;
  }

    ReplicaTableFactory(
      HiveConf sourceHiveConf,
      TableTransformation tableTransformation,
      PartitionTransformation partitionTransformation,
      ColumnStatisticsTransformation columnStatisticsTransformation);
    ReplicaTableFactory(
      String sourceMetaStoreUris,
      TableTransformation tableTransformation,
      PartitionTransformation partitionTransformation,
      ColumnStatisticsTransformation columnStatisticsTransformation);

}