Interface DistributedSetCacheClient

All Superinterfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.controller.ControllerService

@Tags({"distributed","client","cluster","set","cache"}) @CapabilityDescription("Provides the ability to communicate with a DistributedSetCacheServer. This allows multiple nodes to coordinate state with a single remote entity.") public interface DistributedSetCacheClient extends org.apache.nifi.controller.ControllerService
This interface defines an API that can be used for interacting with a Distributed Cache that functions similarly to a Set.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> boolean
    addIfAbsent(T value, Serializer<T> serializer)
    Adds the specified value to the cache, serializing the value with the given Serializer.
    void
    Attempts to notify the server that we are finished communicating with it and cleans up resources
    <T> boolean
    contains(T value, Serializer<T> serializer)
     
    <T> boolean
    remove(T value, Serializer<T> serializer)
    Removes the given value from the cache, if it is present.

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.controller.ControllerService

    initialize, isStateful, migrateProperties
  • Method Details

    • addIfAbsent

      <T> boolean addIfAbsent(T value, Serializer<T> serializer) throws IOException
      Adds the specified value to the cache, serializing the value with the given Serializer.
      Type Parameters:
      T - type
      Parameters:
      value - value
      serializer - serializer
      Returns:
      true if the value was added to the cache, false if the value already existed in the cache
      Throws:
      IOException - if unable to communicate with the remote instance
    • contains

      <T> boolean contains(T value, Serializer<T> serializer) throws IOException
      Type Parameters:
      T - type
      Parameters:
      value - value
      serializer - serializer
      Returns:
      if the given value is present in the cache and if so returns true, else returns false
      Throws:
      IOException - if unable to communicate with the remote instance
    • remove

      <T> boolean remove(T value, Serializer<T> serializer) throws IOException
      Removes the given value from the cache, if it is present.
      Type Parameters:
      T - type
      Parameters:
      value - value
      serializer - serializer
      Returns:
      true if the value is removed, false if the value did not exist in the cache
      Throws:
      IOException - ex
    • close

      void close() throws IOException
      Attempts to notify the server that we are finished communicating with it and cleans up resources
      Throws:
      IOException - ex