org.exist.storage.btree
Class Paged

java.lang.Object
  extended by org.exist.storage.btree.Paged
Direct Known Subclasses:
BTree

public abstract class Paged
extends Object

Paged is a paged file foundation that is used by the BTree class and its subclasses.


Nested Class Summary
 class Paged.FileHeader
          FileHeader
 class Paged.Page
          Page
static class Paged.PageHeader
           
 
Field Summary
static int LENGTH_FIRST_FREE_PAGE
           
static int LENGTH_HEADER_SIZE
           
static int LENGTH_LAST_FREE_PAGE
           
static int LENGTH_MAX_KEY_SIZE
           
static int LENGTH_PAGE_COUNT
           
static int LENGTH_PAGE_HEADER_SIZE
           
static int LENGTH_PAGE_SIZE
           
static int LENGTH_RECORD_COUNT
           
static int LENGTH_TOTAL_COUNT
           
static int LENGTH_VERSION_ID
           
static int OFFSET_FIRST_FREE_PAGE
           
static int OFFSET_HEADER_SIZE
           
static int OFFSET_LAST_FREE_PAGE
           
static int OFFSET_MAX_KEY_SIZE
           
static int OFFSET_PAGE_COUNT
           
static int OFFSET_PAGE_HEADER_SIZE
           
static int OFFSET_PAGE_SIZE
           
static int OFFSET_RECORD_COUNT
           
static int OFFSET_REMAINDER
           
static int OFFSET_TOTAL_COUNT
           
static int OFFSET_VERSION_ID
           
 
Constructor Summary
Paged(BrokerPool pool)
           
 
Method Summary
 void backupToStream(OutputStream os)
          Backup the entire contents of the underlying file to an output stream.
 boolean close()
          Close the underlying files.
 void closeAndRemove()
          Completely close down the instance and all underlying resources and caches.
 boolean create()
           
abstract  Paged.FileHeader createFileHeader(int pageSize)
          createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.
abstract  Paged.PageHeader createPageHeader()
          createPageHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a PageHeader.
 boolean exists()
           
 boolean flush()
           
 File getFile()
          getFile returns the file object for this Paged.
 Paged.FileHeader getFileHeader()
          getFileHeader returns the FileHeader
abstract  short getFileVersion()
           
static int getPageSize()
           
static String hexDump(byte[] data)
           
 boolean isOpened()
          Gets the opened attribute of the Paged object
 boolean isReadOnly()
           
 boolean open(short expectedVersion)
           
 void printFreeSpaceList()
          Debug
static void setPageSize(int pageSize)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LENGTH_VERSION_ID

public static int LENGTH_VERSION_ID

LENGTH_HEADER_SIZE

public static int LENGTH_HEADER_SIZE

LENGTH_PAGE_COUNT

public static int LENGTH_PAGE_COUNT

LENGTH_PAGE_SIZE

public static int LENGTH_PAGE_SIZE

LENGTH_TOTAL_COUNT

public static int LENGTH_TOTAL_COUNT

LENGTH_FIRST_FREE_PAGE

public static int LENGTH_FIRST_FREE_PAGE

LENGTH_LAST_FREE_PAGE

public static int LENGTH_LAST_FREE_PAGE

LENGTH_PAGE_HEADER_SIZE

public static int LENGTH_PAGE_HEADER_SIZE

LENGTH_MAX_KEY_SIZE

public static int LENGTH_MAX_KEY_SIZE

LENGTH_RECORD_COUNT

public static int LENGTH_RECORD_COUNT

OFFSET_VERSION_ID

public static int OFFSET_VERSION_ID

OFFSET_HEADER_SIZE

public static int OFFSET_HEADER_SIZE

OFFSET_PAGE_SIZE

public static int OFFSET_PAGE_SIZE

OFFSET_PAGE_COUNT

public static int OFFSET_PAGE_COUNT

OFFSET_TOTAL_COUNT

public static int OFFSET_TOTAL_COUNT

OFFSET_FIRST_FREE_PAGE

public static int OFFSET_FIRST_FREE_PAGE

OFFSET_LAST_FREE_PAGE

public static int OFFSET_LAST_FREE_PAGE

OFFSET_PAGE_HEADER_SIZE

public static int OFFSET_PAGE_HEADER_SIZE

OFFSET_MAX_KEY_SIZE

public static int OFFSET_MAX_KEY_SIZE

OFFSET_RECORD_COUNT

public static int OFFSET_RECORD_COUNT

OFFSET_REMAINDER

public static int OFFSET_REMAINDER
Constructor Detail

Paged

public Paged(BrokerPool pool)
Method Detail

getFileVersion

public abstract short getFileVersion()

setPageSize

public static final void setPageSize(int pageSize)

getPageSize

public static final int getPageSize()

isReadOnly

public final boolean isReadOnly()

close

public boolean close()
              throws DBException
Close the underlying files.

Returns:
TRUE if closed.
Throws:
DBException

create

public boolean create()
               throws DBException
Throws:
DBException

createFileHeader

public abstract Paged.FileHeader createFileHeader(int pageSize)
createFileHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a FileHeader.

Returns:
a new FileHeader

createPageHeader

public abstract Paged.PageHeader createPageHeader()
createPageHeader must be implemented by a Paged implementation in order to create an appropriate subclass instance of a PageHeader.

Returns:
a new PageHeader

exists

public boolean exists()

flush

public boolean flush()
              throws DBException
Throws:
DBException

backupToStream

public void backupToStream(OutputStream os)
                    throws IOException
Backup the entire contents of the underlying file to an output stream.

Parameters:
os -
Throws:
IOException

getFile

public final File getFile()
getFile returns the file object for this Paged.

Returns:
The File

getFileHeader

public Paged.FileHeader getFileHeader()
getFileHeader returns the FileHeader

Returns:
The FileHeader

closeAndRemove

public void closeAndRemove()
Completely close down the instance and all underlying resources and caches.


isOpened

public boolean isOpened()
Gets the opened attribute of the Paged object

Returns:
The opened value

open

public boolean open(short expectedVersion)
             throws DBException
Throws:
DBException

printFreeSpaceList

public void printFreeSpaceList()
                        throws IOException
Debug

Throws:
IOException - Description of the Exception

hexDump

public static String hexDump(byte[] data)


Copyright (C) Wolfgang Meier. All rights reserved.