Servertec
Persistent Object Store
1.4.1 09/04/2005

stec.xpos
Class Index

java.lang.Object
  extended by stec.xpos.Index

public final class Index
extends java.lang.Object

Contains static methods used to create, delete, open, expand and pack indexes.

Servertec Indexes are modified B-*trees, where non primitive key, value objects are for efficiency stored in secondary files.

Each index physically exists in two (2) or more physical random access files, Base, .keys.index, .keys.store, .values.store and .values.index. The Base file contains a header and volume descriptors for .keys.index, .keys.store, .values.store and .values.index volume files. The .keys.index file contains a header, zero (0) or more index pages containing encoded keys and associated values and zero (0) or more freed index pages. The .keys.store is used when the key objects are non primitive values and contains a header, zero (0) or more pages containing key objects and zero (0) or more freed pages. The .values.store is used when the value objects are non primitive values and contains a header, zero (0) or more pages containing value objects and zero (0) or more freed pages. The .values.index is used for duplicate values and contains a header, zero (0) or more index pages containing encoded values and zero (0) or more freed pages.

Volume Header

1 byte - type - the file type. Currently 0x00 for Volume.
2 bytes - version - the version number. Currently 0x0100 (1.0.0).
4 byte - index_volume_count - the number of index volumes. one (1) or more.
n bytes - index_volume_descriptors - one (1) or more index volume descriptors.
4 byte - keys_store_volume_count - the number of keys store volumes. one (1) or more. Used when the key objects are non primitive values.
n bytes - keys_store_volume_descriptors - one (1) or more keys store volume descriptors. Used when the key objects are non primitive values.
4 byte - values_index_volume_count - the number of values index volumes. one (1) or more. Used for duplicate values.
n bytes - values_index_volume_descriptors - one (1) or more values index volume descriptors. Used for duplicate values.
4 byte - values_store_volume_count - the number of values store volumes. one (1) or more. Used when the value objects are non primitive values.
n bytes - values_store_volume_descriptors - one (1) or more values store volume descriptors. Used when the value objects are non primitive values.

Volume Descriptor

n bytes - volume_filename - the utf8 encoded file name of the volume file.
8 bytes - maximum_page_count - the maximum number of pages that can be allocated. 1 or more. -1 for unlimited.

.keys.index Header

1 byte - type - the file type. Currently 0x0b for .keys.index.
2 bytes - version - the version number. Currently 0x0100 (1.0.0).
1 byte - flags - 0x01 specifies whether to allow multiple duplicate sorted values and 0x02 specifies whether to sort keys in ascending or descending order.
1 byte - key_type - specifies the data type used when encoding key objects. See Key Data Types
4 bytes - key_length - the number of bytes that a key object requires. See Key Data Types
1 byte - value_type - specifies the data type used when encoding value objects. See Value Data Types
4 bytes - value_length - the number of bytes that a value object requires. See Value Data Types
4 bytes - order - the order. Each index page will contain twice the number of entries.
8 bytes - maximum_page_count - the maximum number of pages that can be allocated. 1 or more. -1 for unlimited.
8 bytes - page_count - the number of index pages currently in use or free. 0 or more.
8 bytes - root_page_number - the page number of the root page. -1 if none.
8 bytes - free_count - the number of free index pages. 0 or more.
8 bytes - free_list - pointer to first free index page. -1 if none.
8 bytes - total_entry_count - the total number of entries in the index. 0 or more.
n bytes - key_class_name - the UTF-8 encoded class name of the key object.
n bytes - value_class_name - the UTF-8 encoded class name of the value object.
n bytes - collator_class_name - the UTF-8 encoded class name of the collator object.

Key Data Types:

Object Size Data Type
null10x00
Byte10x01
Character20x02
Short20x03
Integer40x04
Long80x05
Float40x06
Double80x07
String120x08
Object120x09
Blob120x0B
Date80x0C
BigInteger120x0D
BigDecimal120x0E
byte[]120x0F

Value Data Types:

