Class JobSchedulerKahaDBMetaData

    • Constructor Detail

      • JobSchedulerKahaDBMetaData

        public JobSchedulerKahaDBMetaData​(JobSchedulerStoreImpl store)
        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 Detail

      • getToken

        public UUID 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

        public BTreeIndex<Integer,​List<Integer>> 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

        public BTreeIndex<Integer,​Integer> 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

        public BTreeIndex<String,​JobSchedulerImpl> 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

        public void initialize​(Transaction tx)
                        throws IOException
        Description copied from interface: KahaDBMetaData
        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

        public void load​(Transaction tx)
                  throws IOException
        Description copied from interface: KahaDBMetaData
        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.
      • loadScheduler

        public void loadScheduler​(Transaction tx,
                                  Map<String,​JobSchedulerImpl> schedulers)
                           throws IOException
        Loads all the stored JobScheduler instances into the provided map.
        Parameters:
        tx - the Transaction under which the load operation should be executed.
        schedulers - a Map into which the loaded schedulers are stored.
        Throws:
        IOException - if an error occurs while performing the load operation.
      • read

        public void read​(DataInput in)
                  throws IOException
        Description copied from interface: KahaDBMetaData
        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

        public void write​(DataOutput out)
                   throws IOException
        Description copied from interface: KahaDBMetaData
        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.