public HCatEventMessage getHCatEventMessage(String eventTypeString, String messageBody) {

    switch (HCatEventMessage.EventType.valueOf(eventTypeString)) {
    case CREATE_DATABASE:
      return getCreateDatabaseMessage(messageBody);
    case DROP_DATABASE:
      return getDropDatabaseMessage(messageBody);
    case CREATE_TABLE:
      return getCreateTableMessage(messageBody);
    case ALTER_TABLE:
      return getAlterTableMessage(messageBody);
    case DROP_TABLE:
      return getDropTableMessage(messageBody);
    case ADD_PARTITION:
      return getAddPartitionMessage(messageBody);
    case ALTER_PARTITION:
      return getAlterPartitionMessage(messageBody);
    case DROP_PARTITION:
      return getDropPartitionMessage(messageBody);
    case CREATE_FUNCTION:
      return getCreateFunctionMessage(messageBody);
    case DROP_FUNCTION:
      return getDropFunctionMessage(messageBody);
    case INSERT:
      return getInsertMessage(messageBody);
    default:
      throw new IllegalArgumentException("Unsupported event-type: " + eventTypeString);
    }
  }
Method to construct HCatEventMessage from string.
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/messaging/MessageDeserializer.java