Class ReactiveStreamCommands.TrimCommand
java.lang.Object
org.springframework.data.redis.connection.ReactiveRedisConnection.KeyCommand
org.springframework.data.redis.connection.ReactiveStreamCommands.TrimCommand
- All Implemented Interfaces:
ReactiveRedisConnection.Command
- Enclosing interface:
- ReactiveStreamCommands
XTRIM command parameters.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.since 4.0: do not toggle the trim operator in isolation.approximate(boolean approximateTrimming) Deprecated.since 4.0: do not toggle the trim operator in isolation.@Nullable LonggetCount()Deprecated.since 4.0: InspectgetOptions()->RedisStreamCommands.XTrimOptions.getTrimOptions()->RedisStreamCommands.TrimOptions.getTrimStrategy()and obtain the threshold from the concrete strategy instead.booleanoptions(RedisStreamCommands.XTrimOptions options) Apply the givenRedisStreamCommands.XTrimOptionsto configure the XTRIM command.stream(ByteBuffer key) Deprecated.since 4.0, preferstream(ByteBuffer, XTrimOptions)instead.stream(ByteBuffer key, RedisStreamCommands.XTrimOptions options) to(long threshold) Deprecated.since 4.0: specify a concrete trim strategy (MAXLEN or MINID) viaRedisStreamCommands.XTrimOptionsandRedisStreamCommands.TrimOptionsinstead of using this method.Methods inherited from class org.springframework.data.redis.connection.ReactiveRedisConnection.KeyCommand
getKeyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.redis.connection.ReactiveRedisConnection.Command
getName
-
Method Details
-
stream
@Deprecated(since="4.0", forRemoval=false) public static ReactiveStreamCommands.TrimCommand stream(ByteBuffer key) Deprecated.since 4.0, preferstream(ByteBuffer, XTrimOptions)instead.Creates a newReactiveStreamCommands.TrimCommandgiven akey.- Parameters:
key- must not be null.- Returns:
- a new
ReactiveStreamCommands.TrimCommandforkey. - Since:
- 4.0
-
stream
public static ReactiveStreamCommands.TrimCommand stream(ByteBuffer key, RedisStreamCommands.XTrimOptions options) - Parameters:
key- must not be null.options- must not be null.- Returns:
- a new
ReactiveStreamCommands.TrimCommandforkey. - Since:
- 4.0
-
to
@Deprecated(since="4.0", forRemoval=false) public ReactiveStreamCommands.TrimCommand to(long threshold) Deprecated.since 4.0: specify a concrete trim strategy (MAXLEN or MINID) viaRedisStreamCommands.XTrimOptionsandRedisStreamCommands.TrimOptionsinstead of using this method. Preferoptions(XTrimOptions.trim(TrimOptions.maxLen(threshold)))or construct withstream(key, XTrimOptions.trim(TrimOptions.maxLen(threshold))).Applies the numeric threshold. Constructs a new command instance with all previously configured properties.- Parameters:
threshold-- Returns:
- a new
ReactiveStreamCommands.TrimCommandwith threshold applied.
-
approximate
Deprecated.since 4.0: do not toggle the trim operator in isolation. Specify a concrete trim strategy (MAXLEN or MINID) and operator viaRedisStreamCommands.XTrimOptionsandRedisStreamCommands.TrimOptions, e.g.options(XTrimOptions.trim(TrimOptions.maxLen(n).approximate())).Applies approximate trimming. Constructs a new command instance with all previously configured properties.- Returns:
- a new
ReactiveStreamCommands.TrimCommandwith approximateTrimming applied. - Since:
- 2.4
-
approximate
@Deprecated(since="4.0", forRemoval=false) public ReactiveStreamCommands.TrimCommand approximate(boolean approximateTrimming) Deprecated.since 4.0: do not toggle the trim operator in isolation. Specify a concrete trim strategy (MAXLEN or MINID) and operator viaRedisStreamCommands.XTrimOptionsandRedisStreamCommands.TrimOptions, e.g.options(XTrimOptions.trim(TrimOptions.maxLen(n).approximate()))oroptions(XTrimOptions.trim(TrimOptions.minId(id).exact())).AppliesapproximateTrimming. Constructs a new command instance with all previously configured properties.- Parameters:
approximateTrimming-- Returns:
- a new
ReactiveStreamCommands.TrimCommandwith approximateTrimming applied. - Since:
- 2.4
-
options
Apply the givenRedisStreamCommands.XTrimOptionsto configure the XTRIM command.This method allows setting all XTRIM options at once, including trimming strategies (MAXLEN, MINID) and other parameters. Constructs a new command instance with all previously configured properties except the options, which are replaced by the provided
RedisStreamCommands.XTrimOptions.- Parameters:
options- theRedisStreamCommands.XTrimOptionsto apply. Must not be null.- Returns:
- a new
ReactiveStreamCommands.TrimCommandwith the specified options applied. - Since:
- 4.1
-
getCount
Deprecated.since 4.0: InspectgetOptions()->RedisStreamCommands.XTrimOptions.getTrimOptions()->RedisStreamCommands.TrimOptions.getTrimStrategy()and obtain the threshold from the concrete strategy instead. For example:if (strategy instanceof MaxLenTrimStrategy m) { m.threshold(); }orif (strategy instanceof MinIdTrimStrategy i) { i.threshold(); }.Returns the MAXLEN threshold if the active trim strategy is MAXLEN; otherwise null.- Returns:
- can be null.
-
isApproximateTrimming
public boolean isApproximateTrimming() -
getOptions
-