Package org.apache.activemq.store.kahadb
Interface KahaDBMetaData<T>
- All Known Implementing Classes:
AbstractKahaDBMetaData,JobSchedulerKahaDBMetaData
public interface KahaDBMetaData<T>
Interface for the store meta data used to hold the index value and other needed
information to manage a KahaDB store instance.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates that this meta data instance has been closed and is no longer active.static final intIndicates that this meta data instance has been opened and is active. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Journal Location value that indicates that last recorded update that was successfully performed for this KahaDB store implementation.getPage()Gets the Page in the store PageFile where the KahaDBMetaData instance is stored.intgetState()Gets the state flag of this meta data instance.voidFor a newly created KahaDBMetaData instance this method is called to allow the instance to create all of it's internal indices and other state data.voidload(Transaction tx) Instructs this object to load its internal data structures from the KahaDB PageFile and prepare itself for use.voidReads the serialized for of this object from the KadaDB PageFile and prepares it for use.voidsetLastUpdateLocation(Location location) Updates the value of the last successful update.voidSets the Page instance used to load and store the KahaDBMetaData instance.voidsetState(int value) Sets the current value of the state flag.voidwrite(DataOutput out) Writes the object into a serialized form which can be read back in again using the read method.
-
Field Details
-
OPEN_STATE
static final int OPEN_STATEIndicates that this meta data instance has been opened and is active.- See Also:
-
CLOSED_STATE
static final int CLOSED_STATEIndicates that this meta data instance has been closed and is no longer active.- See Also:
-
-
Method Details
-
getPage
Gets the Page in the store PageFile where the KahaDBMetaData instance is stored.- Returns:
- the Page to use to start access the KahaDBMetaData instance.
-
setPage
Sets the Page instance used to load and store the KahaDBMetaData instance.- Parameters:
page- the new Page value to use.
-
getState
int getState()Gets the state flag of this meta data instance.- Returns:
- the current state value for this instance.
-
setState
void setState(int value) Sets the current value of the state flag.- Parameters:
value- the new value to assign to the state flag.
-
getLastUpdateLocation
Location getLastUpdateLocation()Returns the Journal Location value that indicates that last recorded update that was successfully performed for this KahaDB store implementation.- Returns:
- the location of the last successful update location.
-
setLastUpdateLocation
Updates the value of the last successful update.- Parameters:
location- the new value to assign the last update location field.
-
initialize
For a newly created KahaDBMetaData instance this method is called to allow the instance to create all of it's internal indices and other state data.- Parameters:
tx- the Transaction instance under which the operation is executed.- Throws:
IOException- if an error occurs while creating the meta data structures.
-
load
Instructs this object to load its internal data structures from the KahaDB PageFile and prepare itself for use.- Parameters:
tx- the Transaction instance under which the operation is executed.- Throws:
IOException- if an error occurs while creating the meta data structures.
-
read
Reads the serialized for of this object from the KadaDB PageFile and prepares it for use. This method does not need to perform a full load of the meta data structures only read in the information necessary to load them from the PageFile on a call to the load method.- Parameters:
in- the DataInput instance used to read this objects serialized form.- Throws:
IOException- if an error occurs while reading the serialized form.
-
write
Writes the object into a serialized form which can be read back in again using the read method.- Parameters:
out- the DataOutput instance to use to write the current state to a serialized form.- Throws:
IOException- if an error occurs while serializing this instance.
-