public void addHook(HookContext.HookType type, Object hook) {
    if (type.getHookClass().isAssignableFrom(hook.getClass())) {
      loadHooksFromConf(type);
      typeHooks.get(type).addHook(hook);
    } else {
      String message = "Error adding hook: " + hook.getClass().getName() + " into type: " + type +
          ", as the hook doesn't implement or extend: " + type.getHookClass().getName();
      logErrorMessage(message);
      throw new IllegalArgumentException(message);
    }
  }
Add the hook corresponding to the specific hook type.
@param type The hook type
@param hook The hook that will be added
ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveHooks.java