public class PerThreadBinaryFileAggregatedLogger extends Object implements AggregatedFileLogger, ThreadEventCountProvider
While a regular stream like FileOutputStream generates a single file, this stream creates a number of files whose size is limited by the number of events (MAX_EVENTS_PER_FILE field).
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_EVENTS_PER_FILE
The number of events stored in a single file.
|
static int |
WRITE_BYTE_BUFFER_SIZE |
| Constructor and Description |
|---|
PerThreadBinaryFileAggregatedLogger(FileNameGenerator fileNameGenerator,
IErrorLogger logger,
RawFileCollector fileCollector)
Create an instance of stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the stream.
|
long |
getNextEventId() |
AtomicInteger |
getThreadEventCount(int currentThreadId) |
void |
shutdown() |
void |
writeEvent(int probeId,
long valueId) |
void |
writeEvent(int probeId,
long valueId,
byte[] toByteArray)
Block type: 7
Event with object value serialized
|
void |
writeEvent(int probeId,
long valueId,
ByteArrayOutputStream outputStream) |
void |
writeNewException(byte[] exceptionBytes) |
void |
writeNewObjectType(long id,
long typeId) |
void |
writeNewString(long id,
String stringObject) |
void |
writeNewTypeRecord(int typeId,
String typeName,
byte[] toString) |
void |
writeWeaveInfo(byte[] byteArray) |
public static final int MAX_EVENTS_PER_FILE
public static final int WRITE_BYTE_BUFFER_SIZE
public PerThreadBinaryFileAggregatedLogger(FileNameGenerator fileNameGenerator, IErrorLogger logger, RawFileCollector fileCollector)
fileNameGenerator - file generator for output datalogger - is to report errors that occur in this class.fileCollector - collects the dataEvent log files, creates indexes,public void close()
public void writeNewObjectType(long id,
long typeId)
writeNewObjectType in interface AggregatedFileLoggerpublic void writeNewString(long id,
String stringObject)
writeNewString in interface AggregatedFileLoggerpublic void writeNewException(byte[] exceptionBytes)
writeNewException in interface AggregatedFileLoggerpublic void writeEvent(int probeId,
long valueId)
writeEvent in interface AggregatedFileLoggerpublic long getNextEventId()
public void writeNewTypeRecord(int typeId,
String typeName,
byte[] toString)
writeNewTypeRecord in interface AggregatedFileLoggerpublic void writeWeaveInfo(byte[] byteArray)
writeWeaveInfo in interface AggregatedFileLoggerpublic void shutdown()
throws IOException,
InterruptedException
shutdown in interface AggregatedFileLoggerIOExceptionInterruptedExceptionpublic void writeEvent(int probeId,
long valueId,
byte[] toByteArray)
writeEvent in interface AggregatedFileLoggerprobeId - probe idvalueId - valuetoByteArray - serialized object representationpublic void writeEvent(int probeId,
long valueId,
ByteArrayOutputStream outputStream)
writeEvent in interface AggregatedFileLoggerpublic AtomicInteger getThreadEventCount(int currentThreadId)
getThreadEventCount in interface ThreadEventCountProviderCopyright © 2023. All rights reserved.