public ByteBuffer getOutput(ProtocolVersion protocolVersion) throws InvalidRequestException { for (int i = 0, m = argSelectors.size(); i < m; i++) { Selector s = argSelectors.get(i); setArg(i, s.getOutput(protocolVersion)); s.reset(); } return fun.execute(protocolVersion, args()); }
public ByteBuffer getOutput(ProtocolVersion protocolVersion) throws InvalidRequestException { for (int i = 0, m = argSelectors.size(); i < m; i++) { Selector s = argSelectors.get(i); setArg(i, s.getOutput(protocolVersion)); s.reset(); } return fun.execute(protocolVersion, args()); }
public ByteBuffer getOutput(ProtocolVersion protocolVersion) throws InvalidRequestException { for (int i = 0, m = argSelectors.size(); i < m; i++) { Selector s = argSelectors.get(i); setArg(i, s.getOutput(protocolVersion)); s.reset(); } return fun.execute(protocolVersion, args()); }
private static ByteBuffer executeInternal(ProtocolVersion protocolVersion, ScalarFunction fun, List<ByteBuffer> params) throws InvalidRequestException { ByteBuffer result = fun.execute(protocolVersion, params); try { // Check the method didn't lied on it's declared return type if (result != null) fun.returnType().validate(result); return result; } catch (MarshalException e) { throw new RuntimeException(String.format("Return of function %s (%s) is not a valid value for its declared return type %s", fun, ByteBufferUtil.bytesToHex(result), fun.returnType().asCQL3Type()), e); } }
private static ByteBuffer executeInternal(ProtocolVersion protocolVersion, ScalarFunction fun, List<ByteBuffer> params) throws InvalidRequestException { ByteBuffer result = fun.execute(protocolVersion, params); try { // Check the method didn't lied on it's declared return type if (result != null) fun.returnType().validate(result); return result; } catch (MarshalException e) { throw new RuntimeException(String.format("Return of function %s (%s) is not a valid value for its declared return type %s", fun, ByteBufferUtil.bytesToHex(result), fun.returnType().asCQL3Type()), e); } }
private static ByteBuffer executeInternal(ProtocolVersion protocolVersion, ScalarFunction fun, List<ByteBuffer> params) throws InvalidRequestException { ByteBuffer result = fun.execute(protocolVersion, params); try { // Check the method didn't lied on it's declared return type if (result != null) fun.returnType().validate(result); return result; } catch (MarshalException e) { throw new RuntimeException(String.format("Return of function %s (%s) is not a valid value for its declared return type %s", fun, ByteBufferUtil.bytesToHex(result), fun.returnType().asCQL3Type()), e); } }