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 classRetentionPolicy.RetentionPolicyBuilderstatic classRetentionPolicy.RetentionType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RetentionPolicy.RetentionPolicyBuilderbuilder()static RetentionPolicybySizeBytes(long size)Create a retention policy to configure a stream to truncate a stream according to the amount of data currently stored.static RetentionPolicybySizeBytes(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 RetentionPolicybyTime(java.time.Duration duration)Create a retention policy to configure a stream to be periodically truncated according to the specified duration.static RetentionPolicybyTime(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 booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)longgetRetentionMax()longgetRetentionParam()RetentionPolicy.RetentionTypegetRetentionType()inthashCode()java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-