All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.stream.impl.KeyTrackingTerminalOperation Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.stream.impl;

import org.infinispan.container.entries.CacheEntry;
import org.infinispan.factories.ComponentRegistry;

import java.util.Collection;
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.Stream;

/**
 * A terminal operation for a {@link org.infinispan.CacheStream} that allows tracking keys during a rehash event.
 * @param  key type for the entry returned
 * @param  return type when not utilizing rehash aware
 * @param  value type for the entry returned
 */
public interface KeyTrackingTerminalOperation extends SegmentAwareOperation {
   /**
    * Collector used to collect items from intermediate responses of operations
    * @param  type of collected item
    */
   interface IntermediateCollector {
      /**
       * Called back when a response is sent back to the invoker
       * @param response the returned data
       */
      void sendDataResonse(C response);
   }

   /**
    * Invoked when a key aware operation is desired without rehash being enabled.
    * @param response the collector that will be called back for any intermediate results
    * @return the final response from the remote node
    */
   Collection performOperation(IntermediateCollector> response);

   /**
    * Invoked when a key and rehash aware operation is desired.
    * @param response the collector that will be called back for any intermediate results
    * @return the final response from the remote node
    */
   Collection> performOperationRehashAware(
           IntermediateCollector>> response);

   /**
    * This method is to be invoked only locally after a key tracking operation has been serialized to a new node
    * @param supplier the supplier to use
    */
   void setSupplier(Supplier> supplier);

   /**
    * Handles injection of components for various intermediate and this operation.
    * @param registry component registry to use
    */
   void handleInjection(ComponentRegistry registry);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy