@PublicEvolving public final class DefaultRollingPolicy<IN,BucketID> extends Object implements RollingPolicy<IN,BucketID>
RollingPolicy.
This policy rolls a part file if:
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultRollingPolicy.PolicyBuilder
A helper class that holds the configuration properties for the
DefaultRollingPolicy. |
| Modifier and Type | Method and Description |
|---|---|
static DefaultRollingPolicy.PolicyBuilder |
builder()
Creates a new
DefaultRollingPolicy.PolicyBuilder that is used to configure and build
an instance of DefaultRollingPolicy. |
static DefaultRollingPolicy.PolicyBuilder |
create()
Deprecated.
|
long |
getInactivityInterval()
Returns time duration of allowed inactivity after which a part file will have to roll.
|
long |
getMaxPartSize()
Returns the maximum part file size before rolling.
|
long |
getRolloverInterval()
Returns the maximum time duration a part file can stay open before rolling.
|
boolean |
shouldRollOnCheckpoint(PartFileInfo<BucketID> partFileState)
Determines if the in-progress part file for a bucket should roll on every checkpoint.
|
boolean |
shouldRollOnEvent(PartFileInfo<BucketID> partFileState,
IN element)
Determines if the in-progress part file for a bucket should roll based on its current state, e.g.
|
boolean |
shouldRollOnProcessingTime(PartFileInfo<BucketID> partFileState,
long currentTime)
Determines if the in-progress part file for a bucket should roll based on a time condition.
|
public boolean shouldRollOnCheckpoint(PartFileInfo<BucketID> partFileState) throws IOException
RollingPolicyshouldRollOnCheckpoint in interface RollingPolicy<IN,BucketID>partFileState - the state of the currently open part file of the bucket.True if the part file should roll, false otherwise.IOExceptionpublic boolean shouldRollOnEvent(PartFileInfo<BucketID> partFileState, IN element) throws IOException
RollingPolicyshouldRollOnEvent in interface RollingPolicy<IN,BucketID>partFileState - the state of the currently open part file of the bucket.element - the element being processed.True if the part file should roll, false otherwise.IOExceptionpublic boolean shouldRollOnProcessingTime(PartFileInfo<BucketID> partFileState, long currentTime)
RollingPolicyshouldRollOnProcessingTime in interface RollingPolicy<IN,BucketID>partFileState - the state of the currently open part file of the bucket.currentTime - the current processing time.True if the part file should roll, false otherwise.public long getMaxPartSize()
public long getRolloverInterval()
public long getInactivityInterval()
public static DefaultRollingPolicy.PolicyBuilder builder()
DefaultRollingPolicy.PolicyBuilder that is used to configure and build
an instance of DefaultRollingPolicy.@Deprecated public static DefaultRollingPolicy.PolicyBuilder create()
Deprecated, use builder() instead.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.