提交 559c2866 编写于 作者: N Nikita Koksharov

deprecated decodeInExecutor setting removed

上级 07f4e089
......@@ -52,7 +52,6 @@ public class RedisClientConfig {
private String clientName;
private boolean readOnly;
private boolean keepPubSubOrder = true;
private boolean decodeInExecutor;
private int pingConnectionInterval;
private boolean keepAlive;
private boolean tcpNoDelay;
......@@ -97,7 +96,6 @@ public class RedisClientConfig {
this.sslKeystorePassword = config.sslKeystorePassword;
this.resolverGroup = config.resolverGroup;
this.sslHostname = config.sslHostname;
this.decodeInExecutor = config.decodeInExecutor;
}
public NettyHook getNettyHook() {
......@@ -275,15 +273,6 @@ public class RedisClientConfig {
return this;
}
public boolean isDecodeInExecutor() {
return decodeInExecutor;
}
@Deprecated
public RedisClientConfig setDecodeInExecutor(boolean decodeInExecutor) {
this.decodeInExecutor = decodeInExecutor;
return this;
}
public int getPingConnectionInterval() {
return pingConnectionInterval;
}
......
......@@ -68,10 +68,8 @@ public class CommandDecoder extends ReplayingDecoder<State> {
private static final char ZERO = '0';
final ExecutorService executor;
private final boolean decodeInExecutor;
public CommandDecoder(ExecutorService executor, boolean decodeInExecutor) {
this.decodeInExecutor = decodeInExecutor;
public CommandDecoder(ExecutorService executor) {
this.executor = executor;
}
......@@ -116,23 +114,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
log.trace("reply: {}, channel: {}, command: {}", in.toString(0, in.writerIndex(), CharsetUtil.UTF_8), ctx.channel(), data);
}
if (decodeInExecutor && !(data instanceof CommandsData)) {
ByteBuf copy = in.copy(in.readerIndex(), in.writerIndex() - in.readerIndex());
in.skipBytes(in.writerIndex() - in.readerIndex());
executor.execute(() -> {
state(new State());
try {
decodeCommand(ctx.channel(), copy, data);
} catch (Exception e) {
log.error("Unable to decode data in separate thread: " + LogHelper.toString(data), e);
} finally {
copy.release();
}
});
} else {
decodeCommand(ctx.channel(), in, data);
}
decodeCommand(ctx.channel(), in, data);
}
protected void sendNext(Channel channel, QueueCommand data) {
......
......@@ -53,8 +53,8 @@ public class CommandPubSubDecoder extends CommandDecoder {
private final boolean keepOrder;
public CommandPubSubDecoder(ExecutorService executor, boolean keepOrder, boolean decodeInExecutor) {
super(executor, decodeInExecutor);
public CommandPubSubDecoder(ExecutorService executor, boolean keepOrder) {
super(executor);
this.keepOrder = keepOrder;
}
......
......@@ -95,9 +95,9 @@ public class RedisChannelInitializer extends ChannelInitializer<Channel> {
}
if (type == Type.PLAIN) {
ch.pipeline().addLast(new CommandDecoder(config.getExecutor(), config.isDecodeInExecutor()));
ch.pipeline().addLast(new CommandDecoder(config.getExecutor()));
} else {
ch.pipeline().addLast(new CommandPubSubDecoder(config.getExecutor(), config.isKeepPubSubOrder(), config.isDecodeInExecutor()));
ch.pipeline().addLast(new CommandPubSubDecoder(config.getExecutor(), config.isKeepPubSubOrder()));
}
ch.pipeline().addLast(new ErrorsLoggingHandler());
......
......@@ -122,7 +122,6 @@ public class Config {
setMinCleanUpDelay(oldConf.getMinCleanUpDelay());
setMaxCleanUpDelay(oldConf.getMaxCleanUpDelay());
setCleanUpKeysAmount(oldConf.getCleanUpKeysAmount());
setDecodeInExecutor(oldConf.isDecodeInExecutor());
setUseScriptCache(oldConf.isUseScriptCache());
setKeepPubSubOrder(oldConf.isKeepPubSubOrder());
setLockWatchdogTimeout(oldConf.getLockWatchdogTimeout());
......@@ -717,25 +716,6 @@ public class Config {
return useScriptCache;
}
public boolean isDecodeInExecutor() {
return decodeInExecutor;
}
/**
* Defines whether to decode data by <code>codec</code> in executor's threads or netty's threads.
* If decoding data process takes long time and netty thread is used then `RedisTimeoutException` could arise time to time.
* <p>
* Default is <code>false</code>.
*
* @param decodeInExecutor - <code>true</code> to use executor's threads, <code>false</code> to use netty's threads.
* @return config
*/
@Deprecated
public Config setDecodeInExecutor(boolean decodeInExecutor) {
this.decodeInExecutor = decodeInExecutor;
return this;
}
public int getMinCleanUpDelay() {
return minCleanUpDelay;
}
......
......@@ -470,7 +470,6 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
.setSslKeystore(config.getSslKeystore())
.setSslKeystorePassword(config.getSslKeystorePassword())
.setClientName(config.getClientName())
.setDecodeInExecutor(cfg.isDecodeInExecutor())
.setKeepPubSubOrder(cfg.isKeepPubSubOrder())
.setPingConnectionInterval(config.getPingConnectionInterval())
.setKeepAlive(config.isKeepAlive())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册