diff --git a/src/main/java/io/lettuce/core/protocol/Command.java b/src/main/java/io/lettuce/core/protocol/Command.java index 31724c750b..835b543de3 100644 --- a/src/main/java/io/lettuce/core/protocol/Command.java +++ b/src/main/java/io/lettuce/core/protocol/Command.java @@ -108,6 +108,7 @@ public void cancel() { */ public void encode(ByteBuf buf) { + buf.touch("Command.encode(…)"); buf.writeByte('*'); CommandArgs.IntegerArgument.writeInteger(buf, 1 + (args != null ? args.count() : 0)); diff --git a/src/main/java/io/lettuce/core/protocol/CommandArgs.java b/src/main/java/io/lettuce/core/protocol/CommandArgs.java index 1e47ce3303..876a616ee2 100644 --- a/src/main/java/io/lettuce/core/protocol/CommandArgs.java +++ b/src/main/java/io/lettuce/core/protocol/CommandArgs.java @@ -342,6 +342,7 @@ public ByteBuffer getFirstEncodedKey() { */ public void encode(ByteBuf buf) { + buf.touch("CommandArgs.encode(…)"); for (SingularArgument singularArgument : singularArguments) { singularArgument.encode(buf); } diff --git a/src/main/java/io/lettuce/core/protocol/CommandEncoder.java b/src/main/java/io/lettuce/core/protocol/CommandEncoder.java index 1a9323487c..b25d564069 100644 --- a/src/main/java/io/lettuce/core/protocol/CommandEncoder.java +++ b/src/main/java/io/lettuce/core/protocol/CommandEncoder.java @@ -70,6 +70,7 @@ protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, Object msg, boolean @SuppressWarnings("unchecked") protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception { + out.touch("CommandEncoder.encode(…)"); if (msg instanceof RedisCommand) { RedisCommand command = (RedisCommand) msg; encode(ctx, out, command); diff --git a/src/main/java/io/lettuce/core/protocol/CommandHandler.java b/src/main/java/io/lettuce/core/protocol/CommandHandler.java index 22e9d03feb..2a2cf88e94 100644 --- a/src/main/java/io/lettuce/core/protocol/CommandHandler.java +++ b/src/main/java/io/lettuce/core/protocol/CommandHandler.java @@ -533,6 +533,7 @@ private static boolean isWriteable(RedisCommand command) { public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ByteBuf input = (ByteBuf) msg; + input.touch("CommandHandler.read(…)"); if (!input.isReadable() || input.refCnt() == 0) { logger.warn("{} Input not readable {}, {}", logPrefix(), input.isReadable(), input.refCnt()); @@ -558,6 +559,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception logger.trace("{} Buffer: {}", logPrefix(), input.toString(Charset.defaultCharset()).trim()); } + buffer.touch("CommandHandler.read(…)"); buffer.writeBytes(input); decode(ctx, buffer); diff --git a/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java b/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java index 1148313cee..9c96234b51 100644 --- a/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java +++ b/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java @@ -89,6 +89,7 @@ public boolean decode(ByteBuf buffer, RedisCommand command, CommandOutp int length, end; ByteBuffer bytes; + buffer.touch("RedisStateMachine.decode(…)"); if (debugEnabled) { logger.debug("Decode {}", command); }