public abstract class DiskBackedBufferStrategy extends BasicBufferStrategy implements IDiskBasedStrategy
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.| Modifier and Type | Field and Description |
|---|---|
protected IReopenChannel<FileChannel> |
opener
Used to re-open the
FileChannel in this class. |
extent, userExtentbufferMode, 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()
Closes the file.
|
void |
delete(long addr)
The default is a NOP.
|
void |
deleteResources()
Deletes the backing file(s) (if any).
|
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.
|
void |
setNextOffset(long lastOffset)
Protocol support for HAWrite
|
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).
|
getBufferView, getCounters, getExtent, getUserExtent, truncate, writeabort, assertOpen, closeForWrites, commit, 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, waitabort, closeForWrites, commit, getAddressManager, getBufferMode, getCounters, getExtent, getInitialExtent, getMaximumExtent, getMaxRecordSize, getMetaBitsAddr, getMetaStartAddr, getNextOffset, getOffsetBits, getUserExtent, isDirty, requiresCommit, truncate, useChecksumsdestroy, getResourceMetadata, getUUID, isFullyBuffered, isOpen, isReadOnly, size, writegetByteCount, getOffset, getPhysicalAddress, toAddr, toStringgetInputStream, getOutputStreamprotected final IReopenChannel<FileChannel> opener
FileChannel in this class.public final int getHeaderSize()
IDiskBasedStrategygetHeaderSize in interface IBufferStrategygetHeaderSize in interface IDiskBasedStrategypublic final File getFile()
IDiskBasedStrategygetFile in interface IDiskBasedStrategygetFile in interface IRawStorepublic final RandomAccessFile getRandomAccessFile()
IDiskBasedStrategygetRandomAccessFile in interface IDiskBasedStrategypublic final FileChannel getChannel()
IDiskBasedStrategygetChannel in interface IDiskBasedStrategypublic final boolean isStable()
IRawStorepublic void delete(long addr)
AbstractBufferStrategydelete in interface IRawStoredelete in class AbstractBufferStrategyaddr - A long integer formed using Addr that encodes both the
offset at which the data was written and the #of bytes that
were written.public void force(boolean metadata)
public void close()
close in interface IRawStoreclose in class BasicBufferStrategypublic void deleteResources()
IRawStoredeleteResources in interface IRawStorepublic ByteBuffer readRootBlock(boolean rootBlock0)
IBufferStrategyreadRootBlock in interface IBufferStrategypublic void writeRootBlock(IRootBlockView rootBlock, ForceEnum forceOnCommit)
IBufferStrategywriteRootBlock in interface IBufferStrategyrootBlock - The root block. Which root block is indicated by
IRootBlockView.isRootBlock0().public long transferTo(RandomAccessFile out) throws IOException
BasicBufferStrategytransferTo 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).public void setNextOffset(long lastOffset)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.