|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rawstore.AbstractRawStore
com.bigdata.rawstore.AbstractRawWormStore
com.bigdata.journal.AbstractBufferStrategy
com.bigdata.journal.BasicBufferStrategy
public abstract class BasicBufferStrategy
Implements logic to read from and write on a buffer. This is sufficient
for a BufferMode.Transient implementation or a
BufferMode.Mapped implementation, but the
BufferMode.Direct implementation needs to also implement write
through to the disk.
| Field Summary | |
|---|---|
protected long |
extent
The current length of the backing file in bytes. |
protected long |
userExtent
The size of the user data space in bytes. |
| Fields inherited from class com.bigdata.journal.AbstractBufferStrategy |
|---|
bufferMode, ERR_ADDRESS_IS_NULL, ERR_ADDRESS_NOT_WRITTEN, ERR_BAD_RECORD_SIZE, ERR_BUFFER_EMPTY, ERR_BUFFER_NULL, ERR_INT32, ERR_NOT_OPEN, ERR_READ_ONLY, ERR_RECORD_LENGTH_ZERO, ERR_TRUNCATE, initialExtent, log, maximumExtent, nextOffset, WARN |
| Fields inherited from class com.bigdata.rawstore.AbstractRawWormStore |
|---|
am |
| Fields inherited from class com.bigdata.rawstore.AbstractRawStore |
|---|
serializer |
| Fields inherited from interface com.bigdata.rawstore.IAddressManager |
|---|
NULL |
| Method Summary | |
|---|---|
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). |
| Methods inherited from class com.bigdata.journal.AbstractBufferStrategy |
|---|
assertOpen, closeForWrites, destroy, getBufferMode, getInitialExtent, getMaximumExtent, getNextOffset, getResourceMetadata, getUUID, isOpen, isReadOnly, overflow, size, transferFromDiskTo |
| Methods inherited from class com.bigdata.rawstore.AbstractRawWormStore |
|---|
getAddressManager, getByteCount, getOffset, getOffsetBits, packAddr, toAddr, toString, unpackAddr |
| Methods inherited from class com.bigdata.rawstore.AbstractRawStore |
|---|
deserialize, deserialize, deserialize, serialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bigdata.journal.IBufferStrategy |
|---|
getHeaderSize, readRootBlock, writeRootBlock |
| Methods inherited from interface com.bigdata.rawstore.IRawStore |
|---|
deleteResources, force, getFile, isFullyBuffered, isStable |
| Methods inherited from interface com.bigdata.rawstore.IAddressManager |
|---|
getByteCount, getOffset, packAddr, toAddr, toString, unpackAddr |
| Methods inherited from interface com.bigdata.rawstore.IStoreSerializer |
|---|
deserialize, deserialize, deserialize, serialize |
| Field Detail |
|---|
protected long extent
protected long userExtent
| Method Detail |
|---|
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)
IRawStore
data - 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)
IRawStore
addr - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||