Class ReplicaPushRequest

    • Constructor Detail

      • ReplicaPushRequest

        public ReplicaPushRequest​(KetchReplica replica,
                                  Collection<ReceiveCommand> commands)
        Construct a new push request for a replica.
        Parameters:
        replica - the replica being pushed to.
        commands - commands to be executed.
    • Method Detail

      • getCommands

        public Collection<ReceiveCommand> getCommands()
        Get commands to be executed, and their results.
        Returns:
        commands to be executed, and their results.
      • getRefs

        @Nullable
        public Map<String,​Ref> getRefs()
        Get remote references, usually from the advertisement.
        Returns:
        remote references, usually from the advertisement.
      • setRefs

        public void setRefs​(Map<String,​Ref> refs)
        Set references observed from the replica.
        Parameters:
        refs - references observed from the replica.
      • getException

        @Nullable
        public Throwable getException()
        Get exception thrown, if any.
        Returns:
        exception thrown, if any.
      • setException

        public void setException​(@Nullable
                                 Repository repo,
                                 Throwable err)
        Mark the request as crashing with a communication error.

        This method may take significant time acquiring the leader lock and updating the Ketch state machine with the failure.

        Parameters:
        repo - local repository reference used by the push attempt.
        err - exception thrown during communication.
      • done

        public void done​(Repository repo)
        Mark the request as completed without exception.

        This method may take significant time acquiring the leader lock and updating the Ketch state machine with results from this replica.

        Parameters:
        repo - local repository reference used by the push attempt.