|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrossi.fstools.fs.reiserfs.FBlock
Representation of a formated block. This is one of 2 types, either an InternalNode or a LeafNode. This base class handles the block header.
Both InternalNode and Leaf node have a common header which is represented here.
On disk the block header looks like this:
31 24 16 8 0
--------------------------------------
0000 | Level | Num Items |
--------------------------------------
0004 | Free Space | Reserved |
--------------------------------------
0008 | Right Key |
--------------------------------------
000C | Right Key |
--------------------------------------
0010 | Right Key |
--------------------------------------
0014 | Right Key |
--------------------------------------
| Field Summary | |
protected int |
blocknum
|
protected int |
freeSpace
|
protected int |
level
|
protected int |
numItems
|
protected FBlock |
parent
|
protected int |
reserved
|
protected Key |
rightKey
|
protected ReiserSuperBlock |
sb
|
| Constructor Summary | |
FBlock(ReiserSuperBlock sb,
int blocknum)
Create a new formated block. |
|
| Method Summary | |
static FBlock |
createFromBuffer(ReiserSuperBlock sb,
int blocknum,
byte[] buffer,
int blkoffset)
Create a formatted block instance. |
int |
getBlockHeaderSize()
Get the size of the header for this formatted block. |
int |
getBlockNum()
|
int |
getDataSize()
Get size of this structure. |
int |
getFreeSpace()
Get the amount of free space within this block. |
int |
getLevel()
Get the level of this block in the B+tree. |
int |
getNumItems()
Get the number of items or keys within this block. |
FBlock |
getParent()
Get the parent of this block. |
int |
getReserved()
|
Key |
getRightKey()
Get the right most (hightest in sort order) key contained within this block. |
ReiserSuperBlock |
getSuperBlock()
Get the superblock for this filesystem. |
void |
loadFromBuffer(byte[] buffer,
int offset)
Load this structure from disk. |
void |
setFreeSpace(int aFreeSpace)
|
void |
setLevel(int aLevel)
|
void |
setNumItems(int aNumItems)
|
void |
setParent(FBlock aParent)
Set the parent of this block. |
void |
setReserved(int aReserved)
|
void |
setRightKey(Key aRightKey)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int level
protected int numItems
protected int freeSpace
protected int reserved
protected Key rightKey
protected ReiserSuperBlock sb
protected int blocknum
protected FBlock parent
| Constructor Detail |
public FBlock(ReiserSuperBlock sb,
int blocknum)
sb - a ReiserSuperBlockblocknum - a int| Method Detail |
public int getBlockHeaderSize()
public int getDataSize()
getDataSize in interface DiskStructureDiskStructure.getDataSize()public ReiserSuperBlock getSuperBlock()
public int getBlockNum()
public FBlock getParent()
public void setParent(FBlock aParent)
public int getLevel()
public void setLevel(int aLevel)
public int getNumItems()
LeafNode,
InternalNodepublic void setNumItems(int aNumItems)
public int getFreeSpace()
public void setFreeSpace(int aFreeSpace)
public int getReserved()
public void setReserved(int aReserved)
public Key getRightKey()
public void setRightKey(Key aRightKey)
public static FBlock createFromBuffer(ReiserSuperBlock sb,
int blocknum,
byte[] buffer,
int blkoffset)
throws FsException
sb - a ReiserSuperBlock for this filesystemblocknum - block number of the block to be processed.buffer - a byte[] buffer containing the blockblkoffset - a int offset into the buffer to the start of the block
FsException
public void loadFromBuffer(byte[] buffer,
int offset)
throws FsException
loadFromBuffer in interface DiskStructurebuffer - a byte[] containing data to be read in populating the objectoffset - a int indicating the offset within the buffer to start parsing.
FsException - if a parse error occursDiskStructure.loadFromBuffer(byte[], int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||