Search in sources :

Example 1 with InternalLogger

use of io.netty.util.internal.logging.InternalLogger in project lettuce-core by lettuce-io.

the class MasterReplica method connectAsyncSentinelOrStaticSetup.

private static <K, V> CompletableFuture<StatefulRedisMasterReplicaConnection<K, V>> connectAsyncSentinelOrStaticSetup(RedisClient redisClient, RedisCodec<K, V> codec, Iterable<RedisURI> redisURIs) {
    LettuceAssert.notNull(redisClient, "RedisClient must not be null");
    LettuceAssert.notNull(codec, "RedisCodec must not be null");
    LettuceAssert.notNull(redisURIs, "RedisURIs must not be null");
    List<RedisURI> uriList = LettuceLists.newList(redisURIs);
    LettuceAssert.isTrue(!uriList.isEmpty(), "RedisURIs must not be empty");
    RedisURI first = uriList.get(0);
    if (isSentinel(first)) {
        if (uriList.size() > 1) {
            InternalLogger logger = InternalLoggerFactory.getInstance(MasterReplica.class);
            logger.warn("RedisURIs contains multiple endpoints of which the first is configured for Sentinel usage. Using only the first URI [{}] without considering the remaining URIs. Make sure to include all Sentinel endpoints in a single RedisURI.", first);
        }
        return new SentinelConnector<>(redisClient, codec, first).connectAsync();
    }
    return new StaticMasterReplicaConnector<>(redisClient, codec, uriList).connectAsync();
}
Also used : RedisURI(io.lettuce.core.RedisURI) InternalLogger(io.netty.util.internal.logging.InternalLogger)

Example 2 with InternalLogger

use of io.netty.util.internal.logging.InternalLogger in project netty by netty.

the class DelegatingChannelPromiseNotifier method operationComplete.

@Override
public void operationComplete(ChannelFuture future) throws Exception {
    InternalLogger internalLogger = logNotifyFailure ? logger : null;
    if (future.isSuccess()) {
        Void result = future.get();
        PromiseNotificationUtil.trySuccess(delegate, result, internalLogger);
    } else if (future.isCancelled()) {
        PromiseNotificationUtil.tryCancel(delegate, internalLogger);
    } else {
        Throwable cause = future.cause();
        PromiseNotificationUtil.tryFailure(delegate, cause, internalLogger);
    }
}
Also used : InternalLogger(io.netty.util.internal.logging.InternalLogger)

Aggregations

InternalLogger (io.netty.util.internal.logging.InternalLogger)2 RedisURI (io.lettuce.core.RedisURI)1