public static class WriteCache.ReadCache extends WriteCache
WriteCache.FileChannelScatteredWriteCache, WriteCache.FileChannelWriteCache, WriteCache.HAPackage, WriteCache.ReadCache, WriteCache.RecordMetadata
counters, log, recordMap
Constructor and Description |
---|
WriteCache.ReadCache(IBufferAccess buf) |
Modifier and Type | Method and Description |
---|---|
void |
closeForWrites()
Called from
WriteCacheService to lock buffer content immediately
prior to flushing and HA pipline replication. |
boolean |
isClosedForWrites()
ReadCache is always closedForWrites
|
protected boolean |
writeOnChannel(ByteBuffer buf,
long firstOffset,
Map<Long,WriteCache.RecordMetadata> recordMap,
long nanos)
Write the data from the buffer onto the channel.
|
allocate, bytesWritten, capacity, close, contains, decrementReferenceCount, flush, flush, getCompressorKey, getCounters, getFileExtent, getLastOffset, getReferenceCount, incrementReferenceCount, read, registerWriteStatus, reset, resetRecordMapFromBuffer, resetRecordMapFromBuffer, setFileExtent, setFirstOffset, setRecordMap, toString, write
public WriteCache.ReadCache(IBufferAccess buf) throws InterruptedException
InterruptedException
protected boolean writeOnChannel(ByteBuffer buf, long firstOffset, Map<Long,WriteCache.RecordMetadata> recordMap, long nanos) throws InterruptedException, TimeoutException, IOException
WriteCache
Implementations of this method MAY support gathered writes, depending on
the channel. The necessary information to perform a gathered write is
present in the recordMap. On the other hand, the implementation
MAY require that the records in the cache are laid out for a WORM, in
which case WriteCache.getFirstOffset()
provides the starting offset for the
data to be written. The application MUST coordinate the requirements for
a R/W or WORM store with the use of the WriteCache
and the means
to write on the backing channel.
writeOnChannel
in class WriteCache
buf
- The data to be written. Only the dirty bytes are visible in
this view. The implementation should write all bytes from the
current position to the limit.firstOffset
- The offset of the first record in the recordMap into the file
(may be relative to a base offset within the file). This is
provided as an optimization for the WORM which writes its
records contiguously on the backing store.recordMap
- The mapping of record offsets onto metadata about those
records.nanos
- The timeout for the operation in nanoseconds.true
if the operation was completed successfully
within the time alloted.InterruptedException
- if the thread was interrupted.IOException
- if there was an IO problem.TimeoutException
public boolean isClosedForWrites()
isClosedForWrites
in class WriteCache
public void closeForWrites()
WriteCache
WriteCacheService
to lock buffer content immediately
prior to flushing and HA pipline replication. Neither the internal buffer
state nor the WriteCache.recordMap
may be changed once the
WriteCache
has been closed for writes. This is necessary to
provide 100% binary replication. Otherwise the stores can differ in the
data in freed allocation slots.closeForWrites
in class WriteCache
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.