public ReplicationJob createJobForCopyPartition(long auditLogId,long auditLogEntryCreateTime,NamedPartition namedPartition) throws StateUpdateException {
  String partitionName=namedPartition.getName();
  List<String> partitionNames=new ArrayList<>();
  partitionNames.add(partitionName);
  ReplicationOperation replicationOperation=ReplicationOperation.COPY_PARTITION;
  Map<String,String> extras=new HashMap<>();
  extras.put(PersistedJobInfo.AUDIT_LOG_ID_EXTRAS_KEY,Long.toString(auditLogId));
  extras.put(PersistedJobInfo.AUDIT_LOG_ENTRY_CREATE_TIME_KEY,Long.toString(auditLogEntryCreateTime));
  Partition partition=namedPartition.getPartition();
  HiveObjectSpec spec=new HiveObjectSpec(namedPartition);
  PersistedJobInfo persistedJobInfo=jobInfoStore.resilientCreate(replicationOperation,ReplicationStatus.PENDING,ReplicationUtils.getLocation(partition),srcCluster.getName(),spec,partitionNames,ReplicationUtils.getTldt(partition),Optional.empty(),Optional.empty(),extras);
  ReplicationTask replicationTask=new CopyPartitionTask(conf,destinationObjectFactory,objectConflictHandler,srcCluster,destCluster,spec,ReplicationUtils.getLocation(partition),Optional.<Path>empty(),directoryCopier,true);
  return new ReplicationJob(conf,replicationTask,onStateChangeHandler,persistedJobInfo);
}

public ReplicationJob createJobForCopyPartition ( long auditLogId , long auditLogEntryCreateTime , NamedPartition namedPartition ) throws StateUpdateException { String partitionName = namedPartition . getName ( ) ; List < String > partitionNames = new ArrayList < > ( ) ; partitionNames . add ( partitionName ) ; ReplicationOperation replicationOperation = ReplicationOperation . COPY_PARTITION ; Map < String , String > extras = new HashMap < > ( ) ; extras . put ( PersistedJobInfo . AUDIT_LOG_ID_EXTRAS_KEY , Long . toString ( auditLogId ) ) ; extras . put ( PersistedJobInfo . AUDIT_LOG_ENTRY_CREATE_TIME_KEY , Long . toString ( auditLogEntryCreateTime ) ) ; Partition partition = namedPartition . getPartition ( ) ; HiveObjectSpec spec = new HiveObjectSpec ( namedPartition ) ; PersistedJobInfo persistedJobInfo = jobInfoStore . resilientCreate ( replicationOperation , ReplicationStatus . PENDING , ReplicationUtils . getLocation ( partition ) , srcCluster . getName ( ) , spec , partitionNames , ReplicationUtils . getTldt ( partition ) , Optional . empty ( ) , Optional . empty ( ) , extras ) ; ReplicationTask replicationTask = new CopyPartitionTask ( conf , destinationObjectFactory , objectConflictHandler , srcCluster , destCluster , spec , ReplicationUtils . getLocation ( partition ) , Optional . < Path > empty ( ) , directoryCopier , true ) ; return new ReplicationJob ( conf , replicationTask , onStateChangeHandler , persistedJobInfo ) ; }
create a replication job to copy a partition .
