Ejemplo n.º 1
0
    @Override
    public FunctionResponse getFunctionMeta(
        RpcController controller, GetFunctionMetaRequest request) {

      FunctionDescProto function = null;

      try {
        if (request.hasFunctionType()) {
          if (containFunction(
              request.getSignature(), request.getFunctionType(), request.getParameterTypesList())) {
            function =
                findFunction(
                    request.getSignature(),
                    request.getFunctionType(),
                    request.getParameterTypesList(),
                    true);
          }
        } else {
          function = findFunction(request.getSignature(), request.getParameterTypesList());
        }

        if (function != null) {
          return FunctionResponse.newBuilder().setState(OK).setFunction(function).build();
        } else {

          return FunctionResponse.newBuilder()
              .setState(
                  errUndefinedFunction(
                      buildSimpleFunctionSignature(
                          request.getSignature(), request.getParameterTypesList())))
              .build();
        }

      } catch (Throwable t) {
        printStackTraceIfError(LOG, t);

        return FunctionResponse.newBuilder().setState(returnError(t)).build();
      }
    }
Ejemplo n.º 2
0
 public static FunctionSignature create(GetFunctionMetaRequest proto) {
   return new FunctionSignature(
       proto.getSignature(), proto.getFunctionType(), proto.getParameterTypesList());
 }