com.caucho.db.store
Class AutoCommitWriteBlock

java.lang.Object
  extended by com.caucho.db.store.Block
      extended by com.caucho.db.store.WriteBlock
          extended by com.caucho.db.store.AutoCommitWriteBlock
All Implemented Interfaces:
SyncCacheListener

public class AutoCommitWriteBlock
extends WriteBlock

Represents a write (dirty) block. The AutoCommitWriteBlock


Field Summary
 
Fields inherited from class com.caucho.db.store.WriteBlock
_block
 
Fields inherited from class com.caucho.db.store.Block
_freeBuffers
 
Constructor Summary
AutoCommitWriteBlock(Block block)
           
 
Method Summary
 void commit()
          Handle any database writes necessary at commit time.
protected  void freeImpl()
          Closes the write block.
 byte[] getBuffer()
          The buffer for the auto-commit is the same as the read buffer.
 void setDirty(int minDirty, int maxDirty)
          Marks the block's data as dirty
 void setFlushDirtyOnCommit(boolean flushOnCommit)
          True if the block should be flushed on a commit.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.db.store.Block
allocate, free, getBlockId, getLock, invalidate, isDirty, isFlushDirtyOnCommit, isFree, read, syncRemoveEvent, write, writeImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutoCommitWriteBlock

public AutoCommitWriteBlock(Block block)
                     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getBuffer

public byte[] getBuffer()
The buffer for the auto-commit is the same as the read buffer.

Specified by:
getBuffer in class Block

setDirty

public void setDirty(int minDirty,
                     int maxDirty)
Description copied from class: Block
Marks the block's data as dirty

Overrides:
setDirty in class Block

setFlushDirtyOnCommit

public void setFlushDirtyOnCommit(boolean flushOnCommit)
Description copied from class: Block
True if the block should be flushed on a commit.

Overrides:
setFlushDirtyOnCommit in class Block

commit

public void commit()
            throws java.io.IOException
Description copied from class: Block
Handle any database writes necessary at commit time. If isFlushDirtyOnCommit() is true, this will write the data to the backing file.

Overrides:
commit in class Block
Throws:
java.io.IOException

freeImpl

protected void freeImpl()
Closes the write block.

Overrides:
freeImpl in class Block

toString

public java.lang.String toString()
Overrides:
toString in class WriteBlock