public ReplicationJob createJobForDropPartition(long auditLogId,long auditLogEntryCreateTime,NamedPartition namedPartition) throws StateUpdateException {
  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));
  ReplicationOperation replicationOperation=ReplicationOperation.DROP_PARTITION;
  HiveObjectSpec partitionSpec=new HiveObjectSpec(namedPartition);
  List<String> partitionNames=new ArrayList<>();
  partitionNames.add(namedPartition.getName());
  Optional<String> partitionTldt=ReplicationUtils.getTldt(namedPartition.getPartition());
  PersistedJobInfo persistedJobInfo=jobInfoStore.resilientCreate(replicationOperation,ReplicationStatus.PENDING,ReplicationUtils.getLocation(namedPartition.getPartition()),srcCluster.getName(),partitionSpec.getTableSpec(),partitionNames,partitionTldt,Optional.empty(),Optional.empty(),extras);
  return new ReplicationJob(conf,new DropPartitionTask(srcCluster,destCluster,partitionSpec,partitionTldt),onStateChangeHandler,persistedJobInfo);
}

public ReplicationJob createJobForDropPartition ( long auditLogId , long auditLogEntryCreateTime , NamedPartition namedPartition ) throws StateUpdateException { 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 ) ) ; ReplicationOperation replicationOperation = ReplicationOperation . DROP_PARTITION ; HiveObjectSpec partitionSpec = new HiveObjectSpec ( namedPartition ) ; List < String > partitionNames = new ArrayList < > ( ) ; partitionNames . add ( namedPartition . getName ( ) ) ; Optional < String > partitionTldt = ReplicationUtils . getTldt ( namedPartition . getPartition ( ) ) ; PersistedJobInfo persistedJobInfo = jobInfoStore . resilientCreate ( replicationOperation , ReplicationStatus . PENDING , ReplicationUtils . getLocation ( namedPartition . getPartition ( ) ) , srcCluster . getName ( ) , partitionSpec . getTableSpec ( ) , partitionNames , partitionTldt , Optional . empty ( ) , Optional . empty ( ) , extras ) ; return new ReplicationJob ( conf , new DropPartitionTask ( srcCluster , destCluster , partitionSpec , partitionTldt ) , onStateChangeHandler , persistedJobInfo ) ; }
create a job to drop a partition .
