Interface CachedView

    • Method Detail

      • assign

        default void assign​(java.util.Collection<Partition> partitions)
        Assign and make given partitions accessible by random reads. If the view contains any partitions not listed in the collection, these partitions are dropped.
        Parameters:
        partitions - the partitions to cache locally
      • assign

        default void assign​(java.util.Collection<Partition> partitions,
                            java.time.Duration ttl)
        Assign and make given partitions accessible by random reads. If the view contains any partitions not listed in the collection, these partitions are dropped.
        Parameters:
        partitions - the partitions to cache locally
        ttl - maximaul Duration that an update should be kept in the cache NOTE: this is not a hard limit, it is only a signal, that after this time the element can be removed to free up memory
      • assign

        default void assign​(java.util.Collection<Partition> partitions,
                            BiConsumer<StreamElement,​Pair<java.lang.Long,​java.lang.Object>> updateCallback)
        Assign and make given partitions accessible by random reads. If the view contains any partitions not listed in the collection, these partitions are dropped.
        Parameters:
        partitions - the partitions to cache locally
        updateCallback - function that is called when cache gets updated the function takes the new ingest element and pair of the most recent object that was associated with the key and it's currently associated stamp
      • assign

        void assign​(java.util.Collection<Partition> partitions,
                    BiConsumer<StreamElement,​Pair<java.lang.Long,​java.lang.Object>> updateCallback,
                    @Nullable
                    java.time.Duration ttl)
        Assign and make given partitions accessible by random reads. If the view contains any partitions not listed in the collection, these partitions are dropped.
        Parameters:
        partitions - the partitions to cache locally
        updateCallback - function that is called when cache gets updated the function takes the new ingest element and pair of the most recent object that was associated with the key and it's currently associated stamp
        ttl - maximaul Duration that an update should be kept in the cache NOTE: this is not a hard limit, it is only a signal, that after this time the element can be removed to free up memory
      • getAssigned

        java.util.Collection<Partition> getAssigned()
        Retrieve currently assigned partitions.
        Returns:
        currently assigned partitions
      • cache

        void cache​(StreamElement element)
        Cache given StreamElement into local cache without writing it to the underlying writer. This is used in conjunction with attribute family proxy.
        Parameters:
        element - the data to cache
      • getPartitions

        default java.util.Collection<Partition> getPartitions()
        Retrieve all partitions of the underlying commit log.
        Returns:
        all partitions of underlying commit log
      • getRunningHandle

        java.util.Optional<ObserveHandle> getRunningHandle()
        Retrieve a running handle (if present).
      • close

        void close()
        Description copied from interface: AttributeWriterBase
        Close allocated resources of this writer. This is supposed to be idempotent.
        Specified by:
        close in interface AttributeWriterBase
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable