private VarArgsFunc lookupVisitFunc(final Object arg0) throws Throwable {
      if (!arg0Clazz.isInstance(arg0)) {
        throw new IllegalArgumentException();
      }
      VarArgsFunc method =
          dispatcher.lookupVisitFunc(
              visitor.getClass(),
              (Class<? extends E>) arg0.getClass(),
              methodName,
              otherArgClassList);
      if (method == null) {
        List<Class> classList = new ArrayList<>();
        classList.add(arg0Clazz);
        classList.addAll(otherArgClassList);
        throw new IllegalArgumentException("Method not found: " + methodName
            + "(" + classList + ")");
      }
      return method;
    }
Creates a dispatcher for calls to {@link VisitDispatcher#lookupVisitFunc}. The
dispatcher caches methods between invocations and it is thread-safe.

@param visitorBaseClazz Visitor base class
@param visiteeBaseClazz Visitee base class
@return cache of methods
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReflectUtil.java