Object Size Data Type
null10x00
Byte10x01
Character20x02
Short20x03
Integer40x04
Long80x05
Float40x06
Double80x07
String120x08
Object120x09
Boolean10x0A
Blob120x0B
Date80x0C
BigInteger120x0D
BigDecimal120x0E
byte[]120x0F
Duplicates12-1

Primitives

java.lang.Byte
java.lang.Character
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.lang.Boolean
java.util.Date

Each index page is composed of a header and entry area of size 13 + ((8 + key_length + value_length) * (order * 2)) as specified above.

.keys.index Page

1 byte - flags - flags used to specify whether the index page is in use or has been freed. 1 for in use and 0 for free.
8 bytes - next_index_page - pointer to any index page that follows. -1 if none.
4 bytes - entry_count - the number of entries in use. 1 if none.
n bytes - entries - the encoded key, value pairs.

.keys.index Entry

8 bytes - previous_index_page - pointer to any previous index page. -1 if none.
n bytes - key - the encoded key. 4 bytes for the object length and 8 bytes for the base record number in the keys store for non primitive keys. See Key Data Types.
n bytes - value - the encoded value. 4 bytes for the object length and 8 bytes for the base record number in the values store for non primitive values. 4 bytes for the value count and 8 bytes for the base record number in the values index for duplicate values. See Value Data Types.

Non primitive values are stored seperately into one (1) or more fixed length data pages.

Once a key or associated value is changed or removed, pages no longer used are linked to the beginning of the free_list as defined in the above header.

keys.store and values.store Header

1 byte - type - the file type. Currently 0x0c for keys.store and values.store.
2 bytes - version - the version number. Currently 0x0100 (1.0.0).
4 bytes - page_length - the size in bytes of the average page as specified when the index was created.
8 bytes - maximum_page_count - the maximum number of pages that can be allocated. 1 or more. -1 for unlimited.
8 bytes - free_count - the number of free data pages. 0 or more.
8 bytes - free_list - pointer to first free data page. -1 if none.
8 bytes - page_count - the number of data pages currently in use or free. 0 or more.
8 bytes - record_count - the number of objects. 0 or more.

Each data page is composed of a header and data area of size page_length as specified in the above header.

keys.store and values.store Data Page

1 byte - flags - flags used to specify whether the data page is in use or has been freed. 1 for in use and 0 for free.
8 bytes - next_data_page - pointer to any data page that follows. -1 if none.
n bytes - entry - the encoded object mapped to fixed data page of page_length as specified in the header.

Non primitive objects are stored in one (1) or more fixed length data pages.

Once a an object is changed or removed, data pages no longer used are linked to the beginning of the free_list as defined in the above header.

.values.index Header

1 byte - type - the file type. Currently 0x0d for .values.index.
2 bytes - version - the version number. Currently 0x0100 (1.0.0).
1 byte - flags - 0x02 specifies whether to sort duplicate values in ascending or descending order.
1 byte - value_type - specifies the data type used when encoding value objects. See Value Data Types
4 bytes - value_length - the number of bytes that a value object requires. See Value Data Types
4 bytes - order - the order. Each index page will contain twice the number of entries.
8 bytes - maximum_page_count - the maximum number of pages that can be allocated. 1 or more. -1 for unlimited.
8 bytes - page_count - the number of index pages currently in use or free. 0 or more.
8 bytes - free_count - the number of free index pages. 0 or more.
8 bytes - free_list - pointer to first free index page. -1 if none.

Value Data Types:

Object Size Data Type
null10x00
Byte10x01
Character20x02
Short20x03
Integer40x04
Long80x05
Float40x06
Double80x07
String120x08
Object120x09
Boolean10x0A
Blob120x0B
Date80x0C
BigInteger120x0D
BigDecimal120x0E
byte[]120x0F

Primitives

java.lang.Byte
java.lang.Character
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.lang.Boolean
java.util.Date

Each index page is composed of a header and entry area of size 13 + ((8 + value_length) * (order * 2)) as specified above.

.values.index Page

