com.bigdata.journal
Class TransientBufferStrategy

java.lang.Object
  extended by com.bigdata.rawstore.AbstractRawStore
      extended by com.bigdata.rawstore.AbstractRawWormStore
          extended by com.bigdata.journal.AbstractBufferStrategy
              extended by com.bigdata.journal.BasicBufferStrategy
                  extended by com.bigdata.journal.TransientBufferStrategy
All Implemented Interfaces:
ICounterSetAccess, IBufferStrategy, IAddressManager, IMRMW, IMROW, IRawStore, IWORM

public class TransientBufferStrategy
extends BasicBufferStrategy

Transient buffer strategy uses a direct buffer but never writes on disk.

Version:
$Id: TransientBufferStrategy.java 4069 2011-01-09 20:58:02Z thompsonbry $
Author:
Bryan Thompson
See Also:
BufferMode.Transient

Field Summary
 
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_BUFFER_OVERRUN, ERR_INT32, ERR_NOT_OPEN, ERR_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 interface com.bigdata.rawstore.IAddressManager
NULL
 
Method Summary
 void deleteResources()
          Deletes the backing file(s) (if any) and clears any records for the store from the IGlobalLRU.
 void force(boolean metadata)
          Force the data to stable storage.
 File getFile()
          Always returns null.
 int getHeaderSize()
          There is no header.
 boolean isFullyBuffered()
          True iff the store is fully buffered (all reads are against memory).
 boolean isStable()
          True iff backed by stable storage.
 ByteBuffer readRootBlock(boolean rootBlock0)
          Read the specified root block from the backing file.
 void setNextOffset(long lastOffset)
          Protocol support for HAWrite
 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
close, getBufferView, getCounters, getExtent, getUserExtent, read, transferTo, truncate, write
 
Methods inherited from class com.bigdata.journal.AbstractBufferStrategy
abort, assertOpen, closeForWrites, commit, delete, destroy, getBufferMode, getInitialExtent, getMaximumExtent, getMaxRecordSize, getMetaBitsAddr, getMetaStartAddr, getMinimumExtension, getNextOffset, getResourceMetadata, getUUID, isOpen, isReadOnly, overflow, requiresCommit, size, transferFromDiskTo, useChecksums
 
Methods inherited from class com.bigdata.rawstore.AbstractRawWormStore
getAddressManager, getByteCount, getOffset, getOffsetBits, getPhysicalAddress, toAddr, toString
 
Methods inherited from class com.bigdata.rawstore.AbstractRawStore
abortContext, delete, detachContext, write, write, write
 
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
getAddressManager, getOffsetBits
 
Methods inherited from interface com.bigdata.rawstore.IRawStore
write
 
Methods inherited from interface com.bigdata.rawstore.IAddressManager
getByteCount, getOffset, getPhysicalAddress, toAddr, toString
 

Method Detail

deleteResources

public void deleteResources()
Description copied from interface: IRawStore
Deletes the backing file(s) (if any) and clears any records for the store from the IGlobalLRU.


force

public void force(boolean metadata)
Description copied from interface: IRawStore
Force the data to stable storage. While this is NOT sufficient to guarantee an atomic commit, the data must be forced to disk as part of an atomic commit protocol.

Parameters:
metadata - If true, then force both the file contents and the file metadata to disk.

getFile

public File getFile()
Always returns null.


isStable

public final boolean isStable()
Description copied from interface: IRawStore
True iff backed by stable storage.


isFullyBuffered

public boolean isFullyBuffered()
Description copied from interface: IRawStore
True iff the store is fully buffered (all reads are against memory). Implementations MAY change the value returned by this method over the life cycle of the store, e.g., to conserve memory a store may drop or decrease its buffer if it is backed by disk.

Note: This does not guarantee that the OS will not swap the buffer onto disk.


writeRootBlock

public void writeRootBlock(IRootBlockView rootBlock,
                           ForceEnum forceOnCommit)
Description copied from interface: IBufferStrategy
Write the root block onto stable storage (ie, flush it through to disk).

Parameters:
rootBlock - The root block. Which root block is indicated by IRootBlockView.isRootBlock0().

getHeaderSize

public final int getHeaderSize()
There is no header.

Returns:
ZERO (0).

readRootBlock

public ByteBuffer readRootBlock(boolean rootBlock0)
Description copied from interface: IBufferStrategy
Read the specified root block from the backing file.


setNextOffset

public void setNextOffset(long lastOffset)
Protocol support for HAWrite



Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.