@Override
  public List<Task<?>> handle(Context context)
      throws SemanticException {
    if (!AcidUtils.isAcidEnabled(context.hiveConf)) {
      context.log.error("Cannot load alloc write id event as acid is not enabled");
      throw new SemanticException("Cannot load alloc write id event as acid is not enabled");
    }

    AllocWriteIdMessage msg =
        deserializer.getAllocWriteIdMessage(context.dmd.getPayload());

    String dbName = (context.dbName != null && !context.dbName.isEmpty() ? context.dbName : msg.getDB());

    // We need table name for alloc write id and that is received from source.
    String tableName = msg.getTableName();

    // Repl policy should be created based on the table name in context.
    ReplTxnWork work = new ReplTxnWork(HiveUtils.getReplPolicy(context.dbName), dbName, tableName,
        ReplTxnWork.OperationType.REPL_ALLOC_WRITE_ID, msg.getTxnToWriteIdList(), context.eventOnlyReplicationSpec(),
            context.getDumpDirectory(), context.getMetricCollector());

    Task<?> allocWriteIdTask = TaskFactory.get(work, context.hiveConf);
    context.log.info("Added alloc write id task : {}", allocWriteIdTask.getId());
    updatedMetadata.set(context.dmd.getEventTo().toString(), dbName, tableName, null);
    return Collections.singletonList(allocWriteIdTask);
  }
AllocWriteIdHandler
Target(Load) side handler for alloc write id event.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/AllocWriteIdHandler.java