JXTA

net.jxta.impl.xindice.core.filer
Class Paged.FileHeader

java.lang.Object
  extended by net.jxta.impl.xindice.core.filer.Paged.FileHeader
Direct Known Subclasses:
BTree.BTreeFileHeader
Enclosing class:
Paged

public abstract class Paged.FileHeader
extends Object

Paged file's header


Constructor Summary
Paged.FileHeader()
           
Paged.FileHeader(boolean read)
           
Paged.FileHeader(long pageCount)
           
Paged.FileHeader(long pageCount, int pageSize)
           
 
Method Summary
 void decRecordCount()
          Decrement the number of records being managed by the file
 long getFirstFreePage()
          The first free page in unused secondary space
 short getHeaderSize()
          The size of the FileHeader.
 long getLastFreePage()
          The last free page in unused secondary space
 short getMaxKeySize()
          Get the maximum number of bytes.
 long getPageCount()
          The number of pages in primary storage
 byte getPageHeaderSize()
          Get the size of a page header.
 int getPageSize()
          The size of a page.
 long getRecordCount()
          The number of records being managed by the file (not pages)
 long getTotalCount()
          The number of total pages in the file
 int getWorkSize()
           
 void incRecordCount()
          Increment the number of records being managed by the file
 long incTotalCount()
           
 boolean isDirty()
           
 void read()
           
 void read(RandomAccessFile raf)
           
 void setDirty()
           
 void setFirstFreePage(long firstFreePage)
          The first free page in unused secondary space
 void setHeaderSize(short headerSize)
          The size of the FileHeader.
 void setLastFreePage(long lastFreePage)
          The last free page in unused secondary space
 void setMaxKeySize(short maxKeySize)
          Set the maximum number of bytes a key can be.
 void setPageCount(long pageCount)
          The number of pages in primary storage.
 void setPageHeaderSize(byte pageHeaderSize)
          Set the size of a page header.
 void setPageSize(int pageSize)
          The size of a page.
 void setTotalCount(long totalCount)
          The number of total pages in the file.
 void write()
           
 void write(RandomAccessFile raf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Paged.FileHeader

public Paged.FileHeader()

Paged.FileHeader

public Paged.FileHeader(long pageCount)

Paged.FileHeader

public Paged.FileHeader(long pageCount,
                        int pageSize)

Paged.FileHeader

public Paged.FileHeader(boolean read)
                 throws IOException
Throws:
IOException
Method Detail

read

public final void read()
                throws IOException
Throws:
IOException

read

public void read(RandomAccessFile raf)
          throws IOException
Throws:
IOException

write

public final void write()
                 throws IOException
Throws:
IOException

write

public void write(RandomAccessFile raf)
           throws IOException
Throws:
IOException

setDirty

public final void setDirty()

isDirty

public final boolean isDirty()

setHeaderSize

public final void setHeaderSize(short headerSize)
The size of the FileHeader. Usually 1 OS Page. This method should be called only while initializing Paged, not during normal processing.

Parameters:
headerSize - the new header size

getHeaderSize

public final short getHeaderSize()
The size of the FileHeader. Usually 1 OS Page

Returns:
the header size

setPageSize

public final void setPageSize(int pageSize)
The size of a page. Usually a multiple of a FS block. This method should be called only while initializing Paged, not during normal processing.

Parameters:
pageSize - the new page size

getPageSize

public final int getPageSize()
The size of a page. Usually a multiple of a FS block

Returns:
the page size

setPageCount

public final void setPageCount(long pageCount)
The number of pages in primary storage. This method should be called only while initializing Paged, not during normal processing.

Parameters:
pageCount - the new page count

getPageCount

public final long getPageCount()
The number of pages in primary storage

Returns:
the page count

setTotalCount

public final void setTotalCount(long totalCount)
The number of total pages in the file. This method should be called only while initializing Paged, not during normal processing.

Parameters:
totalCount - the new total count

incTotalCount

public final long incTotalCount()

getTotalCount

public final long getTotalCount()
The number of total pages in the file

Returns:
the total count

setFirstFreePage

public final void setFirstFreePage(long firstFreePage)
The first free page in unused secondary space

Parameters:
firstFreePage - the new first free page

getFirstFreePage

public final long getFirstFreePage()
The first free page in unused secondary space

Returns:
the first free page

setLastFreePage

public final void setLastFreePage(long lastFreePage)
The last free page in unused secondary space

Parameters:
lastFreePage - sets the last free page

getLastFreePage

public final long getLastFreePage()
The last free page in unused secondary space

Returns:
the last free page

setPageHeaderSize

public final void setPageHeaderSize(byte pageHeaderSize)
Set the size of a page header.

Normally, 64 is sufficient.

Parameters:
pageHeaderSize - the new page header size

getPageHeaderSize

public final byte getPageHeaderSize()
Get the size of a page header.

Normally, 64 is sufficient

Returns:
the page header size

setMaxKeySize

public final void setMaxKeySize(short maxKeySize)
Set the maximum number of bytes a key can be.

Normally, 256 is good

Parameters:
maxKeySize - the new max key size

getMaxKeySize

public final short getMaxKeySize()
Get the maximum number of bytes.

Normally, 256 is good.

Returns:
max key size

incRecordCount

public final void incRecordCount()
Increment the number of records being managed by the file


decRecordCount

public final void decRecordCount()
Decrement the number of records being managed by the file


getRecordCount

public final long getRecordCount()
The number of records being managed by the file (not pages)

Returns:
the record count

getWorkSize

public final int getWorkSize()

JXSE