org.openrdf.sail.nativerdf.btree
Class AllocatedNodesList

java.lang.Object
  extended by org.openrdf.sail.nativerdf.btree.AllocatedNodesList

public class AllocatedNodesList
extends Object

List of allocated BTree nodes, persisted to a file on disk.

Author:
Arjohn Kampman

Constructor Summary
AllocatedNodesList(File allocNodesFile, BTree btree)
          Creates a new AllocatedNodelist for the specified BTree.
 
Method Summary
 int allocateNode()
           
 void clear()
          Clears the allocated nodes list.
 boolean delete()
          Deletes the allocated nodes file.
 void freeNode(int nodeID)
           
 File getFile()
          Gets the allocated nodes file.
 int getMaxNodeID()
          Returns the highest allocated node ID.
 int getNodeCount()
          Returns the number of allocated nodes.
 void sync()
          Writes any changes that are cached in memory to disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllocatedNodesList

public AllocatedNodesList(File allocNodesFile,
                          BTree btree)
Creates a new AllocatedNodelist for the specified BTree.

Method Detail

getFile

public File getFile()
Gets the allocated nodes file.


delete

public boolean delete()
               throws IOException
Deletes the allocated nodes file.

Returns:
true if the file was deleted.
Throws:
IOException

sync

public void sync()
          throws IOException
Writes any changes that are cached in memory to disk.

Throws:
IOException

clear

public void clear()
           throws IOException
Clears the allocated nodes list.

Throws:
IOException - If an I/O error occurred.

allocateNode

public int allocateNode()
                 throws IOException
Throws:
IOException

freeNode

public void freeNode(int nodeID)
              throws IOException
Throws:
IOException

getMaxNodeID

public int getMaxNodeID()
                 throws IOException
Returns the highest allocated node ID.

Throws:
IOException

getNodeCount

public int getNodeCount()
                 throws IOException
Returns the number of allocated nodes.

Throws:
IOException


Copyright © 2001-2008 Aduna. All Rights Reserved.