Skip to content

Commit 5b987c3

Browse files
committed
Introduce Hash Field Expiration to the Spring Data Redis framework
Signed-off-by: Tihomir Mateev <[email protected]>
1 parent 1e40558 commit 5b987c3

22 files changed

+2052
-40
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION?=7.2.5
15+
VERSION?=7.4.0
1616
PROJECT?=redis
1717
GH_ORG?=redis
1818
SPRING_PROFILE?=ci

src/main/java/org/springframework/data/redis/connection/DefaultStringRedisConnection.java

+70
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,76 @@ public Long hStrLen(byte[] key, byte[] field) {
25662566
return convertAndReturn(delegate.hStrLen(key, field), Converters.identityConverter());
25672567
}
25682568

2569+
@Override
2570+
public List<Long> hExpire(byte[] key, long seconds, byte[]... fields) {
2571+
return this.delegate.hExpire(key, seconds, fields);
2572+
}
2573+
2574+
@Override
2575+
public List<Long> hpExpire(byte[] key, long millis, byte[]... fields) {
2576+
return this.delegate.hpExpire(key, millis, fields);
2577+
}
2578+
2579+
@Override
2580+
public List<Long> hExpireAt(byte[] key, long unixTime, byte[]... fields) {
2581+
return this.delegate.hExpireAt(key, unixTime, fields);
2582+
}
2583+
2584+
@Override
2585+
public List<Long> hpExpireAt(byte[] key, long unixTimeInMillis, byte[]... fields) {
2586+
return this.delegate.hpExpireAt(key, unixTimeInMillis, fields);
2587+
}
2588+
2589+
@Override
2590+
public List<Long> hPersist(byte[] key, byte[]... fields) {
2591+
return this.delegate.hPersist(key, fields);
2592+
}
2593+
2594+
@Override
2595+
public List<Long> hTtl(byte[] key, byte[]... fields) {
2596+
return this.delegate.hTtl(key, fields);
2597+
}
2598+
2599+
@Override
2600+
public List<Long> hTtl(byte[] key, TimeUnit timeUnit, byte[]... fields) {
2601+
return this.delegate.hTtl(key, timeUnit, fields);
2602+
}
2603+
2604+
@Override
2605+
public List<Long> hExpire(String key, long seconds, String... fields) {
2606+
return hExpire(serialize(key), seconds, serializeMulti(fields));
2607+
}
2608+
2609+
@Override
2610+
public List<Long> hpExpire(String key, long millis, String... fields) {
2611+
return hpExpire(serialize(key), millis, serializeMulti(fields));
2612+
}
2613+
2614+
@Override
2615+
public List<Long> hExpireAt(String key, long unixTime, String... fields) {
2616+
return hExpireAt(serialize(key), unixTime, serializeMulti(fields));
2617+
}
2618+
2619+
@Override
2620+
public List<Long> hpExpireAt(String key, long unixTimeInMillis, String... fields) {
2621+
return hpExpireAt(serialize(key), unixTimeInMillis, serializeMulti(fields));
2622+
}
2623+
2624+
@Override
2625+
public List<Long> hPersist(String key, String... fields) {
2626+
return hPersist(serialize(key), serializeMulti(fields));
2627+
}
2628+
2629+
@Override
2630+
public List<Long> hTtl(String key, String... fields) {
2631+
return hTtl(serialize(key), serializeMulti(fields));
2632+
}
2633+
2634+
@Override
2635+
public List<Long> hTtl(String key, TimeUnit timeUnit, String... fields) {
2636+
return hTtl(serialize(key), timeUnit, serializeMulti(fields));
2637+
}
2638+
25692639
@Override
25702640
public void setClientName(byte[] name) {
25712641
this.delegate.setClientName(name);

src/main/java/org/springframework/data/redis/connection/DefaultedRedisConnection.java

+50
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
* @author ihaohong
6666
* @author Dennis Neufeld
6767
* @author Shyngys Sapraliyev
68+
* @author Tihomir Mateev
6869
* @since 2.0
6970
*/
7071
@Deprecated
@@ -1470,6 +1471,55 @@ default Long hStrLen(byte[] key, byte[] field) {
14701471
return hashCommands().hStrLen(key, field);
14711472
}
14721473

1474+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1475+
@Override
1476+
@Deprecated
1477+
default List<Long> hExpire(byte[] key, long seconds, byte[]... fields) {
1478+
return hashCommands().hExpire(key, seconds, fields);
1479+
}
1480+
1481+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1482+
@Override
1483+
@Deprecated
1484+
default List<Long> hpExpire(byte[] key, long millis, byte[]... fields) {
1485+
return hashCommands().hpExpire(key, millis, fields);
1486+
}
1487+
1488+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1489+
@Override
1490+
@Deprecated
1491+
default List<Long> hExpireAt(byte[] key, long unixTime, byte[]... fields) {
1492+
return hashCommands().hExpireAt(key, unixTime, fields);
1493+
}
1494+
1495+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1496+
@Override
1497+
@Deprecated
1498+
default List<Long> hpExpireAt(byte[] key, long unixTimeInMillis, byte[]... fields) {
1499+
return hashCommands().hpExpireAt(key, unixTimeInMillis, fields);
1500+
}
1501+
1502+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1503+
@Override
1504+
@Deprecated
1505+
default List<Long> hPersist(byte[] key, byte[]... fields) {
1506+
return hashCommands().hPersist(key, fields);
1507+
}
1508+
1509+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1510+
@Override
1511+
@Deprecated
1512+
default List<Long> hTtl(byte[] key, byte[]... fields) {
1513+
return hashCommands().hTtl(key, fields);
1514+
}
1515+
1516+
/** @deprecated in favor of {@link RedisConnection#hashCommands()}}. */
1517+
@Override
1518+
@Deprecated
1519+
default List<Long> hTtl(byte[] key, TimeUnit timeUnit, byte[]... fields) {
1520+
return hashCommands().hTtl(key, timeUnit, fields);
1521+
}
1522+
14731523
// GEO COMMANDS
14741524

14751525
/** @deprecated in favor of {@link RedisConnection#geoCommands()}}. */

0 commit comments

Comments
 (0)