class SourceFactory implements HiveEndpointFactory<Source> {

  @Override
  public Source newInstance(TableReplication tableReplication) {
    // disable snapshots by default, only needed for ReplicationModes that replicate data.
    boolean snapshotsDisabled = true;
    if (tableReplication.getReplicationMode() == ReplicationMode.FULL) {
      snapshotsDisabled = sourceCatalog.isDisableSnapshots();
    }
    return new Source(sourceCatalog, sourceHiveConf, sourceMetaStoreClientSupplier, sourceCatalogListener,
        snapshotsDisabled, tableReplication.getSourceTable().getTableLocation());
  }

  @Autowired public  SourceFactory(
      SourceCatalog sourceCatalog,
      @Value("#{sourceHiveConf}") HiveConf sourceHiveConf,
      @Value("#{sourceMetaStoreClientSupplier}") Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
      SourceCatalogListener sourceCatalogListener);

}