public ReplicationJob createJobForRenamePartition(long auditLogId,long auditLogEntryCreateTime,NamedPartition renameFromPartition,NamedPartition renameToPartition) throws StateUpdateException {
  ReplicationOperation replicationOperation=ReplicationOperation.RENAME_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));
  HiveObjectSpec renameFromPartitionSpec=new HiveObjectSpec(renameFromPartition);
  HiveObjectSpec renameToPartitionSpec=new HiveObjectSpec(renameToPartition);
  Optional renameFromPath=ReplicationUtils.getLocation(renameFromPartition.getPartition());
  Optional renameToPath=ReplicationUtils.getLocation(renameToPartition.getPartition());
  PersistedJobInfo persistedJobInfo=jobInfoStore.resilientCreate(replicationOperation,ReplicationStatus.PENDING,renameFromPath,srcCluster.getName(),renameFromPartitionSpec,new ArrayList<>(),ReplicationUtils.getTldt(renameFromPartition.getPartition()),Optional.of(renameToPartitionSpec),renameToPath,extras);
  return new ReplicationJob(conf,new RenamePartitionTask(conf,destinationObjectFactory,objectConflictHandler,srcCluster,destCluster,renameFromPartitionSpec,renameToPartitionSpec,renameFromPath,renameToPath,ReplicationUtils.getTldt(renameFromPartition.getPartition()),directoryCopier),onStateChangeHandler,persistedJobInfo);
}

public ReplicationJob createJobForRenamePartition ( long auditLogId , long auditLogEntryCreateTime , NamedPartition renameFromPartition , NamedPartition renameToPartition ) throws StateUpdateException { ReplicationOperation replicationOperation = ReplicationOperation . RENAME_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 ) ) ; HiveObjectSpec renameFromPartitionSpec = new HiveObjectSpec ( renameFromPartition ) ; HiveObjectSpec renameToPartitionSpec = new HiveObjectSpec ( renameToPartition ) ; Optional renameFromPath = ReplicationUtils . getLocation ( renameFromPartition . getPartition ( ) ) ; Optional renameToPath = ReplicationUtils . getLocation ( renameToPartition . getPartition ( ) ) ; PersistedJobInfo persistedJobInfo = jobInfoStore . resilientCreate ( replicationOperation , ReplicationStatus . PENDING , renameFromPath , srcCluster . getName ( ) , renameFromPartitionSpec , new ArrayList < > ( ) , ReplicationUtils . getTldt ( renameFromPartition . getPartition ( ) ) , Optional . of ( renameToPartitionSpec ) , renameToPath , extras ) ; return new ReplicationJob ( conf , new RenamePartitionTask ( conf , destinationObjectFactory , objectConflictHandler , srcCluster , destCluster , renameFromPartitionSpec , renameToPartitionSpec , renameFromPath , renameToPath , ReplicationUtils . getTldt ( renameFromPartition . getPartition ( ) ) , directoryCopier ) , onStateChangeHandler , persistedJobInfo ) ; }
create a job to rename a partition .
