io.tarantool.driver.core.proxy.UpdateProxyOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cartridge-driver Show documentation
Show all versions of cartridge-driver Show documentation
Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework
package io.tarantool.driver.core.proxy;
import io.tarantool.driver.api.SingleValueCallResult;
import io.tarantool.driver.api.TarantoolCallOperations;
import io.tarantool.driver.api.space.options.UpdateOptions;
import io.tarantool.driver.api.tuple.operations.TupleOperations;
import io.tarantool.driver.mappers.CallResultMapper;
import io.tarantool.driver.mappers.MessagePackObjectMapper;
import io.tarantool.driver.protocol.TarantoolIndexQuery;
import java.util.Arrays;
import java.util.List;
/**
* Proxy operation for update
*
* @param result type
* @author Sergey Volgin
* @author Artyom Dubinin
*/
public final class UpdateProxyOperation extends AbstractProxyOperation {
UpdateProxyOperation(
TarantoolCallOperations client,
String functionName,
List> arguments,
MessagePackObjectMapper argumentsMapper,
CallResultMapper> resultMapper) {
super(client, functionName, arguments, argumentsMapper, resultMapper);
}
/**
* The builder for this class.
*/
public static final class Builder
extends GenericOperationsBuilder> {
private TarantoolIndexQuery indexQuery;
private TupleOperations operations;
public Builder() {
}
@Override
Builder self() {
return this;
}
public Builder withIndexQuery(TarantoolIndexQuery indexQuery) {
this.indexQuery = indexQuery;
return this;
}
public Builder withTupleOperation(TupleOperations operations) {
this.operations = operations;
return this;
}
public UpdateProxyOperation build() {
CRUDBucketIdOptions requestOptions = new CRUDUpdateOptions.Builder()
.withTimeout(options.getTimeout())
.withBucketId(options.getBucketId())
.withFields(options.getFields())
.build();
List> arguments = Arrays.asList(spaceName,
indexQuery.getKeyValues(),
operations.asProxyOperationList(),
requestOptions.asMap());
return new UpdateProxyOperation<>(
this.client, this.functionName, arguments, this.argumentsMapper, this.resultMapper);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy