@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 |
create()
Initiates the instantiation of a
DefaultRollingPolicy . |
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 static DefaultRollingPolicy.PolicyBuilder create()
DefaultRollingPolicy
.
To finalize it and have the actual policy, call .create()
.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.