org.netbeans.mdr.persistence.btreeimpl.btreestorage
Class FileHeader

java.lang.Object
  extended by org.netbeans.mdr.persistence.btreeimpl.btreestorage.FileHeader

public class FileHeader
extends java.lang.Object

Files stored in the FileCache must start with this header; it contains information used by the logging system. The client of the cache should assume that the first 64 bytes of the file are reserved (64 to allow for growth). All files stored in the cache are committed together, and should always have identical file headers.


Field Summary
static int HEADER_SIZE
          The size of the header
 
Method Summary
 void addFiles(java.lang.String[] names, int size, boolean replace)
          Create new files with a given header
static FileHeader createFiles(java.lang.String[] names, int size, boolean replace)
          Create a set of files with a common header
 boolean equals(java.lang.Object o)
          test for equality with another FileHeader
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_SIZE

public static final int HEADER_SIZE
The size of the header

See Also:
Constant Field Values
Method Detail

addFiles

public void addFiles(java.lang.String[] names,
                     int size,
                     boolean replace)
              throws StorageException
Create new files with a given header

Parameters:
names - the names of the files
size - if greater than 0, the size to make the files
replace - if true, replace existing files. if false, throw an exception if any of the files exists
Throws:
StorageException - I/O error creating the files or "replace" was false, and a file already exists

createFiles

public static FileHeader createFiles(java.lang.String[] names,
                                     int size,
                                     boolean replace)
                              throws StorageException
Create a set of files with a common header

Parameters:
names - the names of the files
size - if greater than 0, the size to make the files
replace - if true, replace existing files. if false, throw an exception if any of the files exists
Returns:
the header used to create the files
Throws:
StorageException - I/O error creating the files or "replace" was false, and a file already exists

equals

public boolean equals(java.lang.Object o)
test for equality with another FileHeader

Overrides:
equals in class java.lang.Object
Parameters:
equals - compare for equality with this


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.