public final class Block extends java.lang.Object implements SyncCacheListener
| Modifier and Type | Method and Description |
|---|---|
boolean |
allocate()
Allocates the block for a query.
|
void |
commit()
Handle any database writes necessary at commit time.
|
void |
commitNoWake()
Handle any database writes necessary at commit time.
|
void |
deallocate() |
void |
debugFd() |
void |
free()
Frees a block from a query.
|
long |
getBlockId()
Returns the block's id.
|
byte[] |
getBuffer()
Returns the block's buffer.
|
java.util.concurrent.locks.Lock |
getReadLock() |
BlockStore |
getStore()
Returns the block's table.
|
int |
getUseCount() |
java.util.concurrent.locks.Lock |
getWriteLock() |
boolean |
isDestroyed() |
boolean |
isDirty()
Returns true if the block needs writing
|
boolean |
isFlushDirtyOnCommit()
Returns true if the block should be flushed on a commit.
|
boolean |
isIndex() |
boolean |
isValid() |
void |
read()
Reads into the block.
|
boolean |
save()
Forces a write of the data.
|
void |
saveAllocation() |
void |
setDirty(int min,
int max)
Marks the block's data as dirty
|
void |
setDirtyExact(int min,
int max)
Sets a specific dirty value.
|
void |
setFlushDirtyOnCommit(boolean isFlush)
True if the block should be flushed on a commit.
|
boolean |
startLruRemove()
Called by the LRU cache before removing to see if the item can
actually be removed.
|
void |
syncLruRemoveEvent()
Called when the block is removed from the cache.
|
void |
syncRemoveEvent()
Called when the block is removed deliberately from the cache.
|
java.lang.String |
toString() |
void |
validateIsIndex() |
public boolean isFlushDirtyOnCommit()
public void setFlushDirtyOnCommit(boolean isFlush)
public boolean isIndex()
public void validateIsIndex()
public BlockStore getStore()
public long getBlockId()
public final java.util.concurrent.locks.Lock getReadLock()
public final java.util.concurrent.locks.Lock getWriteLock()
public final boolean isValid()
public boolean isDirty()
public final boolean allocate()
public void read()
throws java.io.IOException
java.io.IOExceptionpublic final byte[] getBuffer()
public final void setDirty(int min,
int max)
public void debugFd()
public final void setDirtyExact(int min,
int max)
public void commit()
throws java.io.IOException
java.io.IOExceptionpublic void commitNoWake()
throws java.io.IOException
java.io.IOExceptionpublic int getUseCount()
public void deallocate()
throws java.io.IOException
java.io.IOExceptionpublic void saveAllocation()
throws java.io.IOException
java.io.IOExceptionpublic final void free()
public boolean startLruRemove()
startLruRemove in interface SyncCacheListenerpublic final void syncLruRemoveEvent()
syncLruRemoveEvent in interface SyncCacheListenerpublic final void syncRemoveEvent()
syncRemoveEvent in interface SyncCacheListenerpublic boolean save()
public boolean isDestroyed()
public java.lang.String toString()
toString in class java.lang.Object