Package io.lettuce.core
Class XTrimArgs
- java.lang.Object
-
- io.lettuce.core.XTrimArgs
-
- All Implemented Interfaces:
CompositeArgument
public class XTrimArgs extends Object implements CompositeArgument
Argument list builder for the Redis XTRIM command. Static import the methods fromXTrimArgs.Builder
and call the methods:maxlen(…)
.XTrimArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 6.1
- Author:
- dengliming
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XTrimArgs.Builder
Builder entry points forXTrimArgs
.
-
Constructor Summary
Constructors Constructor Description XTrimArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XTrimArgs
approximateTrimming()
Apply efficient trimming for capped streams using the~
flag.XTrimArgs
approximateTrimming(boolean approximateTrimming)
Apply efficient trimming for capped streams using the~
flag.<K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.XTrimArgs
exactTrimming()
Apply exact trimming for capped streams using the=
flag.XTrimArgs
exactTrimming(boolean exactTrimming)
Apply exact trimming for capped streams using the=
flag.XTrimArgs
limit(long limit)
The maximum number of entries to trim.XTrimArgs
maxlen(long maxlen)
Limit stream tomaxlen
entries.XTrimArgs
minId(String minid)
Limit stream entries by message Id.
-
-
-
Method Detail
-
maxlen
public XTrimArgs maxlen(long maxlen)
Limit stream tomaxlen
entries.- Parameters:
maxlen
- number greater 0.- Returns:
this
-
minId
public XTrimArgs minId(String minid)
Limit stream entries by message Id.- Parameters:
minid
- the oldest ID in the stream will be exactly the minimum between its original oldest ID and the specified threshold.- Returns:
this
-
limit
public XTrimArgs limit(long limit)
The maximum number of entries to trim.- Parameters:
limit
- has meaning only if`~`
was set.- Returns:
this
-
approximateTrimming
public XTrimArgs approximateTrimming()
Apply efficient trimming for capped streams using the~
flag.- Returns:
this
-
approximateTrimming
public XTrimArgs approximateTrimming(boolean approximateTrimming)
Apply efficient trimming for capped streams using the~
flag.- Parameters:
approximateTrimming
-true
to apply efficient radix node trimming.- Returns:
this
-
exactTrimming
public XTrimArgs exactTrimming()
Apply exact trimming for capped streams using the=
flag.- Returns:
this
-
exactTrimming
public XTrimArgs exactTrimming(boolean exactTrimming)
Apply exact trimming for capped streams using the=
flag.- Parameters:
exactTrimming
-true
to apply exact radix node trimming.- Returns:
this
-
build
public <K,V> void build(CommandArgs<K,V> args)
Description copied from interface:CompositeArgument
Build command arguments and contribute arguments toCommandArgs
.Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
- Specified by:
build
in interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-