Class Commit

java.lang.Object
org.apache.cassandra.service.paxos.Commit
Direct Known Subclasses:
Commit.Proposal

public class Commit extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • newPrepare

      public static Commit newPrepare(DecoratedKey partitionKey, TableMetadata metadata, Ballot ballot)
    • emptyCommit

      public static Commit emptyCommit(DecoratedKey partitionKey, TableMetadata metadata)
    • newProposal

      @Deprecated(since="4.1") public static Commit newProposal(Ballot ballot, PartitionUpdate update)
      Deprecated.
      See CASSANDRA-17164
    • isAfter

      public boolean isAfter(Commit other)
    • isSameOrAfter

      public boolean isSameOrAfter(@Nullable Ballot otherBallot)
    • isAfter

      public boolean isAfter(@Nullable Ballot otherBallot)
    • isBefore

      public boolean isBefore(@Nullable Ballot otherBallot)
    • hasBallot

      public boolean hasBallot(Ballot ballot)
    • hasSameBallot

      public boolean hasSameBallot(Commit other)
    • makeMutation

      public Mutation makeMutation()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(String kind)
    • isReproposalOf

      public boolean isReproposalOf(Commit older)
      We can witness reproposals of the latest successful commit; we can detect this by comparing the timestamp of the update with our ballot; if it is the same, we are not a reproposal. If it is the same as either the ballot timestamp or update timestamp of the latest committed proposal, then we are reproposing it and can instead simpy commit it.
    • compareWith

      public org.apache.cassandra.service.paxos.Commit.CompareResult compareWith(Commit that)
    • isAfter

      public static boolean isAfter(@Nullable Commit testIsAfter, @Nullable Commit testIsBefore)
      Returns:
      testIfAfter.isAfter(testIfBefore), with non-null > null
    • isAfter

      public static boolean isAfter(@Nullable Ballot testIsAfter, @Nullable Commit testIsBefore)
      Returns:
      testIfAfter.isAfter(testIfBefore), with non-null > null
    • isAfter

      public static boolean isAfter(@Nullable Commit testIsAfter, @Nullable Ballot testIsBefore)
      Returns:
      testIfAfter.isAfter(testIfBefore), with non-null > null
    • isAfter

      public static boolean isAfter(@Nullable Ballot testIsAfter, @Nullable Ballot testIsBefore)
      Returns:
      testIfAfter.isAfter(testIfBefore), with non-null > null
    • latest

      public static <C extends Commit> C latest(@Nullable C a, @Nullable C b)
      the latest of two ballots, or the first ballot if equal timestamps
    • latest

      public static Ballot latest(@Nullable Commit a, @Nullable Ballot b)
      the latest of two ballots, or the first ballot if equal timestamps
    • latest

      public static Ballot latest(@Nullable Ballot a, @Nullable Ballot b)
      the latest of two ballots, or the first ballot if equal timestamps
    • timestampsClash

      public static boolean timestampsClash(@Nullable Commit a, @Nullable Ballot b)
      unequal ballots with same timestamp
    • timestampsClash

      public static boolean timestampsClash(@Nullable Ballot a, @Nullable Ballot b)