Kieker 1.12

kieker.monitoring.writer.filesystem.async
Class FsWriterThread

java.lang.Object
  extended by java.lang.Thread
      extended by kieker.monitoring.writer.AbstractAsyncThread
          extended by kieker.monitoring.writer.filesystem.async.AbstractFsWriterThread
              extended by kieker.monitoring.writer.filesystem.async.FsWriterThread
All Implemented Interfaces:
java.lang.Runnable

public final class FsWriterThread
extends AbstractFsWriterThread

Since:
1.5
Author:
Matthias Rohr, Andre van Hoorn, Jan Waller

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class kieker.monitoring.writer.filesystem.async.AbstractFsWriterThread
fileExtension
 
Fields inherited from class kieker.monitoring.writer.AbstractAsyncThread
monitoringController
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FsWriterThread(IMonitoringController monitoringController, java.util.concurrent.BlockingQueue<IMonitoringRecord> writeQueue, MappingFileWriter mappingFileWriter, java.lang.String path, int maxEntriesInFile, int maxLogSize, int maxLogFiles, boolean autoflush, int bufferSize)
          Create a new FsWriterThread.
 
Method Summary
protected  void cleanup()
          Inheriting classes should implement this method to do some cleanup work like, for example, closing open connections.
protected  void prepareFile(java.lang.String filename)
          Prepares a new file if needed.
protected  void write(IMonitoringRecord monitoringRecord)
          Inheriting classes should implement this method to actually write the monitoring record.
 
Methods inherited from class kieker.monitoring.writer.filesystem.async.AbstractFsWriterThread
consume, getFilename, toString
 
Methods inherited from class kieker.monitoring.writer.AbstractAsyncThread
initShutdown, isFinished, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FsWriterThread

public FsWriterThread(IMonitoringController monitoringController,
                      java.util.concurrent.BlockingQueue<IMonitoringRecord> writeQueue,
                      MappingFileWriter mappingFileWriter,
                      java.lang.String path,
                      int maxEntriesInFile,
                      int maxLogSize,
                      int maxLogFiles,
                      boolean autoflush,
                      int bufferSize)
Create a new FsWriterThread.

Parameters:
monitoringController - the monitoring controller accessed by this thread
writeQueue - the queue where the writer fetches its records from
mappingFileWriter - writer for the mapping file (the file where class names are mapped to record ids)
path - location where to files should go to (the path must point to a directory)
maxEntriesInFile - limit for the number of records per log file
maxLogSize - limit of the log file size
maxLogFiles - limit of the number of log files
autoflush - if true do not use an output buffer while writing
bufferSize - size of the output buffer
Method Detail

write

protected final void write(IMonitoringRecord monitoringRecord)
                    throws java.io.IOException
Description copied from class: AbstractFsWriterThread
Inheriting classes should implement this method to actually write the monitoring record.

Specified by:
write in class AbstractFsWriterThread
Parameters:
monitoringRecord - The record to be written.
Throws:
java.io.IOException - If something went wrong during the writing.

prepareFile

protected final void prepareFile(java.lang.String filename)
                          throws java.io.FileNotFoundException,
                                 java.io.UnsupportedEncodingException
Prepares a new file if needed.

Specified by:
prepareFile in class AbstractFsWriterThread
Parameters:
filename - The name of the file to be prepared.
Throws:
java.io.FileNotFoundException - If the given file is somehow invalid.
java.io.UnsupportedEncodingException - If the used default encoding is not supported.

cleanup

protected final void cleanup()
Description copied from class: AbstractAsyncThread
Inheriting classes should implement this method to do some cleanup work like, for example, closing open connections.

Specified by:
cleanup in class AbstractAsyncThread

Kieker 1.12

Copyright 2015 Kieker Project, http://kieker-monitoring.net