io.tarantool.driver.core.AbstractTarantoolConnectionManager 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;
import io.tarantool.driver.ConnectionSelectionStrategy;
import io.tarantool.driver.ConnectionSelectionStrategyFactory;
import io.tarantool.driver.TarantoolClientConfig;
import io.tarantool.driver.TarantoolServerAddress;
import io.tarantool.driver.exceptions.TarantoolClientException;
import io.tarantool.driver.exceptions.TarantoolClientNotConnectedException;
import io.tarantool.driver.exceptions.TarantoolException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* Contains basic connection establishing and selection strategy invocation algorithms. Subclasses must implement
* the retrieving of Tarantool server addresses.
*
* @author Alexey Kuzin
*/
public abstract class AbstractTarantoolConnectionManager implements TarantoolConnectionManager {
private final TarantoolClientConfig config;
private final TarantoolConnectionFactory connectionFactory;
private final ConnectionSelectionStrategyFactory selectStrategyFactory;
private final TarantoolConnectionListeners connectionListeners;
private final AtomicReference