Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Double and Boolean in MapOutput #2429

Closed
zhxjdwh opened this issue Jun 25, 2023 · 0 comments
Closed

Accept Double and Boolean in MapOutput #2429

zhxjdwh opened this issue Jun 25, 2023 · 0 comments
Labels
type: feature A new feature
Milestone

Comments

@zhxjdwh
Copy link

zhxjdwh commented Jun 25, 2023

Bug Report

dynamic command api bug: "io.lettuce.core.output.MapOutput does not support set(double)"

Current Behavior

Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy25.ftInfo(Unknown Source)
	at cn.com.dragonpass.cache.client.lettuce.Test.main(Test.java:33)
Caused by: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException: io.lettuce.core.output.MapOutput does not support set(double)
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
	at io.lettuce.core.dynamic.AsyncExecutableCommand.dispatchCommand(AsyncExecutableCommand.java:92)
	at io.lettuce.core.dynamic.AsyncExecutableCommand.execute(AsyncExecutableCommand.java:55)
	at io.lettuce.core.dynamic.RedisCommandFactory$CommandFactoryExecutorMethodInterceptor.invoke(RedisCommandFactory.java:235)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$MethodInterceptorContext.proceed(MethodInterceptorChain.java:118)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$PooledMethodInvocation.proceed(MethodInterceptorChain.java:201)
	at io.lettuce.core.dynamic.intercept.DefaultMethodInvokingInterceptor.invoke(DefaultMethodInvokingInterceptor.java:45)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain$MethodInterceptorContext.proceed(MethodInterceptorChain.java:118)
	at io.lettuce.core.dynamic.intercept.MethodInterceptorChain.invoke(MethodInterceptorChain.java:80)
	at io.lettuce.core.dynamic.intercept.InvocationProxyFactory$InterceptorChainInvocationHandler.handleInvocation(InvocationProxyFactory.java:102)
	at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
	... 2 more
Caused by: java.lang.UnsupportedOperationException: io.lettuce.core.output.MapOutput does not support set(double)
	at io.lettuce.core.output.CommandOutput.set(CommandOutput.java:118)
	at io.lettuce.core.protocol.RedisStateMachine.safeSet(RedisStateMachine.java:794)
	at io.lettuce.core.protocol.RedisStateMachine.handleFloat(RedisStateMachine.java:426)
	at io.lettuce.core.protocol.RedisStateMachine$State$Type.handle(RedisStateMachine.java:206)
	at io.lettuce.core.protocol.RedisStateMachine.doDecode(RedisStateMachine.java:334)
	at io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:295)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:842)
	at io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:793)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:776)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:659)
	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:599)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)
Disconnected from the target VM, address: '127.0.0.1:65451', transport: 'socket'

Process finished with exit code 1

Input Code

import java.util.List;
import java.util.Map;

public interface SearchCommands extends Commands {
    @Command("FT.INFO")
    Map<String, String> ftInfo(String index);
}

public class Test {
    public static void main(String[] args) throws Throwable {
        RedisClient redisClient = RedisClient.create("redis://127.0.0.1:6379/0");
        RedisCommandFactory factory = new RedisCommandFactory(redisClient.connect());
        SearchCommands commands = factory.getCommands(SearchCommands.class);

        Map<String, String> map = commands.ftInfo("myindex0");

        System.in.read();
    }
}

Expected behavior/code

io.lettuce.core.output.MapOutput should support set(double)

Environment

  • Lettuce version(s): 6.2.4.RELEASE
  • Redis version: 6.2.6-v7
@mp911de mp911de added the type: feature A new feature label Jun 26, 2023
@mp911de mp911de changed the title dynamic command api bug: "io.lettuce.core.output.MapOutput does not support set(double)" Accept Double and Boolean in MapOutput Jun 26, 2023
@mp911de mp911de added this to the 6.2.5.RELEASE milestone Jun 26, 2023
@mp911de mp911de closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants