Interface AdminApiFuture<K,V>
- All Known Implementing Classes:
AdminApiFuture.SimpleAdminApiFuture,AllBrokersStrategy.AllBrokersFuture
public interface AdminApiFuture<K,V>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThis class can be used when the set of keys is known ahead of time. -
Method Summary
Modifier and TypeMethodDescriptionvoidComplete the futures associated with the given keys.voidcompleteExceptionally(Map<K, Throwable> errors) Complete the futures associated with the given keys exceptionally.default voidcompleteLookup(Map<K, Integer> brokerIdMapping) Invoked when lookup of a set of keys succeeds.default voidcompleteLookupExceptionally(Map<K, Throwable> lookupErrors) Invoked when lookup fails with a fatal error on a set of keys.static <K,V> AdminApiFuture.SimpleAdminApiFuture <K, V> The initial set of lookup keys.
-
Method Details
-
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 ofAllBrokersStrategy.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
Complete the futures associated with the given keys.- Parameters:
values- the completed keys with their respective values
-
completeLookup
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
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
Complete the futures associated with the given keys exceptionally.- Parameters:
errors- the failed keys with their respective errors
-
forKeys
-