1 byte - flags - flags used to specify whether the index page is in use or has been freed. 1 for in use and 0 for free.
8 bytes - next_index_page - pointer to any index page that follows. -1 if none.
4 bytes - entry_count - the number of entries in use. 1 if none.
n bytes - entries - the encoded values.

.values.index Entry

8 bytes - previous_index_page - pointer to any previous index page. -1 if none.
n bytes - value - the encoded value. 4 bytes for the object length and 8 bytes for the base record number in the values store for non primitive values. See Value Data Types.

Non primitive values are stored seperately into one (1) or more fixed length data pages.

Once a value is changed or removed, pages no longer used are linked to the beginning of the free_list as defined in the above header.

Limits

In general Indexes are limited by size of signed long (64-1 bits).

Limit Size
Maximum Number of Pages in Index 264-1
Maximum Number of Pages in Keys Store 264-1
Maximum Number of Pages in Values Store 264-1
Maximum Number of Pages in Duplicate Values Index 264-1
Maximum Number of Pages in Duplicate Values Index Values Store 264-1
Maximum Number of Volumes Containing Index 232-1
Maximum Number of Volumes Containing Keys Store 232-1
Maximum Number of Volumes Containing Values Store 232-1
Maximum Number of Volumes Containing Duplicate Values Index 232-1
Maximum Number of Volumes Containing Duplicate Values Store 232-1
Maximum Number of Keys 264-1
Maximum Number of Values 264-1
Maximum Number of Duplicate Values 232-1
Maximum Size of Key 232-1
Maximum Size of Value 232-1
Maximum File Size of Index File Platform/Java VM Specific
Maximum File Size of Keys Store File Platform/Java VM Specific
Maximum File Size of Values Store File Platform/Java VM Specific
Maximum Number of Open Indexes Platform/Java VM Specific
Number of File Handles Per Opened Index At least 1

Locking

Object locking is at a per stec.xpos.IndexReference basis with each index maintaining its own in-memory lock table. When an IndexReference is closed all its locks are released.

Multi-Threading

Each thread should have its own stec.xpos.IndexReference that is not shared with other threads.

Internally stec.xpos.IndexReference operations block other threads from accessing the single instance to the index.

Since:
1.1.0 09/01/2002
See Also:
ByteArray

Field Summary
static boolean displayLogo
           
 
Constructor Summary
Index()
           
 
Method Summary
static void copy(java.lang.String from_filename, java.lang.String to_filename, boolean overwrite)
          Copies the specified extended Index.
static void create(java.lang.String filename, int order, long index_maximum_page_count, java.lang.String key_class_name, int keys_store_page_length, long keys_store_maximum_page_count, java.lang.String value_class_name, int values_store_page_length, long values_store_maximum_page_count, java.lang.String collator_class_name, boolean overwrite, boolean ascending, boolean duplicates, int values_order, long values_index_maximum_page_count, java.lang.String values_collator_class_name, boolean values_ascending)
          Used to create a new index or to overwrite an existing index.
static void create(java.lang.String filename, int order, long index_maximum_page_count, java.lang.String key_class_name, int keys_store_page_length, long keys_store_maximum_page_count, java.lang.String value_class_name, int values_store_page_length, long values_store_maximum_page_count, java.lang.String collator_class_name, boolean overwrite, boolean ascending, boolean duplicates, int values_order, long values_index_maximum_page_count, java.lang.String values_collator_class_name, boolean values_ascending, int volume_count)
          Used to create a new index or to overwrite an existing index.
static void create(java.lang.String filename, int order, VolumeDescriptor[] index_descriptors, java.lang.String key_class_name, int keys_store_page_length, VolumeDescriptor[] keys_store_descriptors, java.lang.String value_class_name, int values_store_page_length, VolumeDescriptor[] values_store_descriptors, java.lang.String collator_class_name, boolean overwrite, boolean ascending, boolean duplicates, int values_order, VolumeDescriptor[] values_index_descriptors, java.lang.String values_collator_class_name, boolean values_ascending)
          Used to create a new index or to overwrite an existing index.
