|
||||||||||
| 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
com.bigdata.journal.DiskBackedBufferStrategy
public abstract class DiskBackedBufferStrategy
Abstract base class for implementations that use a direct buffer as a write
through cache to an image on the disk. This covers both the
BufferMode.Direct, where we use explicit IO operations, and the
BufferMode.Mapped, where we memory-map the image. Common features
shared by these implementations deal mainly with initialization of a new disk
image.
| Field Summary | |
|---|---|
protected IReopenChannel |
opener
Used to re-open the FileChannel in this class. |
| Fields inherited from class com.bigdata.journal.BasicBufferStrategy |
|---|
extent, userExtent |
| 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()
Closes the file. |
void |
deleteResources()
Deletes the backing file(s) (if any) and clears any records for the store from the IGlobalLRU. |
void |
force(boolean metadata)
Forces the data to disk. |
FileChannel |
getChannel()
The channel used to read and write on the file. |
File |
getFile()
The backing file. |
int |
getHeaderSize()
The size of the file header in bytes. |
RandomAccessFile |
getRandomAccessFile()
The object used to read and write on that file. |
boolean |
isStable()
True iff backed by stable storage. |
ByteBuffer |
read(long addr)
The backing file is fully buffered so it does not need to be open for a read to succeed. |
ByteBuffer |
readRootBlock(boolean rootBlock0)
Read the specified root block from the backing file. |
long |
transferTo(RandomAccessFile out)
Note: This is synchronized so that concurrent writers must block during this operation. |
void |
writeRootBlock(IRootBlockView rootBlock,
ForceEnum forceOnCommit)
Write the root block onto stable storage (ie, flush it through to disk). |
| Methods inherited from class com.bigdata.journal.BasicBufferStrategy |
|---|
getBufferView, getCounters, getExtent, getUserExtent, truncate, write |
| 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 |
|---|
closeForWrites, getBufferMode, getCounters, getExtent, getInitialExtent, getMaximumExtent, getNextOffset, getUserExtent, truncate |
| Methods inherited from interface com.bigdata.rawstore.IRawStore |
|---|
destroy, getResourceMetadata, getUUID, isFullyBuffered, isOpen, isReadOnly, 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 |
| Field Detail |
|---|
protected final IReopenChannel opener
FileChannel in this class.
| Method Detail |
|---|
public final int getHeaderSize()
IDiskBasedStrategy
getHeaderSize in interface IBufferStrategygetHeaderSize in interface IDiskBasedStrategypublic final File getFile()
IDiskBasedStrategy
getFile in interface IDiskBasedStrategygetFile in interface IRawStorepublic final RandomAccessFile getRandomAccessFile()
IDiskBasedStrategy
getRandomAccessFile in interface IDiskBasedStrategypublic final FileChannel getChannel()
IDiskBasedStrategy
getChannel in interface IDiskBasedStrategypublic final boolean isStable()
IRawStore
isStable in interface IRawStorepublic void force(boolean metadata)
force in interface IRawStoremetadata - If true, then force both the file contents and the file
metadata to disk.public void close()
close in interface IRawStoreclose in class BasicBufferStrategypublic void deleteResources()
IRawStoreIGlobalLRU.
deleteResources in interface IRawStorepublic ByteBuffer readRootBlock(boolean rootBlock0)
IBufferStrategy
readRootBlock in interface IBufferStrategy
public void writeRootBlock(IRootBlockView rootBlock,
ForceEnum forceOnCommit)
IBufferStrategy
writeRootBlock in interface IBufferStrategyrootBlock - The root block. Which root block is indicated by
IRootBlockView.isRootBlock0().
public long transferTo(RandomAccessFile out)
throws IOException
BasicBufferStrategy
transferTo in interface IBufferStrategytransferTo in class BasicBufferStrategyout - The file to which the buffer contents will be transferred.
IOExceptionpublic ByteBuffer read(long addr)
FileChannel if it has been closed asynchronously or
in response to an interrupt (that is, if we discover that the channel is
closed but AbstractBufferStrategy.isOpen() still returns true).
read in interface IRawStoreread in class BasicBufferStrategyaddr - 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).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||