Class Operation<KEY,​VALUE>

    • Constructor Summary

      Constructors 
      Constructor Description
      Operation()
      Create a new operation with key and value set to null.
      Operation​(KEY key, VALUE value)
      Create a new operation with key and value set to the given parameters.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void delete()
      Delete this operation.
      protected abstract void doExecute()
      Implementing classes should implement this method.
      void execute()
      Execute this operation if delete() has not been called on it.
      KEY getKey()
      Return a unique identifier that allows for tracking of this operation.
      VALUE getValue()
      Return the value of this operation if it is successful.
      boolean isDeleted()
      Return if this operation is deleted.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Operation

        public Operation()
        Create a new operation with key and value set to null.
      • Operation

        public Operation​(KEY key,
                         VALUE value)
        Create a new operation with key and value set to the given parameters.
    • Method Detail

      • getValue

        public VALUE getValue()
        Return the value of this operation if it is successful. The null value is appropriate if this is a write operation where there is no data returned.
        Returns:
        VALUE of operation or null.
      • getKey

        public KEY getKey()
        Return a unique identifier that allows for tracking of this operation.
      • delete

        public void delete()
        Delete this operation. An operation structure typically has a lot of data associated with it. When a future operation obviates a previous operation that previous operation is not removed from the TransactionalNodeStore structure. Rather, its delete() method is called to release all unecessary data and mark the Operation as deleted. Deleted operations will not be executed when the TransactionalNodeStore is committed.
      • isDeleted

        public boolean isDeleted()
        Return if this operation is deleted.
      • execute

        public void execute()
        Execute this operation if delete() has not been called on it.
        Throws:
        java.lang.RuntimeException - or other unchecked exceptions to communicate failure.
      • doExecute

        protected abstract void doExecute()
        Implementing classes should implement this method. This is conditionally called by execute() if delete() has not been previously called.
        Throws:
        java.lang.RuntimeException - or other unchecked exceptions to communicate failure.