Package org.jmxtrans.agent
Class RollingFileOutputWriter
java.lang.Object
org.jmxtrans.agent.AbstractOutputWriter
org.jmxtrans.agent.RollingFileOutputWriter
- All Implemented Interfaces:
OutputWriter
public class RollingFileOutputWriter extends AbstractOutputWriter
-
Field Summary
Fields Modifier and Type Field Description protected Filefileprotected booleanfirstResultprotected intmaxBackupIndexprotected longmaxFileSizestatic StringSETTING_FILE_NAMEstatic StringSETTING_FILE_NAME_DEFAULT_VALUEstatic StringSETTING_MAX_BACKUP_INDEXstatic intSETTING_MAX_BACKUP_INDEX_DEFAULT_VALUEstatic StringSETTING_MAX_FILE_SIZEstatic longSETTING_MAX_FILE_SIZE_DEFAULT_VALUEstatic StringSETTING_SINGLE_LINEstatic booleanSETTING_SINGLE_LINE_DEFAULT_VALUEprotected booleansingleLineprotected FiletemporaryFileprotected WritertemporaryFileWriterFields inherited from class org.jmxtrans.agent.AbstractOutputWriter
logger, SETTING_LOG_LEVEL, SETTING_LOG_LEVEL_DEFAULT_VALUE -
Constructor Summary
Constructors Constructor Description RollingFileOutputWriter() -
Method Summary
Modifier and Type Method Description protected WritergetTemporaryFileWriter()voidpostCollect()called after a serie of writes, typically at the end of a collection.voidpostConstruct(Map<String,String> settings)voidpreCollect()Called before metrics collection startsprotected voidreleaseTemporaryWriter()voidwriteInvocationResult(String invocationName, Object value)voidwriteQueryResult(String name, String type, Object value)Methods inherited from class org.jmxtrans.agent.AbstractOutputWriter
getDebugLevel, getInfoLevel, getTraceLevel, preDestroy
-
Field Details
-
SETTING_FILE_NAME
- See Also:
- Constant Field Values
-
SETTING_FILE_NAME_DEFAULT_VALUE
- See Also:
- Constant Field Values
-
SETTING_MAX_FILE_SIZE
- See Also:
- Constant Field Values
-
SETTING_MAX_FILE_SIZE_DEFAULT_VALUE
public static final long SETTING_MAX_FILE_SIZE_DEFAULT_VALUE- See Also:
- Constant Field Values
-
SETTING_MAX_BACKUP_INDEX
- See Also:
- Constant Field Values
-
SETTING_MAX_BACKUP_INDEX_DEFAULT_VALUE
public static final int SETTING_MAX_BACKUP_INDEX_DEFAULT_VALUE- See Also:
- Constant Field Values
-
SETTING_SINGLE_LINE
- See Also:
- Constant Field Values
-
SETTING_SINGLE_LINE_DEFAULT_VALUE
public static final boolean SETTING_SINGLE_LINE_DEFAULT_VALUE- See Also:
- Constant Field Values
-
temporaryFileWriter
-
temporaryFile
-
file
-
maxFileSize
protected long maxFileSize -
maxBackupIndex
protected int maxBackupIndex -
singleLine
protected boolean singleLine -
firstResult
protected boolean firstResult
-
-
Constructor Details
-
RollingFileOutputWriter
public RollingFileOutputWriter()
-
-
Method Details
-
postConstruct
- Specified by:
postConstructin interfaceOutputWriter- Overrides:
postConstructin classAbstractOutputWriter
-
getTemporaryFileWriter
- Throws:
IOException
-
writeInvocationResult
- Specified by:
writeInvocationResultin interfaceOutputWriter- Specified by:
writeInvocationResultin classAbstractOutputWriter- Throws:
IOException
-
writeQueryResult
public void writeQueryResult(@Nonnull String name, @Nullable String type, @Nullable Object value) throws IOException- Specified by:
writeQueryResultin interfaceOutputWriter- Specified by:
writeQueryResultin classAbstractOutputWritertype- seeQuery.type- Throws:
IOException
-
releaseTemporaryWriter
protected void releaseTemporaryWriter() -
preCollect
Description copied from interface:OutputWriterCalled before metrics collection starts- Specified by:
preCollectin interfaceOutputWriter- Overrides:
preCollectin classAbstractOutputWriter- Throws:
IOException
-
postCollect
Description copied from interface:OutputWritercalled after a serie of writes, typically at the end of a collection.
Useful with batch writers.
- Specified by:
postCollectin interfaceOutputWriter- Overrides:
postCollectin classAbstractOutputWriter- Throws:
IOException
-