Class AbstractPersistenceManager.AbstractPersistentStore.BatchTask

    • Constructor Detail

      • BatchTask

        public BatchTask​(Object oToken,
                         Collector<Object> collector,
                         Object oReceipt)
        Create a new BatchTask.
        Parameters:
        oToken - a token that represents the atomic unit to commit
        collector - an optional Collector to notify
        oReceipt - the receipt to add to the Collector after the unit is committed
    • Method Detail

      • store

        public void store​(long lExtentId,
                          ReadBuffer bufKey,
                          ReadBuffer bufValue)
        Queue a store operation.
        Parameters:
        lExtentId - the extent identifier for the key
        bufKey - key to store the value under
        bufValue - value to be stored
      • erase

        public void erase​(long lExtentId,
                          ReadBuffer bufKey)
        Queue an erase operation.
        Parameters:
        lExtentId - the extent identifier for the key
        bufKey - key whose mapping is to be removed
      • abort

        public void abort​(Throwable eCause)
        Abort all changes that have been made to the persistent store by this BatchTask.
        Parameters:
        eCause - optional cause for the abort
      • getAssociatedKey

        public Object getAssociatedKey()
        Determine the host key (or base) object to which this object is associated.

        Note: It's expected that the returned object is suitable to be used as an immutable identity (e.g. a key in a Map).
        Note 2: Circular associations are not permitted.

        Specified by:
        getAssociatedKey in interface Associated
        Returns:
        the host key that for this object, or null if this object has no association
      • notifyCollector

        protected void notifyCollector​(Object oItem,
                                       boolean fFlush)
        Add the given object to the configured collector (if any). If the add operation throws an exception, it will be caught and logged.
        Parameters:
        oItem - the item to add
        fFlush - if true, the collector will be flushed after adding the item