Record Class MutationAttempt

java.lang.Object
java.lang.Record
org.apache.polaris.persistence.nosql.metastore.mutation.MutationAttempt

public record MutationAttempt(UpdateKeyForCatalogAndEntityType updateKeyForCatalogAndEntityType, List<EntityUpdate> updates, org.apache.polaris.persistence.nosql.api.commit.CommitterState<? extends org.apache.polaris.persistence.nosql.coretypes.ContainerObj,MutationResults> state, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.obj.ObjRef> byName, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.index.IndexKey> byId, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.changes.Change> changes, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet> locations, MemoizedIndexedAccess memoizedIndexedAccess) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    MutationAttempt(UpdateKeyForCatalogAndEntityType updateKeyForCatalogAndEntityType, List<EntityUpdate> updates, org.apache.polaris.persistence.nosql.api.commit.CommitterState<? extends org.apache.polaris.persistence.nosql.coretypes.ContainerObj,MutationResults> state, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.obj.ObjRef> byName, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.index.IndexKey> byId, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.changes.Change> changes, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet> locations, MemoizedIndexedAccess memoizedIndexedAccess)
    Creates an instance of a MutationAttempt record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.index.IndexKey>
    Returns the value of the byId record component.
    org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.obj.ObjRef>
    Returns the value of the byName record component.
    org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.changes.Change>
    Returns the value of the changes record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet>
    Returns the value of the locations record component.
    Returns the value of the memoizedIndexedAccess record component.
    static org.apache.polaris.persistence.nosql.coretypes.ObjBase
    objForChangeComparison(org.apache.polaris.core.entity.PolarisBaseEntity entity, Optional<org.apache.polaris.core.entity.PolarisPrincipalSecrets> currentSecrets, org.apache.polaris.persistence.nosql.coretypes.ObjBase originalObj)
    Produces an obj instance that can be used to detect whether an update operation results in an actual change or a noop.
    org.apache.polaris.persistence.nosql.api.commit.CommitterState<? extends org.apache.polaris.persistence.nosql.coretypes.ContainerObj,MutationResults>
    Returns the value of the state record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the updateKeyForCatalogAndEntityType record component.
    static void
    updateLocationsIndex(org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet> locations, org.apache.polaris.persistence.nosql.coretypes.ObjBase originalObj, org.apache.polaris.persistence.nosql.coretypes.ObjBase entityObj)
     
    Returns the value of the updates record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MutationAttempt

      public MutationAttempt(UpdateKeyForCatalogAndEntityType updateKeyForCatalogAndEntityType, List<EntityUpdate> updates, org.apache.polaris.persistence.nosql.api.commit.CommitterState<? extends org.apache.polaris.persistence.nosql.coretypes.ContainerObj,MutationResults> state, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.obj.ObjRef> byName, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.index.IndexKey> byId, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.changes.Change> changes, org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet> locations, MemoizedIndexedAccess memoizedIndexedAccess)
      Creates an instance of a MutationAttempt record class.
      Parameters:
      updateKeyForCatalogAndEntityType - the value for the updateKeyForCatalogAndEntityType record component
      updates - the value for the updates record component
      state - the value for the state record component
      byName - the value for the byName record component
      byId - the value for the byId record component
      changes - the value for the changes record component
      locations - the value for the locations record component
      memoizedIndexedAccess - the value for the memoizedIndexedAccess record component
  • Method Details

    • objForChangeComparison

      public static org.apache.polaris.persistence.nosql.coretypes.ObjBase objForChangeComparison(org.apache.polaris.core.entity.PolarisBaseEntity entity, Optional<org.apache.polaris.core.entity.PolarisPrincipalSecrets> currentSecrets, org.apache.polaris.persistence.nosql.coretypes.ObjBase originalObj)
      Produces an obj instance that can be used to detect whether an update operation results in an actual change or a noop. For this, the entity is mapped to an object, but the technical attributes are taken from the existing object.
    • apply

      public ChangeResult<MutationResults> apply()
    • updateLocationsIndex

      public static void updateLocationsIndex(org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet> locations, org.apache.polaris.persistence.nosql.coretypes.ObjBase originalObj, org.apache.polaris.persistence.nosql.coretypes.ObjBase entityObj)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • updateKeyForCatalogAndEntityType

      public UpdateKeyForCatalogAndEntityType updateKeyForCatalogAndEntityType()
      Returns the value of the updateKeyForCatalogAndEntityType record component.
      Returns:
      the value of the updateKeyForCatalogAndEntityType record component
    • updates

      public List<EntityUpdate> updates()
      Returns the value of the updates record component.
      Returns:
      the value of the updates record component
    • state

      public org.apache.polaris.persistence.nosql.api.commit.CommitterState<? extends org.apache.polaris.persistence.nosql.coretypes.ContainerObj,MutationResults> state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • byName

      public org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.obj.ObjRef> byName()
      Returns the value of the byName record component.
      Returns:
      the value of the byName record component
    • byId

      public org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.api.index.IndexKey> byId()
      Returns the value of the byId record component.
      Returns:
      the value of the byId record component
    • changes

      public org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.changes.Change> changes()
      Returns the value of the changes record component.
      Returns:
      the value of the changes record component
    • locations

      public org.apache.polaris.persistence.nosql.api.index.UpdatableIndex<org.apache.polaris.persistence.nosql.coretypes.catalog.EntityIdSet> locations()
      Returns the value of the locations record component.
      Returns:
      the value of the locations record component
    • memoizedIndexedAccess

      public MemoizedIndexedAccess memoizedIndexedAccess()
      Returns the value of the memoizedIndexedAccess record component.
      Returns:
      the value of the memoizedIndexedAccess record component