public class InMemoryStreamLog extends Object implements StreamLog, StreamLogWithRankedAddressSpace
Constructor and Description |
---|
InMemoryStreamLog()
Returns an object that stores a stream log in memory.
|
Modifier and Type | Method and Description |
---|---|
void |
append(List<LogData> entries)
Append a range of consecutive entries ordered by their addresses.
|
void |
append(long address,
LogData entry)
Append an entry to the stream log.
|
void |
close()
Close the stream log.
|
void |
compact()
Remove all trimmed addresses from the StreamLog.
|
TailsResponse |
getAllTails()
Get global and all stream tails.
|
long |
getLogTail()
Get the global log tail.
|
StreamsAddressResponse |
getStreamsAddressSpace()
Get the address space for every stream.
|
TailsResponse |
getTails(List<UUID> streams)
Get the global tail and stream tails.
|
long |
getTrimMark()
Get the first untrimmed address in the address space.
|
void |
prefixTrim(long address)
Prefix trim the global log.
|
LogData |
read(long address)
Given an address, read the corresponding stream entry.
|
void |
reset()
Clears all data and resets all segment handlers.
|
void |
sync(boolean force)
Sync the stream log file to secondary storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
assertAppendPermittedUnsafe
getOverwriteCauseForAddress
public InMemoryStreamLog()
public void append(List<LogData> entries)
StreamLog
public void append(long address, LogData entry)
StreamLog
public void prefixTrim(long address)
StreamLog
prefixTrim
in interface StreamLog
address
- address to trim the log up topublic TailsResponse getTails(List<UUID> streams)
StreamLog
public long getLogTail()
StreamLog
getLogTail
in interface StreamLog
public TailsResponse getAllTails()
StreamLog
getAllTails
in interface StreamLog
public StreamsAddressResponse getStreamsAddressSpace()
StreamLog
getStreamsAddressSpace
in interface StreamLog
public long getTrimMark()
StreamLog
getTrimMark
in interface StreamLog
public LogData read(long address)
StreamLog
public void sync(boolean force)
StreamLog
public void close()
StreamLog
public void compact()
StreamLog
Copyright © 2019 CorfuDB. All rights reserved.