Class MemoizedIndexedAccess

java.lang.Object
org.apache.polaris.persistence.nosql.metastore.indexaccess.MemoizedIndexedAccess

public final class MemoizedIndexedAccess extends Object
Memoizes IndexedContainerAccess instances by catalog-ID and type-code, and reference heads by reference name for a NoSqlMetaStore instance.

Both serve different use cases. Reference head memoization is not used for index access.

IndexedContainerAccess instances and reference heads are memoized independently. Invalidating by catalog-ID and type-code does not invalidate a memoized reference head for the corresponding entity type.

Memoizing these instances avoids unnecessary reference-head, index lookups and index deserialization, even if backed by the persistence cache. Committing functions must always call the appropriate invalidate*() functions.

  • Method Details

    • newMemoizedIndexedAccess

      public static MemoizedIndexedAccess newMemoizedIndexedAccess(org.apache.polaris.persistence.nosql.api.Persistence persistence)
      Constructs a new MemoizedIndexedAccess instance.
      Parameters:
      persistence - persistence instance to use
    • indexedAccessDirect

      public IndexedContainerAccess<?> indexedAccessDirect(org.apache.polaris.persistence.nosql.api.obj.ObjRef containerObjRef)
    • indexedAccess

      public <C extends org.apache.polaris.persistence.nosql.coretypes.ContainerObj> IndexedContainerAccess<C> indexedAccess(long catalogId, int entityTypeCode)
    • catalogContent

      public IndexedContainerAccess<org.apache.polaris.persistence.nosql.coretypes.catalog.CatalogStateObj> catalogContent(long catalogId)
    • invalidateCatalogContent

      public void invalidateCatalogContent(long catalogId)
    • invalidateIndexedAccess

      public void invalidateIndexedAccess(long catalogId, int entityTypeCode)
    • grantsIndex

      public Optional<org.apache.polaris.persistence.nosql.api.index.Index<org.apache.polaris.persistence.nosql.api.obj.ObjRef>> grantsIndex()
    • invalidateGrantsIndex

      public void invalidateGrantsIndex()
    • referenceHead

      public <O extends org.apache.polaris.persistence.nosql.api.obj.BaseCommitObj> Optional<O> referenceHead(String refName, Class<O> type)
    • invalidateReferenceHead

      public void invalidateReferenceHead(String refName)