public abstract class BasicBufferStrategy extends AbstractBufferStrategy
BufferMode.Transient implementation or a
BufferMode.Mapped implementation, but the
BufferMode.Direct implementation needs to also implement write
through to the disk.| Modifier and Type | Field and Description |
|---|---|
protected long |
extent
The current length of the backing file in bytes.
|
protected long |
userExtent
The size of the user data space in bytes.
|
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, WARNamNULL| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases the buffer.
|
protected ByteBuffer |
getBufferView(boolean readOnly) |
CounterSet |
getCounters()
FIXME Counters need to be added here for the
DirectBufferStrategy,
MappedBufferStrategy, and TransientBufferStrategy. |
long |
getExtent()
The current size of the journal in bytes.
|
long |
getUserExtent()
The size of the user data extent in bytes.
|
ByteBuffer |
read(long addr)
Read the data (unisolated).
|
long |
transferTo(RandomAccessFile out)
Note: This is synchronized so that concurrent writers must block during
this operation.
|
void |
truncate(long newExtent)
Note: This is synchronized since it MAY be invoked directly while
concurrent writers are running and not just from
AbstractBufferStrategy.overflow(long). |
long |
write(ByteBuffer data)
Write the data (unisolated).
|
abort, assertOpen, closeForWrites, commit, delete, destroy, getBufferMode, getInitialExtent, getMaximumExtent, getMaxRecordSize, getMetaBitsAddr, getMetaStartAddr, getMinimumExtension, getNextOffset, getResourceMetadata, getUUID, isDirty, isOpen, isReadOnly, overflow, requiresCommit, size, transferFromDiskTo, useChecksumsgetAddressManager, getByteCount, getOffset, getOffsetBits, getPhysicalAddress, toAddr, toStringgetInputStream, getOutputStreamclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAddressManager, getHeaderSize, getOffsetBits, readRootBlock, writeRootBlockdeleteResources, force, getFile, isFullyBuffered, isStablegetByteCount, getOffset, getPhysicalAddress, toAddr, toStringgetInputStream, getOutputStreamprotected long extent
protected long userExtent
protected ByteBuffer getBufferView(boolean readOnly)
readOnly - public long getExtent()
IBufferStrategyOptions.INITIAL_EXTENT.public long getUserExtent()
IBufferStrategy
Note: The size of the user extent is always generally smaller than the
value reported by IBufferStrategy.getExtent() since the latter also reports the
space allocated to the journal header and root blocks.
public void close()
close in interface IRawStoreclose in class AbstractBufferStrategypublic long write(ByteBuffer data)
IRawStoredata - The data. The bytes from the current
Buffer.position() to the
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).IAddressManager.public ByteBuffer read(long addr)
IRawStoreaddr - A long integer that encodes both the offset from which the
data will be read and the #of bytes to be read. See
IAddressManager.toAddr(int, long).public void truncate(long newExtent)
AbstractBufferStrategy.overflow(long).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 long transferTo(RandomAccessFile out) throws IOException
out - The file to which the buffer contents will be transferred.IOExceptionpublic CounterSet getCounters()
DirectBufferStrategy,
MappedBufferStrategy, and TransientBufferStrategy.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.