Interface AdminApiFuture<K,V>

All Known Implementing Classes:
AdminApiFuture.SimpleAdminApiFuture, AllBrokersStrategy.AllBrokersFuture

public interface AdminApiFuture<K,V>
  • Method Details

    • lookupKeys

      Set<K> lookupKeys()
      The initial set of lookup keys. Although this will usually match the fulfillment keys, it does not necessarily have to. For example, in the case of AllBrokersStrategy.AllBrokersFuture, we use the lookup phase in order to discover the set of keys that will be searched during the fulfillment phase.
      Returns:
      non-empty set of initial lookup keys
    • complete

      void complete(Map<K,V> values)
      Complete the futures associated with the given keys.
      Parameters:
      values - the completed keys with their respective values
    • completeLookup

      default void completeLookup(Map<K,Integer> brokerIdMapping)
      Invoked when lookup of a set of keys succeeds.
      Parameters:
      brokerIdMapping - the discovered mapping from key to the respective brokerId that will handle the fulfillment request
    • completeLookupExceptionally

      default void completeLookupExceptionally(Map<K,Throwable> lookupErrors)
      Invoked when lookup fails with a fatal error on a set of keys.
      Parameters:
      lookupErrors - the set of keys that failed lookup with their respective errors
    • completeExceptionally

      void completeExceptionally(Map<K,Throwable> errors)
      Complete the futures associated with the given keys exceptionally.
      Parameters:
      errors - the failed keys with their respective errors
    • forKeys

      static <K, V> AdminApiFuture.SimpleAdminApiFuture<K,V> forKeys(Set<K> keys)