Package io.pravega.client.stream
Class RetentionPolicy
- java.lang.Object
-
- io.pravega.client.stream.RetentionPolicy
-
- All Implemented Interfaces:
java.io.Serializable
public class RetentionPolicy extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RetentionPolicy.RetentionPolicyBuilder
static class
RetentionPolicy.RetentionType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RetentionPolicy.RetentionPolicyBuilder
builder()
static RetentionPolicy
bySizeBytes(long size)
Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.static RetentionPolicy
bySizeBytes(long sizeMin, long sizeMax)
Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.static RetentionPolicy
byTime(java.time.Duration duration)
Create a retention policy to configure a stream to be periodically truncated according to the specified duration.static RetentionPolicy
byTime(java.time.Duration durationMin, java.time.Duration durationMax)
Create a retention policy to configure a stream to periodically truncated according to the specified duration.protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
long
getRetentionMax()
long
getRetentionParam()
RetentionPolicy.RetentionType
getRetentionType()
int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
byTime
public static RetentionPolicy byTime(java.time.Duration duration)
Create a retention policy to configure a stream to be periodically truncated according to the specified duration.- Parameters:
duration
- Period to retain data in a stream.- Returns:
- Retention policy object.
-
byTime
public static RetentionPolicy byTime(java.time.Duration durationMin, java.time.Duration durationMax)
Create a retention policy to configure a stream to periodically truncated according to the specified duration.- Parameters:
durationMin
- Minimum period for which data would be retained in the stream.durationMax
- Maximum period for which data would be retained in the stream.- Returns:
- Retention policy object.
-
bySizeBytes
public static RetentionPolicy bySizeBytes(long size)
Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.- Parameters:
size
- Amount of data to retain in a stream.- Returns:
- Retention policy object.
-
bySizeBytes
public static RetentionPolicy bySizeBytes(long sizeMin, long sizeMax)
Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.- Parameters:
sizeMin
- Minimum amount of data to retain in a Stream.sizeMax
- Maximum amount of data to retain in a Stream.- Returns:
- Retention policy object.
-
builder
public static RetentionPolicy.RetentionPolicyBuilder builder()
-
getRetentionType
public RetentionPolicy.RetentionType getRetentionType()
-
getRetentionParam
public long getRetentionParam()
-
getRetentionMax
public long getRetentionMax()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-