All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.tarantool.driver.api.space.options.proxy.ProxySelectOptions Maven / Gradle / Ivy

Go to download

Tarantool Cartridge driver for Tarantool versions 1.10+ based on Netty framework

There is a newer version: 0.14.0
Show newest version
package io.tarantool.driver.api.space.options.proxy;

import io.tarantool.driver.api.space.options.BaseOptions;
import io.tarantool.driver.api.space.options.SelectOptions;

import java.util.Optional;

/**
 * Represent options for select cluster proxy operation
 *
 * @author Alexey Kuzin
 * @author Artyom Dubinin
 */
public final class ProxySelectOptions extends BaseOptions implements SelectOptions {

    public static final String BATCH_SIZE = "batch_size";

    private ProxySelectOptions() {
    }

    /**
     * Create new instance.
     *
     * @return new options instance
     */
    public static ProxySelectOptions create() {
        return new ProxySelectOptions();
    }

    /**
     * Specifies internal batch size for transferring data from storage nodes to router nodes.
     *
     * @param batchSize batch size, should be greater than 0
     * @return this options instance
     */
    public ProxySelectOptions withBatchSize(int batchSize) {
        if (batchSize <= 0) {
            throw new IllegalArgumentException("Batch size should be greater than 0");
        }
        addOption(BATCH_SIZE, batchSize);
        return self();
    }

    @Override
    public ProxySelectOptions self() {
        return this;
    }

    @Override
    public Optional getBatchSize() {
        return getOption(BATCH_SIZE, Integer.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy