Interface RetainedCollector


public interface RetainedCollector
  • Method Details

    • realm

      @Nonnull String realm()
      ID of the realm being processed.
    • isSystemRealm

      default boolean isSystemRealm()
    • realmPersistence

      @Nonnull org.apache.polaris.persistence.nosql.api.Persistence realmPersistence()
      Persistence configured for the current realm.

      References and objects that are read or written via this Persistence are automatically retained.

      The returned Persistence bypasses the cache to avoid polluting the production cache with accesses from the maintenance service.

      If the reference name(s) and object IDs are known in advance, it is more efficient to just call the retainReference(String)/retainObject(ObjRef) functions, because those will not access the backend database.

    • retainReference

      void retainReference(@Nonnull String name)
      Instruct the maintenance service to retain the reference with the given name.

      References that are fetched via realmPersistence() are automatically marked to be retained.

    • retainObject

      void retainObject(@Nonnull org.apache.polaris.persistence.nosql.api.obj.ObjRef objRef)
      Instruct the maintenance service to retain the reference with the given object ID.

      Objects that are fetched via realmPersistence() are automatically marked to be retained.

    • indexRetain

      default <V> void indexRetain(org.apache.polaris.persistence.nosql.api.index.IndexContainer<V> indexContainer)
    • refRetain

      default <O extends org.apache.polaris.persistence.nosql.api.obj.BaseCommitObj> void refRetain(String ref, Class<O> clazz, Predicate<O> continuePredicate, Consumer<O> retainedObjConsumer)
    • refRetain

      default <O extends org.apache.polaris.persistence.nosql.api.obj.BaseCommitObj> void refRetain(String ref, Class<O> clazz, Predicate<O> continuePredicate, Consumer<O> retainedObjConsumer, RetainedCollector.ProgressListener<O> progressListener)
      Functionality to identify the objects in a Reference to retain by walking the commit log.

      For flexibility, consider using CelReferenceContinuePredicate.

      Type Parameters:
      O - type of the referenced objects
      Parameters:
      ref - reference name, automatically marked as to-be-retained
      clazz - type of the referenced objects
      continuePredicate - predicate to test whether to continue processing the reference
      retainedObjConsumer - called for every retained object
    • refRetainIndexToSingleObj

      default <O extends org.apache.polaris.persistence.nosql.api.obj.BaseCommitObj> void refRetainIndexToSingleObj(String ref, Class<O> clazz, Predicate<O> continuePredicate, Function<O,org.apache.polaris.persistence.nosql.api.index.IndexContainer<org.apache.polaris.persistence.nosql.api.obj.ObjRef>> indexToObjIdFromRetainedObj, Consumer<O> retainedObjConsumer)
    • refRetainIndexToSingleObj

      default <O extends org.apache.polaris.persistence.nosql.api.obj.BaseCommitObj> void refRetainIndexToSingleObj(String ref, Class<O> clazz, Predicate<O> continuePredicate, Function<O,org.apache.polaris.persistence.nosql.api.index.IndexContainer<org.apache.polaris.persistence.nosql.api.obj.ObjRef>> indexToObjIdFromRetainedObj)
    • refRetainIndexToSingleObj

      default <O extends org.apache.polaris.persistence.nosql.api.obj.BaseCommitObj> void refRetainIndexToSingleObj(String ref, Class<O> clazz, Predicate<O> continuePredicate, Function<O,org.apache.polaris.persistence.nosql.api.index.IndexContainer<org.apache.polaris.persistence.nosql.api.obj.ObjRef>> indexToObjIdFromRetainedObj, RetainedCollector.ProgressListener<O> progressListener, Consumer<org.apache.polaris.persistence.nosql.api.obj.ObjRef> indexedObjRefConsumer)
      Similar to refRetain(String, Class, Predicate, Consumer), with convenience to iterate over an IndexContainer having ObjRef index-element values to mark those as to-be-retained.

      For flexibility, consider using CelReferenceContinuePredicate.

      Type Parameters:
      O - type of the referenced objects
      Parameters:
      ref - reference name
      clazz - type of the referenced objects
      continuePredicate - predicate to test whether to continue processing the reference
      indexToObjIdFromRetainedObj - function to extract the IndexContainer from objects