|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IBufferStrategy
Interface for implementations of a buffer strategy as identified by a
BufferMode. This interface is designed to encapsulate the
specifics of reading and writing slots and performing operations to make
an atomic commit.
| Field Summary |
|---|
| Fields inherited from interface com.bigdata.rawstore.IAddressManager |
|---|
NULL |
| Method Summary | |
|---|---|
void |
closeForWrites()
Seals the store against further writes and discards any write caches since they will no longer be used. |
BufferMode |
getBufferMode()
The buffer mode supported by the implementation |
CounterSet |
getCounters()
Return the performance counter hierarchy. |
long |
getExtent()
The current size of the journal in bytes. |
int |
getHeaderSize()
The size of the journal header, including MAGIC, version, and both root blocks. |
long |
getInitialExtent()
The initial extent. |
long |
getMaximumExtent()
The maximum extent allowable before a buffer overflow operation will be rejected. |
long |
getNextOffset()
The next offset at which a data item would be written on the store as an offset into the user extent. |
long |
getUserExtent()
The size of the user data extent in bytes. |
ByteBuffer |
readRootBlock(boolean rootBlock0)
Read the specified root block from the backing file. |
long |
transferTo(RandomAccessFile out)
A block operation that transfers the serialized records (aka the written on portion of the user extent) en mass from the buffer onto an output file. |
void |
truncate(long extent)
Either truncates or extends the journal. |
void |
writeRootBlock(IRootBlockView rootBlock,
ForceEnum forceOnCommitEnum)
Write the root block onto stable storage (ie, flush it through to disk). |
| Methods inherited from interface com.bigdata.rawstore.IRawStore |
|---|
close, deleteResources, destroy, force, getFile, getResourceMetadata, getUUID, isFullyBuffered, isOpen, isReadOnly, isStable, read, size, write |
| 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 |
| Method Detail |
|---|
long getNextOffset()
BufferMode getBufferMode()
long getInitialExtent()
long getMaximumExtent()
Note: The semantics here differ from those defined by
Options.MAXIMUM_EXTENT. The latter specifies the threshold at
which a journal will overflow (onto another journal) while this specifies
the maximum size to which a buffer is allowed to grow.
Note: This is normally zero (0L), which basically means that
the maximum extent is ignored by the IBufferStrategy but
respected by the AbstractJournal, resulting in a soft limit
on journal overflow.
0L
iff no limit is imposed.long getExtent()
Options.INITIAL_EXTENT.
long getUserExtent()
Note: The size of the user extent is always generally smaller than the
value reported by getExtent() since the latter also reports the
space allocated to the journal header and root blocks.
int getHeaderSize()
void truncate(long extent)
Note: Implementations of this method MUST be synchronized so that the operation is atomic with respect to concurrent writers.
extent - The new extent of the journal. This value represent the total
extent of the journal, including any root blocks together with
the user extent.
IllegalArgumentException - The user extent MAY NOT be increased beyond the maximum
offset for which the journal was provisioned by
Options.OFFSET_BITS.
void writeRootBlock(IRootBlockView rootBlock,
ForceEnum forceOnCommitEnum)
rootBlock - The root block. Which root block is indicated by
IRootBlockView.isRootBlock0().forceOnCommit - Governs whether or not the journal is forced to stable storage
and whether or not the file metadata for the journal is forced
to stable storage. See Options.FORCE_ON_COMMIT.ByteBuffer readRootBlock(boolean rootBlock0)
long transferTo(RandomAccessFile out)
throws IOException
Note: Implementations of this method MUST be synchronized so that the operation is atomic with respect to concurrent writers.
out - The file to which the buffer contents will be transferred.
IOExceptionvoid closeForWrites()
IllegalStateException - if the store is closed.
IllegalStateException - if the store is read-only.CounterSet getCounters()
getCounters in interface IRawStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||