@PublicEvolving public final class DefaultRollingPolicy<IN,BucketID> extends Object implements RollingPolicy<IN,BucketID>
RollingPolicy.
This policy rolls a part file if:
| 限定符和类型 | 类和说明 |
|---|---|
static class |
DefaultRollingPolicy.PolicyBuilder
A helper class that holds the configuration properties for the
DefaultRollingPolicy. |
| 限定符和类型 | 方法和说明 |
|---|---|
static DefaultRollingPolicy.PolicyBuilder |
builder()
Creates a new
DefaultRollingPolicy.PolicyBuilder that is used to configure and build
an instance of DefaultRollingPolicy. |
static DefaultRollingPolicy.PolicyBuilder |
create()
已过时。
|
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. its size.
|
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 在接口中 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 在接口中 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 在接口中 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–2021 The Apache Software Foundation. All rights reserved.