public class DirectBufferStrategy extends DiskBackedBufferStrategy
ByteBufferas a write through cache and writes through to disk for persistence.
bufferMode, commitOffset, ERR_ADDRESS_IS_NULL, ERR_ADDRESS_NOT_WRITTEN, ERR_BAD_RECORD_SIZE, ERR_BUFFER_EMPTY, ERR_BUFFER_NULL, ERR_BUFFER_OVERRUN, ERR_MAX_EXTENT, ERR_NOT_OPEN, ERR_OPEN, ERR_READ_ONLY, ERR_RECORD_LENGTH_ZERO, ERR_TRUNCATE, initialExtent, log, maximumExtent, nextOffset, WARN
|Modifier and Type||Method and Description|
True iff the store is fully buffered (all reads are against memory).
Not needed for directBuffers
Note: This is synchronized since it MAY be invoked directly while concurrent writers are running and not just from
Extends the basic behavior to write through to the backing file.
close, delete, deleteResources, force, getChannel, getFile, getHeaderSize, getRandomAccessFile, isStable, read, readRootBlock, transferTo, writeRootBlock
getBufferView, getCounters, getExtent, getUserExtent
abort, assertOpen, closeForWrites, commit, destroy, getBufferMode, getInitialExtent, getMaximumExtent, getMaxRecordSize, getMetaBitsAddr, getMetaStartAddr, getMinimumExtension, getNextOffset, getResourceMetadata, getUUID, isDirty, isOpen, isReadOnly, overflow, requiresCommit, size, transferFromDiskTo, useChecksums
getAddressManager, getByteCount, getOffset, getOffsetBits, getPhysicalAddress, toAddr, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, closeForWrites, commit, getAddressManager, getBufferMode, getCounters, getExtent, getInitialExtent, getMaximumExtent, getMaxRecordSize, getMetaBitsAddr, getMetaStartAddr, getNextOffset, getOffsetBits, getUserExtent, isDirty, requiresCommit, useChecksums
destroy, getResourceMetadata, getUUID, isOpen, isReadOnly, size
getByteCount, getOffset, getPhysicalAddress, toAddr, toString
public boolean isFullyBuffered()
Note: This does not guarantee that the OS will not swap the buffer onto disk.
public long write(ByteBuffer data)
ClosedChannelException can be thrown out of this method.
This exception is an indication that the backing channel was closed while
a writer was still running.
ClosedByInterruptException can be thrown out of this method
(wrapped as a
RuntimeException). This exception is an indication
that a writer was interrupted. This will occur if you are using
ExecutorService.shutdownNow() on a service that is running one or
more writers. In such cases this should not be considered an error but
the expected result of interrupting the writer.
However, note that
ClosedByInterruptException means that the
channel was actually closed when the writer was
interrupted. This means that you basically can not interrupt running
writers without having to re-open the channel.
data- The data. The bytes from the current
Buffer.limit()will be written and the
Buffer.position()will be advanced to the
Buffer.limit(). The caller may subsequently modify the contents of the buffer without changing the state of the store (i.e., the data are copied into the store).
public void truncate(long newExtent)
newExtent- The new extent of the journal. This value represent the total extent of the journal, including any root blocks together with the user extent.
public void setNextOffset(long lastOffset)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.