Class JobSchedulerKahaDBMetaData
java.lang.Object
org.apache.activemq.store.kahadb.AbstractKahaDBMetaData<JobSchedulerKahaDBMetaData>
org.apache.activemq.store.kahadb.scheduler.JobSchedulerKahaDBMetaData
- All Implemented Interfaces:
KahaDBMetaData<JobSchedulerKahaDBMetaData>
The KahaDB MetaData used to house the Index data for the KahaDB implementation
of a JobSchedulerStore.
-
Field Summary
Fields inherited from interface org.apache.activemq.store.kahadb.KahaDBMetaData
CLOSED_STATE, OPEN_STATE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this meta data object with the assigned parent JobSchedulerStore instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the index of JobScheduler instances that have been created and stored in the JobSchedulerStore instance.Gets the index used to track the number of reference to a Journal log file.Gets the index that contains the location tracking information for Jobs that have been removed from the index but whose add operation has yet to be removed from the Journal.getToken()intvoidFor 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.voidloadScheduler(Transaction tx, Map<String, JobSchedulerImpl> schedulers) Loads all the stored JobScheduler instances into the provided map.voidReads the serialized for of this object from the KadaDB PageFile and prepares it for use.voidwrite(DataOutput out) Writes the object into a serialized form which can be read back in again using the read method.Methods inherited from class org.apache.activemq.store.kahadb.AbstractKahaDBMetaData
getLastUpdateLocation, getPage, getState, setLastUpdateLocation, setPage, setState
-
Constructor Details
-
JobSchedulerKahaDBMetaData
Creates a new instance of this meta data object with the assigned parent JobSchedulerStore instance.- Parameters:
store- the store instance that owns this meta data.
-
-
Method Details
-
getToken
- Returns:
- the current value of the Scheduler store identification token.
-
getVersion
public int getVersion()- Returns:
- the current value of the version tag for this meta data instance.
-
getRemoveLocationTracker
Gets the index that contains the location tracking information for Jobs that have been removed from the index but whose add operation has yet to be removed from the Journal. The Journal log file where a remove command is written cannot be released until the log file with the original add command has also been released, otherwise on a log replay the scheduled job could reappear in the scheduler since its corresponding remove might no longer be present.- Returns:
- the remove command location tracker index.
-
getJournalRC
Gets the index used to track the number of reference to a Journal log file. A log file in the Journal can only be considered for removal after all the references to it have been released.- Returns:
- the journal log file reference counter index.
-
getJobSchedulers
Gets the index of JobScheduler instances that have been created and stored in the JobSchedulerStore instance.- Returns:
- the index of stored JobScheduler instances.
-
initialize
Description copied from interface:KahaDBMetaDataFor 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
Description copied from interface:KahaDBMetaDataInstructs 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.
-
loadScheduler
public void loadScheduler(Transaction tx, Map<String, JobSchedulerImpl> schedulers) throws IOExceptionLoads all the stored JobScheduler instances into the provided map.- Parameters:
tx- the Transaction under which the load operation should be executed.schedulers- a Map<String, JobSchedulerImpl> into which the loaded schedulers are stored.- Throws:
IOException- if an error occurs while performing the load operation.
-
read
Description copied from interface:KahaDBMetaDataReads 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
Description copied from interface:KahaDBMetaDataWrites 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.
-