|
1 | 1 | /* |
2 | | - * Copyright 2020 dengliming. |
| 2 | + * Copyright 2020-2024 dengliming. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
16 | 16 |
|
17 | 17 | package io.github.dengliming.redismodule.redisai.protocol; |
18 | 18 |
|
| 19 | +import io.github.dengliming.redismodule.redisai.model.Model; |
| 20 | +import io.github.dengliming.redismodule.redisai.model.Script; |
| 21 | +import io.github.dengliming.redismodule.redisai.model.Tensor; |
19 | 22 | import io.github.dengliming.redismodule.redisai.protocol.decoder.ModelDecoder; |
20 | 23 | import io.github.dengliming.redismodule.redisai.protocol.decoder.ScriptDecoder; |
21 | 24 | import io.github.dengliming.redismodule.redisai.protocol.decoder.TensorDecoder; |
|
26 | 29 | import org.redisson.client.protocol.decoder.ObjectListReplayDecoder; |
27 | 30 | import org.redisson.client.protocol.decoder.ObjectMapReplayDecoder; |
28 | 31 |
|
| 32 | +import java.util.Map; |
| 33 | + |
29 | 34 | /** |
30 | | - * @author dengliming |
| 35 | + * RedisAI commands. |
31 | 36 | */ |
| 37 | +@SuppressWarnings({"unchecked", "rawtypes"}) |
32 | 38 | public interface RedisCommands { |
33 | 39 |
|
34 | | - RedisCommand AI_TENSORSET = new RedisCommand<>("AI.TENSORSET", new BooleanReplayConvertor()); |
35 | | - RedisCommand AI_TENSORGET = new RedisCommand<>("AI.TENSORGET", new ListMultiDecoder2<>(new TensorDecoder(), new ObjectListReplayDecoder<>())); |
36 | | - RedisCommand AI_MODELSET = new RedisCommand<>("AI.MODELSET", new BooleanReplayConvertor()); |
37 | | - RedisCommand AI_MODELGET = new RedisCommand<>("AI.MODELGET", new ListMultiDecoder2<>(new ModelDecoder(), new ObjectListReplayDecoder<>())); |
38 | | - RedisCommand AI_MODELDEL = new RedisCommand<>("AI.MODELDEL", new BooleanReplayConvertor()); |
39 | | - RedisCommand AI_MODELRUN = new RedisCommand<>("AI.MODELRUN", new VoidReplayConvertor()); |
40 | | - RedisCommand AI_MODELSCAN = new RedisCommand<>("AI._MODELSCAN", new VoidReplayConvertor()); |
41 | | - RedisCommand AI_SCRIPTSET = new RedisCommand<>("AI.SCRIPTSET", new BooleanReplayConvertor()); |
42 | | - RedisCommand AI_SCRIPTGET = new RedisCommand<>("AI.SCRIPTGET", new ListMultiDecoder2<>(new ScriptDecoder(), new ObjectListReplayDecoder<>())); |
43 | | - RedisCommand AI_SCRIPTDEL = new RedisCommand<>("AI.SCRIPTDEL", new BooleanReplayConvertor()); |
44 | | - RedisCommand AI_SCRIPTRUN = new RedisCommand<>("AI.SCRIPTRUN", new BooleanReplayConvertor()); |
45 | | - RedisCommand AI_SCRIPTSCAN = new RedisCommand<>("AI._SCRIPTSCAN", new VoidReplayConvertor()); |
46 | | - RedisCommand AI_DAGRUN = new RedisCommand<>("AI.DAGRUN", new VoidReplayConvertor()); |
47 | | - RedisCommand AI_DAGRUN_RO = new RedisCommand<>("AI.DAGRUN_RO", new VoidReplayConvertor()); |
48 | | - RedisCommand AI_INFO = new RedisCommand<>("AI.INFO", new ObjectMapReplayDecoder()); |
49 | | - RedisCommand AI_INFO_RESETSTAT = new RedisCommand<>("AI.INFO", new BooleanReplayConvertor()); |
50 | | - RedisCommand AI_CONFIG = new RedisCommand<>("AI.CONFIG", new BooleanReplayConvertor()); |
51 | | - RedisCommand AI_SCRIPTSTORE = new RedisCommand<>("AI.SCRIPTSTORE", new BooleanReplayConvertor()); |
| 40 | + RedisCommand<Boolean> AI_TENSORSET = new RedisCommand<>("AI.TENSORSET", new BooleanReplayConvertor()); |
| 41 | + RedisCommand<Tensor> AI_TENSORGET = new RedisCommand<>("AI.TENSORGET", new ListMultiDecoder2(new TensorDecoder(), new ObjectListReplayDecoder<>())); |
| 42 | + RedisCommand<Boolean> AI_MODELSET = new RedisCommand<>("AI.MODELSET", new BooleanReplayConvertor()); |
| 43 | + RedisCommand<Model> AI_MODELGET = new RedisCommand<>("AI.MODELGET", new ListMultiDecoder2(new ModelDecoder(), new ObjectListReplayDecoder<>())); |
| 44 | + RedisCommand<Boolean> AI_MODELDEL = new RedisCommand<>("AI.MODELDEL", new BooleanReplayConvertor()); |
| 45 | + RedisCommand<Void> AI_MODELRUN = new RedisCommand<>("AI.MODELRUN", new VoidReplayConvertor()); |
| 46 | + RedisCommand<Void> AI_MODELSCAN = new RedisCommand<>("AI._MODELSCAN", new VoidReplayConvertor()); |
| 47 | + RedisCommand<Boolean> AI_SCRIPTSET = new RedisCommand<>("AI.SCRIPTSET", new BooleanReplayConvertor()); |
| 48 | + RedisCommand<Script> AI_SCRIPTGET = new RedisCommand<>("AI.SCRIPTGET", new ListMultiDecoder2(new ScriptDecoder(), new ObjectListReplayDecoder<>())); |
| 49 | + RedisCommand<Boolean> AI_SCRIPTDEL = new RedisCommand<>("AI.SCRIPTDEL", new BooleanReplayConvertor()); |
| 50 | + RedisCommand<Boolean> AI_SCRIPTRUN = new RedisCommand<>("AI.SCRIPTRUN", new BooleanReplayConvertor()); |
| 51 | + RedisCommand<Void> AI_SCRIPTSCAN = new RedisCommand<>("AI._SCRIPTSCAN", new VoidReplayConvertor()); |
| 52 | + RedisCommand<Void> AI_DAGRUN = new RedisCommand<>("AI.DAGRUN", new VoidReplayConvertor()); |
| 53 | + RedisCommand<Void> AI_DAGRUN_RO = new RedisCommand<>("AI.DAGRUN_RO", new VoidReplayConvertor()); |
| 54 | + RedisCommand<Map<String, Object>> AI_INFO = new RedisCommand<>("AI.INFO", new ObjectMapReplayDecoder()); |
| 55 | + RedisCommand<Boolean> AI_INFO_RESETSTAT = new RedisCommand<>("AI.INFO", new BooleanReplayConvertor()); |
| 56 | + RedisCommand<Boolean> AI_CONFIG = new RedisCommand<>("AI.CONFIG", new BooleanReplayConvertor()); |
| 57 | + RedisCommand<Boolean> AI_SCRIPTSTORE = new RedisCommand<>("AI.SCRIPTSTORE", new BooleanReplayConvertor()); |
52 | 58 | } |
0 commit comments