io.quarkus.redis.datasource.stream.XTrimArgs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-redis-client Show documentation
Show all versions of quarkus-redis-client Show documentation
Connect to Redis in either imperative or reactive style
package io.quarkus.redis.datasource.stream;
import java.util.ArrayList;
import java.util.List;
import io.quarkus.redis.datasource.RedisCommandExtraArguments;
/**
* The argument of the XTRIM command.
*/
public class XTrimArgs implements RedisCommandExtraArguments {
private long maxlen = -1;
private boolean approximateTrimming;
private String minid;
private long limit = -1;
/**
* Sets the max length of the stream.
*
* @param maxlen the max length of the stream, must be positive
* @return the current {@code XAddArgs}
*/
public XTrimArgs maxlen(long maxlen) {
this.maxlen = maxlen;
return this;
}
/**
* When set, prefix the {@link #maxlen} with {@code ~} to enable the almost exact trimming.
* This is recommended when using {@link #maxlen(long)}.
*
* @return the current {@code XAddArgs}
*/
public XTrimArgs nearlyExactTrimming() {
this.approximateTrimming = true;
return this;
}
/**
* Evicts entries from the stream having IDs lower to the specified one.
*
* @param minid the min id, must not be {@code null}, must be a valid stream id
* @return the current {@code XAddArgs}
*/
public XTrimArgs minid(String minid) {
this.minid = minid;
return this;
}
/**
* Sets the maximum entries that can get evicted.
*
* @param limit the limit, must be positive
* @return the current {@code XAddArgs}
*/
public XTrimArgs limit(long limit) {
this.limit = limit;
return this;
}
@Override
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy