use of org.apache.hadoop.hive.ql.plan.AlterTableDesc in project hive by apache.
the class ReplicationSemanticAnalyzer method tableUpdateReplStateTask.
private Task<? extends Serializable> tableUpdateReplStateTask(String dbName, String tableName, Map<String, String> partSpec, String replState, Task<? extends Serializable> preCursor) {
HashMap<String, String> mapProp = new HashMap<>();
mapProp.put(ReplicationSpec.KEY.CURR_STATE_ID.toString(), replState);
AlterTableDesc alterTblDesc = new AlterTableDesc(AlterTableDesc.AlterTableTypes.ADDPROPS, new ReplicationSpec(replState, replState));
alterTblDesc.setProps(mapProp);
alterTblDesc.setOldName(StatsUtils.getFullyQualifiedTableName(dbName, tableName));
alterTblDesc.setPartSpec((HashMap<String, String>) partSpec);
Task<? extends Serializable> updateReplIdTask = TaskFactory.get(new DDLWork(inputs, outputs, alterTblDesc), conf);
// Link the update repl state task with dependency collection task
if (preCursor != null) {
preCursor.addDependentTask(updateReplIdTask);
LOG.debug("Added {}:{} as a precursor of {}:{}", preCursor.getClass(), preCursor.getId(), updateReplIdTask.getClass(), updateReplIdTask.getId());
}
return updateReplIdTask;
}
Aggregations