|Modifier and Type||Field and Description|
An offset which will be applied to each record written onto the backing
Used to re-open the
|Constructor and Description|
|Modifier and Type||Method and Description|
Write the data from the buffer onto the channel.
allocate, bytesWritten, capacity, close, closeForWrites, contains, decrementReferenceCount, flush, flush, getCompressorKey, getCounters, getFileExtent, getLastOffset, getReferenceCount, incrementReferenceCount, isClosedForWrites, read, registerWriteStatus, reset, resetRecordMapFromBuffer, resetRecordMapFromBuffer, setFileExtent, setFirstOffset, setRecordMap, toString, write
protected final long baseOffset
FileChannel. The offset is generally the size of the root blocks for a journal or the checkpoint record for an index segment. It can be zero if you do not have anything at the head of the file.
Note: This implies that writing the root blocks is done separately in the protocol since you can't write below this offset otherwise.
public WriteCache.FileChannelWriteCache(long baseOffset, IBufferAccess buf, boolean useChecksum, boolean isHighlyAvailable, boolean bufferHasData, IReopenChannel<FileChannel> opener, long fileExtent) throws InterruptedException
baseOffset- An offset
protected boolean writeOnChannel(ByteBuffer data, long firstOffset, Map<Long,WriteCache.RecordMetadata> recordMap, long nanos) throws InterruptedException, IOException
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
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.
data- 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.
trueif the operation was completed successfully within the time alloted.
InterruptedException- if the thread was interrupted.
IOException- if there was an IO problem.
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.