jdbm.recman
Class PageManager

java.lang.Object
  extended by jdbm.recman.PageManager

final class PageManager
extends java.lang.Object

This class manages the linked lists of pages that make up a file.


Constructor Summary
PageManager(RecordFile file)
          Creates a new page manager using the indicated record file.
 
Method Summary
(package private)  long allocate(short type)
          Allocates a page of the indicated type.
(package private)  void close()
          Closes the page manager.
(package private)  void commit()
          Commit all pending (in-memory) data by flushing the page manager.
(package private)  void free(short type, long recid)
          Frees a page of the indicated type.
(package private)  FileHeader getFileHeader()
          Returns the file header.
(package private)  long getFirst(short type)
          Returns the first page on the indicated list.
(package private)  long getLast(short type)
          Returns the last page on the indicated list.
(package private)  long getNext(long block)
          Returns the page following the indicated block
(package private)  long getPrev(long block)
          Returns the page before the indicated block
(package private)  void rollback()
          Flushes the page manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageManager

PageManager(RecordFile file)
      throws java.io.IOException
Creates a new page manager using the indicated record file.

Throws:
java.io.IOException
Method Detail

allocate

long allocate(short type)
        throws java.io.IOException
Allocates a page of the indicated type. Returns recid of the page.

Throws:
java.io.IOException

free

void free(short type,
          long recid)
    throws java.io.IOException
Frees a page of the indicated type.

Throws:
java.io.IOException

getNext

long getNext(long block)
       throws java.io.IOException
Returns the page following the indicated block

Throws:
java.io.IOException

getPrev

long getPrev(long block)
       throws java.io.IOException
Returns the page before the indicated block

Throws:
java.io.IOException

getFirst

long getFirst(short type)
        throws java.io.IOException
Returns the first page on the indicated list.

Throws:
java.io.IOException

getLast

long getLast(short type)
       throws java.io.IOException
Returns the last page on the indicated list.

Throws:
java.io.IOException

commit

void commit()
      throws java.io.IOException
Commit all pending (in-memory) data by flushing the page manager. This forces a flush of all outstanding blocks (this it's an implicit RecordFile.commit() as well).

Throws:
java.io.IOException

rollback

void rollback()
        throws java.io.IOException
Flushes the page manager. This forces a flush of all outstanding blocks (this it's an implicit RecordFile.commit() as well).

Throws:
java.io.IOException

close

void close()
     throws java.io.IOException
Closes the page manager. This flushes the page manager and releases the lock on the header.

Throws:
java.io.IOException

getFileHeader

FileHeader getFileHeader()
Returns the file header.



Cees de Groot (C) 2000-2001. All rights reserved http://jdbm.sourceforge.net