public class BinLog
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
static class |
BinLog.ReleaseableWriteMarshallable |
Constructor and Description |
---|
BinLog(java.nio.file.Path path,
net.openhft.chronicle.queue.RollCycle rollCycle,
int maxQueueWeight,
BinLogArchiver archiver) |
Modifier and Type | Method and Description |
---|---|
void |
finalize()
There is a race where we might not release a buffer, going to let finalization
catch it since it shouldn't happen to a lot of buffers.
|
boolean |
offer(BinLog.ReleaseableWriteMarshallable record)
Offer a record to the log.
|
void |
put(BinLog.ReleaseableWriteMarshallable record)
Put a record into the log.
|
void |
run() |
void |
start()
Start the consumer thread that writes log records.
|
void |
stop()
Stop the consumer thread that writes log records.
|
public BinLog(java.nio.file.Path path, net.openhft.chronicle.queue.RollCycle rollCycle, int maxQueueWeight, BinLogArchiver archiver)
path
- Path to store the BinLog. Can't be shared with anything else.rollCycle
- How often to roll the log file so it can potentially be deletedmaxQueueWeight
- Maximum weight of in memory queue for records waiting to be written to the file before blocking or droppingpublic void start()
public void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean offer(BinLog.ReleaseableWriteMarshallable record)
record
- The record to write to the logpublic void put(BinLog.ReleaseableWriteMarshallable record) throws java.lang.InterruptedException
record
- The record to write to the logjava.lang.InterruptedException
public void run()
run
in interface java.lang.Runnable
public void finalize()
finalize
in class java.lang.Object
Copyright © 2009-2019 The Apache Software Foundation