public class FileWriterRetentionConfig
extends java.lang.Object
File removal can be any combination of:
fileCount
would be exceededaggregateFileSize
would be exceededageSec
secondsModifier and Type | Method and Description |
---|---|
boolean |
evaluate(int fileCount,
long aggregateFileSize)
Evaluate if the specified values indicate that a final file should
be removed.
|
long |
getAgeSec()
Get the file age configuration value.
|
long |
getAggregateFileSize()
Get the aggregate file size configuration value.
|
int |
getFileCount()
Get the file count configuration value.
|
long |
getPeriodMsec()
Get the time period configuration value.
|
static FileWriterRetentionConfig |
newAgeBasedConfig(long ageSec,
long periodMsec)
same as
newConfig(0, 0, ageSe, periodMsecc) |
static FileWriterRetentionConfig |
newAggregateFileSizeBasedConfig(long aggregateFileSize)
same as
newConfig(0, aggregateFileSize, 0, 0) |
static FileWriterRetentionConfig |
newConfig(int fileCount,
long aggregateFileSize,
long ageSec,
long periodMsec)
Create a new configuration.
|
static FileWriterRetentionConfig |
newFileCountBasedConfig(int fileCount)
same as
newConfig(fileCount, 0, 0, 0) |
java.lang.String |
toString() |
public static FileWriterRetentionConfig newFileCountBasedConfig(int fileCount)
newConfig(fileCount, 0, 0, 0)
fileCount
- remove a file when fileCount
would be exceeded. 0 to disable.public static FileWriterRetentionConfig newAggregateFileSizeBasedConfig(long aggregateFileSize)
newConfig(0, aggregateFileSize, 0, 0)
aggregateFileSize
- remove a file when aggregateFileSize
would be exceeded. 0 to disable.public static FileWriterRetentionConfig newAgeBasedConfig(long ageSec, long periodMsec)
newConfig(0, 0, ageSe, periodMsecc)
ageSec
- remove a file that's older than ageSec
seconds. 0 to disable.periodMsec
- frequency for checking for ageSec based removal. 0 to disable.]public static FileWriterRetentionConfig newConfig(int fileCount, long aggregateFileSize, long ageSec, long periodMsec)
fileCount
- remove a file when fileCount
would be exceeded. 0 to disable.aggregateFileSize
- remove a file when aggregateFileSize
would be exceeded. 0 to disable.ageSec
- remove a file that's older than ageSec
seconds. 0 to disable.periodMsec
- frequency for checking for ageSec based removal. 0 to disable.]public int getFileCount()
public long getAggregateFileSize()
public long getAgeSec()
public long getPeriodMsec()
public boolean evaluate(int fileCount, long aggregateFileSize)
fileCount
- the current number of retained filesaggregateFileSize
- the aggregate size of all of the retained filespublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641