static void create(java.lang.String filename, java.lang.String key_class_name, int keys_store_page_length, java.lang.String value_class_name, int values_store_page_length, boolean overwrite)
          Used to create a new index or to overwrite an existing index.
static void delete(java.lang.String filename)
          Deletes the specified index.
static boolean exists(java.lang.String filename)
          Returns whether the specified index currently exists.
static void expand(java.lang.String filename, long index_maximum_page_count, long keys_store_maximum_page_count, long values_store_maximum_page_count, long values_index_maximum_page_count)
          Changes the maximum number of pages that the support files and/or index can grow to.
static void expand(java.lang.String filename, VolumeDescriptor[] new_index_descriptors, VolumeDescriptor[] new_keys_store_descriptors, VolumeDescriptor[] new_values_store_descriptors, VolumeDescriptor[] new_values_index_descriptors)
          Appends the specified index, keys store, values store, values index and values store volumes to the specified index.
static boolean inUse(java.lang.String filename)
          Returns whether the specified Index is being used.
static void move(java.lang.String from_filename, java.lang.String to_filename, boolean overwrite)
          Moves the specified extended Index.
static IndexReference open(java.lang.String filename, boolean exclusive)
          Opens the specified index and returns a stec.xpos.IndexReference to it.
static void pack(java.lang.String filename)
          Releases unused space at the end of the specified index back to the operating system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

displayLogo

public static boolean displayLogo
Constructor Detail

Index

public Index()
Method Detail

create

public static final void create(java.lang.String filename,
                                java.lang.String key_class_name,
                                int keys_store_page_length,
                                java.lang.String value_class_name,
                                int values_store_page_length,
                                boolean overwrite)
                         throws java.lang.IllegalArgumentException,
                                java.io.IOException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalAccessException,
                                java.lang.InstantiationException
Used to create a new index or to overwrite an existing index.

Parameters:
filename - the path and base file name of the index to create.
key_class_name - the class name for key objects. For example java.lang.Integer
keys_store_page_length - the size in bytes of a keys store page. Used when the key is a not a primitive object.
value_class_name - the class name for value objects. For example java.lang.Integer
values_store_page_length - the size in bytes of a values store page. Used when the value is a not a primitive object.
overwrite - whether to overwrite any existing indexes.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.IOException - if the index is in use, already exists or cannot be created or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name or the value_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name or the value_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name or the value_class_name cannot be instantiated because it is an interface or an abstract class.
See Also:
create, create, create

create

public static final void create(java.lang.String filename,
                                int order,
                                long index_maximum_page_count,
                                java.lang.String key_class_name,
                                int keys_store_page_length,
                                long keys_store_maximum_page_count,
                                java.lang.String value_class_name,
                                int values_store_page_length,
                                long values_store_maximum_page_count,
                                java.lang.String collator_class_name,
                                boolean overwrite,
                                boolean ascending,
                                boolean duplicates,
                                int values_order,
                                long values_index_maximum_page_count,
                                java.lang.String values_collator_class_name,
                                boolean values_ascending)
                         throws java.lang.IllegalArgumentException,
                                java.io.IOException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalAccessException,
                                java.lang.InstantiationException
Used to create a new index or to overwrite an existing index.

Parameters:
filename - the path and base file name of the index to create.
order - the order. Each index page will contain twice the number of entries. -1 to have POS calculate the value.
index_maximum_page_count - the maximum number of index pages. -1 for unlimited.
key_class_name - the class name for key objects. For example java.lang.Integer
keys_store_page_length - the size in bytes of a keys store page. Used when the key is a not a primitive object.
keys_store_maximum_page_count - the maximum number of keys store pages. -1 for unlimited. Used when the key is a not a primitive object.
value_class_name - the class name for value objects. For example java.lang.Integer
values_store_page_length - the size in bytes of a values store page. Used when the value is a not a primitive object.
values_store_maximum_page_count - the maximum number of values store pages. -1 for unlimited. Used when the value is a not a primitive object.
collator_class_name - the class name of the key collator. null for the default collator.
overwrite - whether to overwrite any existing indexes.
ascending - whether to sort keys in ascending or descending order.
duplicates - whether to allow multiple duplicate sorted values.
values_order - the order used for duplicate values. Each duplicate values index page will contain twice the number of entries. -1 to have POS calculate the value. Used when storing duplicate values.
values_index_maximum_page_count - the maximum number of duplicate values index pages. -1 for unlimited. Used when storing duplicate values.
values_collator_class_name - the class name of the duplicate values collator. Used when storing duplicate values. null for the default collator.
values_ascending - whether to sort duplicate values in ascending or descending order. Used when storing duplicate values.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.IOException - if the index is in use, already exists or cannot be created or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.
See Also:
create, create, create

