2
2
3
3
import static redis .clients .jedis .Protocol .Command .KEYS ;
4
4
import static redis .clients .jedis .Protocol .Command .SCAN ;
5
- import static redis .clients .jedis .Protocol .Command .WAIT ;
6
5
import static redis .clients .jedis .Protocol .Keyword .TYPE ;
7
6
7
+ import java .util .List ;
8
+ import java .util .Map ;
8
9
import java .util .Set ;
10
+
9
11
import redis .clients .jedis .commands .ProtocolCommand ;
10
12
import redis .clients .jedis .params .ScanParams ;
11
13
import redis .clients .jedis .resps .ScanResult ;
12
14
import redis .clients .jedis .search .IndexOptions ;
13
15
import redis .clients .jedis .search .Query ;
14
16
import redis .clients .jedis .search .Schema ;
15
- import redis .clients .jedis .search .SearchProtocol ;
16
17
import redis .clients .jedis .search .SearchResult ;
18
+ import redis .clients .jedis .search .aggr .AggregationBuilder ;
19
+ import redis .clients .jedis .search .aggr .AggregationResult ;
17
20
import redis .clients .jedis .util .JedisClusterHashTag ;
18
21
19
22
public class RedisClusterCommandObjects extends RedisCommandObjects {
@@ -25,6 +28,11 @@ protected ClusterCommandArguments commandArguments(ProtocolCommand command) {
25
28
26
29
private static final String CLUSTER_UNSUPPORTED_MESSAGE = "Not supported in cluster mode." ;
27
30
31
+ @ Override
32
+ public CommandObject <Long > dbSize () {
33
+ throw new UnsupportedOperationException (CLUSTER_UNSUPPORTED_MESSAGE );
34
+ }
35
+
28
36
private static final String KEYS_PATTERN_MESSAGE = "Cluster mode only supports KEYS command"
29
37
+ " with pattern containing hash-tag ( curly-brackets enclosed string )" ;
30
38
@@ -105,23 +113,106 @@ private <T> CommandObject<T> processSearchCommand(String indexName, CommandObjec
105
113
return command ;
106
114
}
107
115
108
- private <T > CommandObject <T > processSearchCommand (byte [] indexName , CommandObject <T > command ) {
116
+ @ Override
117
+ public final CommandObject <String > ftCreate (String indexName , IndexOptions indexOptions , Schema schema ) {
118
+ return processSearchCommand (indexName , super .ftCreate (indexName , indexOptions , schema ));
119
+ }
120
+
121
+ @ Override
122
+ public final CommandObject <String > ftAlter (String indexName , Schema schema ) {
123
+ return processSearchCommand (indexName , super .ftAlter (indexName , schema ));
124
+ }
125
+
126
+ @ Override
127
+ public final CommandObject <SearchResult > ftSearch (String indexName , Query query ) {
128
+ return processSearchCommand (indexName , super .ftSearch (indexName , query ));
129
+ }
130
+
131
+ @ Override
132
+ public final CommandObject <SearchResult > ftSearch (byte [] indexName , Query query ) {
133
+ CommandObject <SearchResult > command = super .ftSearch (indexName , query );
109
134
if (searchLite ) command .getArguments ().processKey (indexName );
110
135
return command ;
111
136
}
112
137
113
138
@ Override
114
- public CommandObject <String > ftCreate (String indexName , IndexOptions indexOptions , Schema schema ) {
115
- return processSearchCommand (indexName , super .ftCreate (indexName , indexOptions , schema ));
139
+ public CommandObject <String > ftExplain (String indexName , Query query ) {
140
+ return processSearchCommand (indexName , super .ftExplain (indexName , query ));
116
141
}
117
142
118
143
@ Override
119
- public CommandObject <SearchResult > ftSearch (String indexName , Query query ) {
120
- return processSearchCommand (indexName , super .ftSearch (indexName , query ));
144
+ public CommandObject <List < String >> ftExplainCLI (String indexName , Query query ) {
145
+ return processSearchCommand (indexName , super .ftExplainCLI (indexName , query ));
121
146
}
122
147
123
148
@ Override
124
- public CommandObject <SearchResult > ftSearch (byte [] indexName , Query query ) {
125
- return processSearchCommand (indexName , super .ftSearch (indexName , query ));
149
+ public CommandObject <AggregationResult > ftAggregate (String indexName , AggregationBuilder aggr ) {
150
+ return processSearchCommand (indexName , super .ftAggregate (indexName , aggr ));
151
+ }
152
+
153
+ @ Override
154
+ public CommandObject <AggregationResult > ftCursorRead (String indexName , long cursorId , int count ) {
155
+ return processSearchCommand (indexName , super .ftCursorRead (indexName , cursorId , count ));
156
+ }
157
+
158
+ @ Override
159
+ public CommandObject <String > ftCursorDel (String indexName , long cursorId ) {
160
+ return processSearchCommand (indexName , super .ftCursorDel (indexName , cursorId ));
161
+ }
162
+
163
+ @ Override
164
+ public CommandObject <String > ftDropIndex (String indexName ) {
165
+ return processSearchCommand (indexName , super .ftDropIndex (indexName ));
166
+ }
167
+
168
+ @ Override
169
+ public CommandObject <String > ftDropIndexDD (String indexName ) {
170
+ return processSearchCommand (indexName , super .ftDropIndexDD (indexName ));
171
+ }
172
+
173
+ @ Override
174
+ public CommandObject <String > ftSynUpdate (String indexName , String synonymGroupId , String ... terms ) {
175
+ return processSearchCommand (indexName , super .ftSynUpdate (indexName , synonymGroupId , terms ));
176
+ }
177
+
178
+ @ Override
179
+ public CommandObject <Map <String , List <Object >>> ftSynDump (String indexName ) {
180
+ return processSearchCommand (indexName , super .ftSynDump (indexName ));
181
+ }
182
+
183
+ @ Override
184
+ public CommandObject <Map <String , Object >> ftInfo (String indexName ) {
185
+ return processSearchCommand (indexName , super .ftInfo (indexName ));
186
+ }
187
+
188
+ @ Override
189
+ public CommandObject <String > ftAliasAdd (String aliasName , String indexName ) {
190
+ CommandObject <String > command = super .ftAliasAdd (aliasName , indexName );
191
+ if (searchLite ) command .getArguments ().processKey (aliasName ).processKey (indexName );
192
+ return command ;
193
+ }
194
+
195
+ @ Override
196
+ public CommandObject <String > ftAliasUpdate (String aliasName , String indexName ) {
197
+ CommandObject <String > command = super .ftAliasUpdate (aliasName , indexName );
198
+ if (searchLite ) command .getArguments ().processKey (aliasName ).processKey (indexName );
199
+ return command ;
200
+ }
201
+
202
+ @ Override
203
+ public CommandObject <String > ftAliasDel (String aliasName ) {
204
+ CommandObject <String > command = super .ftAliasDel (aliasName );
205
+ if (searchLite ) command .getArguments ().processKey (aliasName );
206
+ return command ;
207
+ }
208
+
209
+ @ Override
210
+ public CommandObject <Map <String , String >> ftConfigGet (String indexName , String option ) {
211
+ return processSearchCommand (indexName , super .ftConfigGet (indexName , option ));
212
+ }
213
+
214
+ @ Override
215
+ public CommandObject <String > ftConfigSet (String indexName , String option , String value ) {
216
+ return processSearchCommand (indexName , super .ftConfigSet (indexName , option , value ));
126
217
}
127
218
}
0 commit comments