@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
RollingPolicy
shouldRollOnCheckpoint
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.IOException
public boolean shouldRollOnEvent(PartFileInfo<BucketID> partFileState, IN element) throws IOException
RollingPolicy
shouldRollOnEvent
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.IOException
public boolean shouldRollOnProcessingTime(PartFileInfo<BucketID> partFileState, long currentTime)
RollingPolicy
shouldRollOnProcessingTime
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–2024 The Apache Software Foundation. All rights reserved.