create

public static final void create(java.lang.String filename,
                                int order,
                                long index_maximum_page_count,
                                java.lang.String key_class_name,
                                int keys_store_page_length,
                                long keys_store_maximum_page_count,
                                java.lang.String value_class_name,
                                int values_store_page_length,
                                long values_store_maximum_page_count,
                                java.lang.String collator_class_name,
                                boolean overwrite,
                                boolean ascending,
                                boolean duplicates,
                                int values_order,
                                long values_index_maximum_page_count,
                                java.lang.String values_collator_class_name,
                                boolean values_ascending,
                                int volume_count)
                         throws java.lang.IllegalArgumentException,
                                java.io.IOException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalAccessException,
                                java.lang.InstantiationException
Used to create a new index or to overwrite an existing index.

Parameters:
filename - the path and base file name of the index to create.
order - the order. Each index page will contain twice the number of entries. -1 to have POS calculate the value.
index_maximum_page_count - the maximum number of index pages. -1 for unlimited.
key_class_name - the class name for key objects. For example java.lang.Integer
keys_store_page_length - the size in bytes of a keys store page. Used when the key is a not a primitive object.
keys_store_maximum_page_count - the maximum number of keys store pages. -1 for unlimited. Used when the key is a not a primitive object.
value_class_name - the class name for value objects. For example java.lang.Integer
values_store_page_length - the size in bytes of a values store page. Used when the value is a not a primitive object.
values_store_maximum_page_count - the maximum number of values store pages. -1 for unlimited. Used when the value is a not a primitive object.
collator_class_name - the class name of the key collator. null for the default collator.
overwrite - whether to overwrite any existing indexes.
ascending - whether to sort keys in ascending or descending order.
duplicates - whether to allow multiple duplicate sorted values.
values_order - the order used for duplicate values. Each duplicate values index page will contain twice the number of entries. -1 to have POS calculate the value. Used when storing duplicate values.
values_index_maximum_page_count - the maximum number of duplicate values index pages. -1 for unlimited. Used when storing duplicate values.
values_collator_class_name - the class name of the duplicate values collator. Used when storing duplicate values. null for the default collator.
values_ascending - whether to sort duplicate values in ascending or descending order. Used when storing duplicate values.
volume_count - the number of volume files to create. 1 or more.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.IOException - if the index is in use, already exists or cannot be created or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.
See Also:
create, create, create

create

public static final void create(java.lang.String filename,
                                int order,
                                VolumeDescriptor[] index_descriptors,
                                java.lang.String key_class_name,
                                int keys_store_page_length,
                                VolumeDescriptor[] keys_store_descriptors,
                                java.lang.String value_class_name,
                                int values_store_page_length,
                                VolumeDescriptor[] values_store_descriptors,
                                java.lang.String collator_class_name,
                                boolean overwrite,
                                boolean ascending,
                                boolean duplicates,
                                int values_order,
                                VolumeDescriptor[] values_index_descriptors,
                                java.lang.String values_collator_class_name,
                                boolean values_ascending)
                         throws java.lang.IllegalArgumentException,
                                java.io.IOException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalAccessException,
                                java.lang.InstantiationException
Used to create a new index or to overwrite an existing index.

