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

      Fields 
      Modifier and Type Field Description
      static int CLOSED_STATE
      Indicates that this meta data instance has been closed and is no longer active.
      static int OPEN_STATE
      Indicates that this meta data instance has been opened and is active.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Location getLastUpdateLocation()
      Returns the Journal Location value that indicates that last recorded update that was successfully performed for this KahaDB store implementation.
      Page<T> getPage()
      Gets the Page in the store PageFile where the KahaDBMetaData instance is stored.
      int getState()
      Gets the state flag of this meta data instance.
      void initialize​(Transaction tx)
      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.
      void load​(Transaction tx)
      Instructs this object to load its internal data structures from the KahaDB PageFile and prepare itself for use.
      void read​(DataInput in)
      Reads the serialized for of this object from the KadaDB PageFile and prepares it for use.
      void setLastUpdateLocation​(Location location)
      Updates the value of the last successful update.
      void setPage​(Page<T> page)
      Sets the Page instance used to load and store the KahaDBMetaData instance.
      void setState​(int value)
      Sets the current value of the state flag.
      void write​(DataOutput out)
      Writes the object into a serialized form which can be read back in again using the read method.
    • Field Detail

      • OPEN_STATE

        static final int OPEN_STATE
        Indicates that this meta data instance has been opened and is active.
        See Also:
        Constant Field Values
      • CLOSED_STATE

        static final int CLOSED_STATE
        Indicates that this meta data instance has been closed and is no longer active.
        See Also:
        Constant Field Values
    • Method Detail

      • getPage

        Page<T> 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

        void setPage​(Page<T> page)
        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

        void setLastUpdateLocation​(Location location)
        Updates the value of the last successful update.
        Parameters:
        location - the new value to assign the last update location field.
      • initialize

        void initialize​(Transaction tx)
                 throws IOException
        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

        void load​(Transaction tx)
           throws IOException
        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

        void read​(DataInput in)
           throws IOException
        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

        void write​(DataOutput out)
            throws IOException
        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.