@Override
  public List<Task<?>> handle(Context context)
    throws SemanticException {
    AddCheckConstraintMessage msg = deserializer.getAddCheckConstraintMessage(context.dmd.getPayload());

    List<SQLCheckConstraint> ccs;
    try {
      ccs = msg.getCheckConstraints();
    } catch (Exception e) {
      if (!(e instanceof SemanticException)){
        throw new SemanticException("Error reading message members", e);
      } else {
        throw (SemanticException)e;
      }
    }

    List<Task<?>> tasks = new ArrayList<Task<?>>();
    if (ccs.isEmpty()) {
      return tasks;
    }

    final String actualDbName = context.isDbNameEmpty() ? ccs.get(0).getTable_db() : context.dbName;
    final String actualTblName = ccs.get(0).getTable_name();
    final TableName tName = TableName.fromString(actualTblName, null, actualDbName);

    for (SQLCheckConstraint ck : ccs) {
      ck.setTable_db(actualDbName);
      ck.setTable_name(actualTblName);
    }

    Constraints constraints = new Constraints(null, null, null, null, null, ccs);
    AlterTableAddConstraintDesc addConstraintsDesc = new AlterTableAddConstraintDesc(tName,
      context.eventOnlyReplicationSpec(), constraints);
    Task<DDLWork> addConstraintsTask = TaskFactory.get(
      new DDLWork(readEntitySet, writeEntitySet, addConstraintsDesc, true,
              context.getDumpDirectory(), context.getMetricCollector()), context.hiveConf);
    tasks.add(addConstraintsTask);
    context.log.debug("Added add constrains task : {}:{}", addConstraintsTask.getId(), actualTblName);
    updatedMetadata.set(context.dmd.getEventTo().toString(), actualDbName, actualTblName, null);
    return Collections.singletonList(addConstraintsTask);
  }
AddCheckConstraintHandler
Target(Load) side handler for add check constraint event.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/AddCheckConstraintHandler.java