Parameters:
filename - the path and base file name of the index to create.
order - the order. Each index page will contain twice the number of entries. -1 to have POS calculate the value.
index_descriptors - an array of one (1) or more VolumeDescriptors defining the keys index.
key_class_name - the class name for key objects. For example java.lang.Integer
keys_store_page_length - the size in bytes of a keys store page. Used when the key is a not a primitive object.
keys_store_descriptors - an array of one (1) or more VolumeDescriptors defining the keys store. Used when the key is a not a primitive object.
value_class_name - the class name for value objects. For example java.lang.Integer
values_store_page_length - the size in bytes of a values store page. Used when the value is a not a primitive object.
values_store_descriptors - an array of one (1) or more VolumeDescriptors defining the values store. Used when the key is a not a primitive object.
collator_class_name - the class name of the key collator. null for the default collator.
overwrite - whether to overwrite any existing indexes.
ascending - whether to sort keys in ascending or descending order.
duplicates - whether to allow multiple duplicate sorted values.
values_order - the order used for duplicate values. Each duplicate values index page will contain twice the number of entries. -1 to have POS calculate the value. Used when storing duplicate values.
values_index_descriptors - an array of one (1) or more VolumeDescriptors defining the values index. Used when storing duplicate values.
values_collator_class_name - the class name of the duplicate values collator. Used when storing duplicate values. null for the default collator.
values_ascending - whether to sort duplicate values in ascending or descending order. Used when storing duplicate values.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.IOException - if the index is in use, already exists or cannot be created or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.
See Also:
create, create, create

exists

public static final boolean exists(java.lang.String filename)
                            throws java.io.IOException
Returns whether the specified index currently exists.

Parameters:
filename - the path and base file name of the index to test.
Returns:
whether the specified index currently exists.
Throws:
java.io.IOException - if an I/O exception occurred.

delete

public static final void delete(java.lang.String filename)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
Deletes the specified index.

Parameters:
filename - the path and base file name of the index to delete.
Throws:
java.io.FileNotFoundException - if the index does not exist.
java.io.IOException - if the index is in use or cannot be deleted or if an I/O exception occurred.
See Also:
create, create, create, create

open

public static final IndexReference open(java.lang.String filename,
                                        boolean exclusive)
                                 throws java.io.FileNotFoundException,
                                        java.lang.ClassNotFoundException,
                                        java.lang.IllegalAccessException,
                                        java.lang.InstantiationException,
                                        java.io.IOException
Opens the specified index and returns a stec.xpos.IndexReference to it.

Parameters:
filename - the path and base file name of the index to open.
exclusive - whether to open the index reference for exclusive use.
Returns:
the stec.xpos.IndexReference to the index.
Throws:
java.io.FileNotFoundException - if the index does not exist.
java.io.IOException - if the index is exclusively opened or cannot be opened or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.
See Also:
IndexReference, close

pack

public static final void pack(java.lang.String filename)
                       throws java.io.FileNotFoundException,
                              java.lang.ClassNotFoundException,
                              java.lang.IllegalAccessException,
                              java.lang.InstantiationException,
                              java.io.IOException
Releases unused space at the end of the specified index back to the operating system.

Packing a large index may take a long time.

Java 1.2.0 or later is required to change the physical size of the index and support files.

Parameters:
filename - the path and base file name of the index to pack.
Throws:
java.io.FileNotFoundException - if the index does not exist.
java.io.IOException - if the index is in use or cannot be packed or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.

expand

public static final void expand(java.lang.String filename,
                                long index_maximum_page_count,
                                long keys_store_maximum_page_count,
                                long values_store_maximum_page_count,
                                long values_index_maximum_page_count)
                         throws java.lang.IllegalArgumentException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalAccessException,
                                java.lang.InstantiationException,
                                java.io.FileNotFoundException,
                                java.io.IOException
Changes the maximum number of pages that the support files and/or index can grow to.

