Skip to content

Commit 8310408

Browse files
authored
Merge branch 'master' into 5.2.0
2 parents a0b0c59 + 4ca869e commit 8310408

21 files changed

+2131
-64
lines changed

src/main/java/redis/clients/jedis/BuilderFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ public String toString() {
661661
}
662662
};
663663

664+
@Deprecated
664665
public static final Builder<Set<Tuple>> TUPLE_ZSET = new Builder<Set<Tuple>>() {
665666
@Override
666667
@SuppressWarnings("unchecked")
@@ -683,6 +684,7 @@ public String toString() {
683684
}
684685
};
685686

687+
@Deprecated
686688
public static final Builder<Set<Tuple>> TUPLE_ZSET_RESP3 = new Builder<Set<Tuple>>() {
687689
@Override
688690
@SuppressWarnings("unchecked")

src/main/java/redis/clients/jedis/CommandObjects.java

Lines changed: 135 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,10 +1140,6 @@ public final CommandObject<ScanResult<String>> hscanNoValues(String key, String
11401140
return new CommandObject<>(commandArguments(HSCAN).key(key).add(cursor).addParams(params).add(NOVALUES), BuilderFactory.SCAN_RESPONSE);
11411141
}
11421142

1143-
public final CommandObject<Long> hstrlen(String key, String field) {
1144-
return new CommandObject<>(commandArguments(HSTRLEN).key(key).add(field), BuilderFactory.LONG);
1145-
}
1146-
11471143
public final CommandObject<ScanResult<Map.Entry<byte[], byte[]>>> hscan(byte[] key, byte[] cursor, ScanParams params) {
11481144
return new CommandObject<>(commandArguments(HSCAN).key(key).add(cursor).addParams(params), BuilderFactory.HSCAN_BINARY_RESPONSE);
11491145
}
@@ -1152,9 +1148,143 @@ public final CommandObject<ScanResult<byte[]>> hscanNoValues(byte[] key, byte[]
11521148
return new CommandObject<>(commandArguments(HSCAN).key(key).add(cursor).addParams(params).add(NOVALUES), BuilderFactory.SCAN_BINARY_RESPONSE);
11531149
}
11541150

1151+
public final CommandObject<Long> hstrlen(String key, String field) {
1152+
return new CommandObject<>(commandArguments(HSTRLEN).key(key).add(field), BuilderFactory.LONG);
1153+
}
1154+
11551155
public final CommandObject<Long> hstrlen(byte[] key, byte[] field) {
11561156
return new CommandObject<>(commandArguments(HSTRLEN).key(key).add(field), BuilderFactory.LONG);
11571157
}
1158+
1159+
public final CommandObject<List<Long>> hexpire(String key, long seconds, String... fields) {
1160+
return new CommandObject<>(commandArguments(HEXPIRE).key(key).add(seconds)
1161+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1162+
}
1163+
1164+
public final CommandObject<List<Long>> hexpire(String key, long seconds, ExpiryOption condition, String... fields) {
1165+
return new CommandObject<>(commandArguments(HEXPIRE).key(key).add(seconds).add(condition)
1166+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1167+
}
1168+
1169+
public final CommandObject<List<Long>> hpexpire(String key, long milliseconds, String... fields) {
1170+
return new CommandObject<>(commandArguments(HPEXPIRE).key(key).add(milliseconds)
1171+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1172+
}
1173+
1174+
public final CommandObject<List<Long>> hpexpire(String key, long milliseconds, ExpiryOption condition, String... fields) {
1175+
return new CommandObject<>(commandArguments(HPEXPIRE).key(key).add(milliseconds).add(condition)
1176+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1177+
}
1178+
1179+
public final CommandObject<List<Long>> hexpireAt(String key, long unixTimeSeconds, String... fields) {
1180+
return new CommandObject<>(commandArguments(HEXPIREAT).key(key).add(unixTimeSeconds)
1181+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1182+
}
1183+
1184+
public final CommandObject<List<Long>> hexpireAt(String key, long unixTimeSeconds, ExpiryOption condition, String... fields) {
1185+
return new CommandObject<>(commandArguments(HEXPIREAT).key(key).add(unixTimeSeconds).add(condition)
1186+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1187+
}
1188+
1189+
public final CommandObject<List<Long>> hpexpireAt(String key, long unixTimeMillis, String... fields) {
1190+
return new CommandObject<>(commandArguments(HPEXPIREAT).key(key).add(unixTimeMillis)
1191+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1192+
}
1193+
1194+
public final CommandObject<List<Long>> hpexpireAt(String key, long unixTimeMillis, ExpiryOption condition, String... fields) {
1195+
return new CommandObject<>(commandArguments(HPEXPIREAT).key(key).add(unixTimeMillis).add(condition)
1196+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1197+
}
1198+
1199+
public final CommandObject<List<Long>> hexpire(byte[] key, long seconds, byte[]... fields) {
1200+
return new CommandObject<>(commandArguments(HEXPIRE).key(key).add(seconds)
1201+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1202+
}
1203+
1204+
public final CommandObject<List<Long>> hexpire(byte[] key, long seconds, ExpiryOption condition, byte[]... fields) {
1205+
return new CommandObject<>(commandArguments(HEXPIRE).key(key).add(seconds).add(condition)
1206+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1207+
}
1208+
1209+
public final CommandObject<List<Long>> hpexpire(byte[] key, long milliseconds, byte[]... fields) {
1210+
return new CommandObject<>(commandArguments(HPEXPIRE).key(key).add(milliseconds)
1211+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1212+
}
1213+
1214+
public final CommandObject<List<Long>> hpexpire(byte[] key, long milliseconds, ExpiryOption condition, byte[]... fields) {
1215+
return new CommandObject<>(commandArguments(HPEXPIRE).key(key).add(milliseconds).add(condition)
1216+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1217+
}
1218+
1219+
public final CommandObject<List<Long>> hexpireAt(byte[] key, long unixTimeSeconds, byte[]... fields) {
1220+
return new CommandObject<>(commandArguments(HEXPIREAT).key(key).add(unixTimeSeconds)
1221+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1222+
}
1223+
1224+
public final CommandObject<List<Long>> hexpireAt(byte[] key, long unixTimeSeconds, ExpiryOption condition, byte[]... fields) {
1225+
return new CommandObject<>(commandArguments(HEXPIREAT).key(key).add(unixTimeSeconds).add(condition)
1226+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1227+
}
1228+
1229+
public final CommandObject<List<Long>> hpexpireAt(byte[] key, long unixTimeMillis, byte[]... fields) {
1230+
return new CommandObject<>(commandArguments(HPEXPIREAT).key(key).add(unixTimeMillis)
1231+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1232+
}
1233+
1234+
public final CommandObject<List<Long>> hpexpireAt(byte[] key, long unixTimeMillis, ExpiryOption condition, byte[]... fields) {
1235+
return new CommandObject<>(commandArguments(HPEXPIREAT).key(key).add(unixTimeMillis).add(condition)
1236+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1237+
}
1238+
1239+
public final CommandObject<List<Long>> hexpireTime(String key, String... fields) {
1240+
return new CommandObject<>(commandArguments(HEXPIRETIME).key(key)
1241+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1242+
}
1243+
1244+
public final CommandObject<List<Long>> hpexpireTime(String key, String... fields) {
1245+
return new CommandObject<>(commandArguments(HPEXPIRETIME).key(key)
1246+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1247+
}
1248+
1249+
public final CommandObject<List<Long>> httl(String key, String... fields) {
1250+
return new CommandObject<>(commandArguments(HTTL).key(key)
1251+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1252+
}
1253+
1254+
public final CommandObject<List<Long>> hpttl(String key, String... fields) {
1255+
return new CommandObject<>(commandArguments(HPTTL).key(key)
1256+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1257+
}
1258+
1259+
public final CommandObject<List<Long>> hexpireTime(byte[] key, byte[]... fields) {
1260+
return new CommandObject<>(commandArguments(HEXPIRETIME).key(key)
1261+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1262+
}
1263+
1264+
public final CommandObject<List<Long>> hpexpireTime(byte[] key, byte[]... fields) {
1265+
return new CommandObject<>(commandArguments(HPEXPIRETIME).key(key)
1266+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1267+
}
1268+
1269+
public final CommandObject<List<Long>> httl(byte[] key, byte[]... fields) {
1270+
return new CommandObject<>(commandArguments(HTTL).key(key)
1271+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1272+
}
1273+
1274+
public final CommandObject<List<Long>> hpttl(byte[] key, byte[]... fields) {
1275+
return new CommandObject<>(commandArguments(HPTTL).key(key)
1276+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1277+
}
1278+
1279+
public final CommandObject<List<Long>> hpersist(String key, String... fields) {
1280+
return new CommandObject<>(commandArguments(HPERSIST).key(key)
1281+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1282+
}
1283+
1284+
public final CommandObject<List<Long>> hpersist(byte[] key, byte[]... fields) {
1285+
return new CommandObject<>(commandArguments(HPERSIST).key(key)
1286+
.add(FIELDS).add(fields.length).addObjects((Object[]) fields), BuilderFactory.LONG_LIST);
1287+
}
11581288
// Hash commands
11591289

11601290
// Set commands
@@ -2020,10 +2150,6 @@ public final CommandObject<KeyValue<byte[], List<Tuple>>> bzmpop(double timeout,
20202150
private Builder<List<Tuple>> getTupleListBuilder() {
20212151
return protocol == RedisProtocol.RESP3 ? BuilderFactory.TUPLE_LIST_RESP3 : BuilderFactory.TUPLE_LIST;
20222152
}
2023-
2024-
private Builder<Set<Tuple>> getTupleSetBuilder() {
2025-
return protocol == RedisProtocol.RESP3 ? BuilderFactory.TUPLE_ZSET_RESP3 : BuilderFactory.TUPLE_ZSET;
2026-
}
20272153
// Sorted Set commands
20282154

20292155
// Geo commands
@@ -3495,8 +3621,7 @@ public final CommandObject<String> jsonMerge(String key, Path path, Object pojo)
34953621
}
34963622

34973623
public final CommandObject<Object> jsonGet(String key) {
3498-
return new CommandObject<>(commandArguments(JsonCommand.GET).key(key),
3499-
protocol != RedisProtocol.RESP3 ? JSON_GENERIC_OBJECT : JsonBuilderFactory.JSON_OBJECT);
3624+
return new CommandObject<>(commandArguments(JsonCommand.GET).key(key), JSON_GENERIC_OBJECT);
35003625
}
35013626

35023627
@Deprecated

src/main/java/redis/clients/jedis/Jedis.java

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,6 +4656,84 @@ public long hstrlen(final byte[] key, final byte[] field) {
46564656
return connection.executeCommand(commandObjects.hstrlen(key, field));
46574657
}
46584658

4659+
@Override
4660+
public List<Long> hexpire(byte[] key, long seconds, byte[]... fields) {
4661+
checkIsInMultiOrPipeline();
4662+
return connection.executeCommand(commandObjects.hexpire(key, seconds, fields));
4663+
}
4664+
4665+
@Override
4666+
public List<Long> hexpire(byte[] key, long seconds, ExpiryOption condition, byte[]... fields) {
4667+
checkIsInMultiOrPipeline();
4668+
return connection.executeCommand(commandObjects.hexpire(key, seconds, condition, fields));
4669+
}
4670+
4671+
@Override
4672+
public List<Long> hpexpire(byte[] key, long milliseconds, byte[]... fields) {
4673+
checkIsInMultiOrPipeline();
4674+
return connection.executeCommand(commandObjects.hpexpire(key, milliseconds, fields));
4675+
}
4676+
4677+
@Override
4678+
public List<Long> hpexpire(byte[] key, long milliseconds, ExpiryOption condition, byte[]... fields) {
4679+
checkIsInMultiOrPipeline();
4680+
return connection.executeCommand(commandObjects.hpexpire(key, milliseconds, condition, fields));
4681+
}
4682+
4683+
@Override
4684+
public List<Long> hexpireAt(byte[] key, long unixTimeSeconds, byte[]... fields) {
4685+
checkIsInMultiOrPipeline();
4686+
return connection.executeCommand(commandObjects.hexpireAt(key, unixTimeSeconds, fields));
4687+
}
4688+
4689+
@Override
4690+
public List<Long> hexpireAt(byte[] key, long unixTimeSeconds, ExpiryOption condition, byte[]... fields) {
4691+
checkIsInMultiOrPipeline();
4692+
return connection.executeCommand(commandObjects.hexpireAt(key, unixTimeSeconds, condition, fields));
4693+
}
4694+
4695+
@Override
4696+
public List<Long> hpexpireAt(byte[] key, long unixTimeMillis, byte[]... fields) {
4697+
checkIsInMultiOrPipeline();
4698+
return connection.executeCommand(commandObjects.hpexpireAt(key, unixTimeMillis, fields));
4699+
}
4700+
4701+
@Override
4702+
public List<Long> hpexpireAt(byte[] key, long unixTimeMillis, ExpiryOption condition, byte[]... fields) {
4703+
checkIsInMultiOrPipeline();
4704+
return connection.executeCommand(commandObjects.hpexpireAt(key, unixTimeMillis, condition, fields));
4705+
}
4706+
4707+
@Override
4708+
public List<Long> hexpireTime(byte[] key, byte[]... fields) {
4709+
checkIsInMultiOrPipeline();
4710+
return connection.executeCommand(commandObjects.hexpireTime(key, fields));
4711+
}
4712+
4713+
@Override
4714+
public List<Long> hpexpireTime(byte[] key, byte[]... fields) {
4715+
checkIsInMultiOrPipeline();
4716+
return connection.executeCommand(commandObjects.hpexpireTime(key, fields));
4717+
}
4718+
4719+
@Override
4720+
public List<Long> httl(byte[] key, byte[]... fields) {
4721+
checkIsInMultiOrPipeline();
4722+
return connection.executeCommand(commandObjects.httl(key, fields));
4723+
}
4724+
4725+
@Override
4726+
public List<Long> hpttl(byte[] key, byte[]... fields) {
4727+
checkIsInMultiOrPipeline();
4728+
return connection.executeCommand(commandObjects.hpttl(key, fields));
4729+
}
4730+
4731+
@Override
4732+
public List<Long> hpersist(byte[] key, byte[]... fields) {
4733+
checkIsInMultiOrPipeline();
4734+
return connection.executeCommand(commandObjects.hpersist(key, fields));
4735+
}
4736+
46594737
@Override
46604738
public List<Object> xread(XReadParams xReadParams, Entry<byte[], byte[]>... streams) {
46614739
checkIsInMultiOrPipeline();
@@ -9237,6 +9315,84 @@ public long hstrlen(final String key, final String field) {
92379315
return connection.executeCommand(commandObjects.hstrlen(key, field));
92389316
}
92399317

9318+
@Override
9319+
public List<Long> hexpire(String key, long seconds, String... fields) {
9320+
checkIsInMultiOrPipeline();
9321+
return connection.executeCommand(commandObjects.hexpire(key, seconds, fields));
9322+
}
9323+
9324+
@Override
9325+
public List<Long> hexpire(String key, long seconds, ExpiryOption condition, String... fields) {
9326+
checkIsInMultiOrPipeline();
9327+
return connection.executeCommand(commandObjects.hexpire(key, seconds, condition, fields));
9328+
}
9329+
9330+
@Override
9331+
public List<Long> hpexpire(String key, long milliseconds, String... fields) {
9332+
checkIsInMultiOrPipeline();
9333+
return connection.executeCommand(commandObjects.hpexpire(key, milliseconds, fields));
9334+
}
9335+
9336+
@Override
9337+
public List<Long> hpexpire(String key, long milliseconds, ExpiryOption condition, String... fields) {
9338+
checkIsInMultiOrPipeline();
9339+
return connection.executeCommand(commandObjects.hpexpire(key, milliseconds, condition, fields));
9340+
}
9341+
9342+
@Override
9343+
public List<Long> hexpireAt(String key, long unixTimeSeconds, String... fields) {
9344+
checkIsInMultiOrPipeline();
9345+
return connection.executeCommand(commandObjects.hexpireAt(key, unixTimeSeconds, fields));
9346+
}
9347+
9348+
@Override
9349+
public List<Long> hexpireAt(String key, long unixTimeSeconds, ExpiryOption condition, String... fields) {
9350+
checkIsInMultiOrPipeline();
9351+
return connection.executeCommand(commandObjects.hexpireAt(key, unixTimeSeconds, condition, fields));
9352+
}
9353+
9354+
@Override
9355+
public List<Long> hpexpireAt(String key, long unixTimeMillis, String... fields) {
9356+
checkIsInMultiOrPipeline();
9357+
return connection.executeCommand(commandObjects.hpexpireAt(key, unixTimeMillis, fields));
9358+
}
9359+
9360+
@Override
9361+
public List<Long> hpexpireAt(String key, long unixTimeMillis, ExpiryOption condition, String... fields) {
9362+
checkIsInMultiOrPipeline();
9363+
return connection.executeCommand(commandObjects.hpexpireAt(key, unixTimeMillis, condition, fields));
9364+
}
9365+
9366+
@Override
9367+
public List<Long> hexpireTime(String key, String... fields) {
9368+
checkIsInMultiOrPipeline();
9369+
return connection.executeCommand(commandObjects.hexpireTime(key, fields));
9370+
}
9371+
9372+
@Override
9373+
public List<Long> hpexpireTime(String key, String... fields) {
9374+
checkIsInMultiOrPipeline();
9375+
return connection.executeCommand(commandObjects.hpexpireTime(key, fields));
9376+
}
9377+
9378+
@Override
9379+
public List<Long> httl(String key, String... fields) {
9380+
checkIsInMultiOrPipeline();
9381+
return connection.executeCommand(commandObjects.httl(key, fields));
9382+
}
9383+
9384+
@Override
9385+
public List<Long> hpttl(String key, String... fields) {
9386+
checkIsInMultiOrPipeline();
9387+
return connection.executeCommand(commandObjects.hpttl(key, fields));
9388+
}
9389+
9390+
@Override
9391+
public List<Long> hpersist(String key, String... fields) {
9392+
checkIsInMultiOrPipeline();
9393+
return connection.executeCommand(commandObjects.hpersist(key, fields));
9394+
}
9395+
92409396
@Override
92419397
public String memoryDoctor() {
92429398
checkIsInMultiOrPipeline();

0 commit comments

Comments
 (0)