private ByteBuffer executeAsync(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { ThreadIdAndCpuTime threadIdAndCpuTime = new ThreadIdAndCpuTime(); return async(threadIdAndCpuTime, () -> { threadIdAndCpuTime.setup(); return executeUserDefined(protocolVersion, parameters); }); }
/** * Like {@link #executeAsync(int, List)} but the first parameter is already in non-serialized form. * Remaining parameters (2nd paramters and all others) are in {@code parameters}. * This is used to prevent superfluous (de)serialization of the state of aggregates. * Means: scalar functions of aggregates are called using this variant. */ private Object executeAggregateAsync(ProtocolVersion protocolVersion, Object firstParam, List<ByteBuffer> parameters) { ThreadIdAndCpuTime threadIdAndCpuTime = new ThreadIdAndCpuTime(); return async(threadIdAndCpuTime, () -> { threadIdAndCpuTime.setup(); return executeAggregateUserDefined(protocolVersion, firstParam, parameters); }); }
/** * Used by UDF implementations (both Java code generated by {@link JavaBasedUDFunction} * and script executor {@link ScriptBasedUDFunction}) to convert the Java * object representation for the return value to the C* serialized representation. * * @param protocolVersion the native protocol version used for serialization */ protected ByteBuffer decompose(ProtocolVersion protocolVersion, Object value) { return decompose(returnCodec, protocolVersion, value); }
public Aggregate newAggregate() { return new LongSumAggregate(); } };
AggregateFunctionSelector(Function fun, List<Selector> argSelectors) throws InvalidRequestException { super((AggregateFunction) fun, argSelectors); this.aggregate = this.fun.newAggregate(); } }
public static <I, O> CassandraFunctionWrapper<I, O> create(AbstractType<I> inputType, AbstractType<O> outputType, NativeScalarFunction delegate) { return new CassandraFunctionWrapper<I, O>(inputType, outputType, delegate); }
public static <I> CastAsTextFunction<I> create(AbstractType<I> inputType, AbstractType<String> outputType) { return new CastAsTextFunction<I>(inputType, outputType); }
public static <I, O> JavaFunctionWrapper<I, O> create(AbstractType<I> inputType, AbstractType<O> outputType, java.util.function.Function<I, O> converter) { return new JavaFunctionWrapper<I, O>(inputType, outputType, converter); }
public UDFByteCodeVerifier() { addDisallowedMethodCall(OBJECT_NAME, "clone"); addDisallowedMethodCall(OBJECT_NAME, "finalize"); addDisallowedMethodCall(OBJECT_NAME, "notify"); addDisallowedMethodCall(OBJECT_NAME, "notifyAll"); addDisallowedMethodCall(OBJECT_NAME, "wait"); }
private ByteBuffer executeAsync(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { ThreadIdAndCpuTime threadIdAndCpuTime = new ThreadIdAndCpuTime(); return async(threadIdAndCpuTime, () -> { threadIdAndCpuTime.setup(); return executeUserDefined(protocolVersion, parameters); }); }
/** * Like {@link #executeAsync(int, List)} but the first parameter is already in non-serialized form. * Remaining parameters (2nd paramters and all others) are in {@code parameters}. * This is used to prevent superfluous (de)serialization of the state of aggregates. * Means: scalar functions of aggregates are called using this variant. */ private Object executeAggregateAsync(ProtocolVersion protocolVersion, Object firstParam, List<ByteBuffer> parameters) { ThreadIdAndCpuTime threadIdAndCpuTime = new ThreadIdAndCpuTime(); return async(threadIdAndCpuTime, () -> { threadIdAndCpuTime.setup(); return executeAggregateUserDefined(protocolVersion, firstParam, parameters); }); }
/** * Used by UDF implementations (both Java code generated by {@link JavaBasedUDFunction} * and script executor {@link ScriptBasedUDFunction}) to convert the Java * object representation for the return value to the C* serialized representation. * * @param protocolVersion the native protocol version used for serialization */ protected ByteBuffer decompose(ProtocolVersion protocolVersion, Object value) { return decompose(returnCodec, protocolVersion, value); }
public Aggregate newAggregate() { return new LongSumAggregate(); } };
AggregateFunctionSelector(Function fun, List<Selector> argSelectors) throws InvalidRequestException { super((AggregateFunction) fun, argSelectors); this.aggregate = this.fun.newAggregate(); } }
public static <I, O> CassandraFunctionWrapper<I, O> create(AbstractType<I> inputType, AbstractType<O> outputType, NativeScalarFunction delegate) { return new CassandraFunctionWrapper<I, O>(inputType, outputType, delegate); }
private ByteBuffer executeAsync(ProtocolVersion protocolVersion, List<ByteBuffer> parameters) { ThreadIdAndCpuTime threadIdAndCpuTime = new ThreadIdAndCpuTime(); return async(threadIdAndCpuTime, () -> { threadIdAndCpuTime.setup(); return executeUserDefined(protocolVersion, parameters); }); }