Parameters:
filename - the path and base file name of the index to expand.
index_maximum_page_count - the maximum number of index pages. -1 for unlimited.
keys_store_maximum_page_count - the maximum number of keys store pages. -1 for unlimited. Used when the key is a not a primitive object.
values_store_maximum_page_count - the maximum number of values store pages. -1 for unlimited. Used when the value is a not a primitive object.
values_index_maximum_page_count - the maximum number of duplicate values index pages. -1 for unlimited. Used when storing duplicate values.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.FileNotFoundException - if the store does not exist.
java.io.IOException - if the store is in use or cannot be expanded or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.

expand

public static final void expand(java.lang.String filename,
                                VolumeDescriptor[] new_index_descriptors,
                                VolumeDescriptor[] new_keys_store_descriptors,
                                VolumeDescriptor[] new_values_store_descriptors,
                                VolumeDescriptor[] new_values_index_descriptors)
                         throws java.lang.InstantiationException,
                                java.lang.IllegalAccessException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalArgumentException,
                                java.io.FileNotFoundException,
                                java.io.IOException
Appends the specified index, keys store, values store, values index and values store volumes to the specified index.

Parameters:
filename - the path and base file name of the index to expand.
new_index_descriptors - an array of one (1) or more VolumeDescriptors defining the new indexes volumes. null if not expanding the indexes volumes.
new_keys_store_descriptors - an array of one (1) or more VolumeDescriptors defining the new keys store volumes. null if not expanding the keys store volumes. Used when the key is a not a primitive object.
new_values_store_descriptors - an array of one (1) or more VolumeDescriptors defining the new values store volumes. null if not expanding the values store volumes. Used when the value is a not a primitive object.
new_values_index_descriptors - an array of one (1) or more VolumeDescriptors defining the new values indexes volumes. null if not expanding the values indexes volumes. Used when storing duplicate values.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.FileNotFoundException - if the store does not exist.
java.io.IOException - if the store is in use or cannot be expanded or if an I/O exception occurred.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.

inUse

public static final boolean inUse(java.lang.String filename)
                           throws java.io.IOException
Returns whether the specified Index is being used.

Parameters:
filename - the path and base file name of the Index to test.
Returns:
whether the specified Index is being used.
Throws:
java.io.IOException - if an I/O exception occurred.

copy

public static final void copy(java.lang.String from_filename,
                              java.lang.String to_filename,
                              boolean overwrite)
                       throws java.lang.IllegalArgumentException,
                              java.io.FileNotFoundException,
                              java.io.IOException,
                              java.lang.ClassNotFoundException,
                              java.lang.IllegalAccessException,
                              java.lang.InstantiationException
Copies the specified extended Index.

Parameters:
from_filename - the path and base file name of the extended Index to copy.
to_filename - the path and base file name of the extended Index to copy to.
overwrite - whether to overwrite any existing extended Index.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.FileNotFoundException - if the extended Index does not exist.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.
java.io.IOException - if the extended Index is in use or cannot be copied or if an I/O exception occurred.
Since:
1.2.2 03/03/2003

move

public static final void move(java.lang.String from_filename,
                              java.lang.String to_filename,
                              boolean overwrite)
                       throws java.lang.IllegalArgumentException,
                              java.io.FileNotFoundException,
                              java.io.IOException,
                              java.lang.ClassNotFoundException,
                              java.lang.IllegalAccessException,
                              java.lang.InstantiationException
Moves the specified extended Index.

Parameters:
from_filename - the path and base file name of the extended Index to move.
to_filename - the path and base file name of the extended Index to move to.
overwrite - whether to overwrite any existing extended Index.
Throws:
java.lang.IllegalArgumentException - if any of the parameters specified were not valid.
java.io.FileNotFoundException - if the extended Index does not exist.
java.lang.ClassNotFoundException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be found.
java.lang.IllegalAccessException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be loaded because the class is not public or is in another package.
java.lang.InstantiationException - if the key_class_name, the value_class_name, the collator_class_name or the values_collator_class_name cannot be instantiated because it is an interface or an abstract class.
java.io.IOException - if the extended Index is in use or cannot be moved or if an I/O exception occurred.
Since:
1.2.2 03/03/2003

Servertec
Persistent Object Store
1.4.1 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.