private static Class<? extends VarArgsFunc> getVarArgsFuncClass(int length) {
    switch (length) {
      case 1:
        return VarArgsFunc1.class;
      case 2:
        return VarArgsFunc2.class;
      case 3:
        return VarArgsFunc3.class;
      case 4:
        return VarArgsFunc4.class;
      default:
        throw new RuntimeException("Unsupported function with length " + length);
    }
  }
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