Class ObjectPlanHash

java.lang.Object
com.apple.foundationdb.record.ObjectPlanHash
All Implemented Interfaces:
PlanHashable, QueryHashable

public class ObjectPlanHash extends Object implements PlanHashable, QueryHashable
This class implements a planHash for the member classes of the query plan. As it is required to separate the plan hashes of various structures in the plan model, we need a way to tell each member of the model apart. Using this class we can implement a stable (withstand JVM restart and class refactorings) base hash for each object that can be added to the rest of the plan.
  • Constructor Details

    • ObjectPlanHash

      public ObjectPlanHash(@Nonnull Object id)
  • Method Details

    • planHash

      public int planHash(@Nonnull PlanHashable.PlanHashMode mode)
      Description copied from interface: PlanHashable
      Return a hash similar to hashCode, but with the additional guarantee that is is stable across JVMs.
      Specified by:
      planHash in interface PlanHashable
      Parameters:
      mode - the "mode" of hash to calculate. Each mode contains a hash kind which has a particular logic with regards to included and excluded items. It is also versioned to support for the evolution of the plan hash when the underlying plan objects evolve
      Returns:
      a stable hash code
    • queryHash

      public int queryHash(@Nonnull QueryHashable.QueryHashKind hashKind)
      Description copied from interface: QueryHashable
      Return a hash similar to hashCode, but with the additional guarantee that is is stable across JVMs.
      Specified by:
      queryHash in interface QueryHashable
      Parameters:
      hashKind - the "kind" of hash to calculate. Each kind of hash has a particular logic with regards to included and excluded items.
      Returns:
      a stable hash code
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object