Interface Informable<T>
-
- All Known Subinterfaces:
AnyNamespaceOperation<T,L,R>,CertificateSigningRequestResource<T>,ExtensibleResource<T>,FilterWatchListDeletable<T,L,R>,MixedOperation<T,L,R>,NamespaceableResource<T>,NonNamespaceOperation<T,L,R>,ParameterMixedOperation<T,L,R>,PodResource,Resource<T>,RollableScalableResource<T>,ScalableResource<T>,ServiceAccountResource,ServiceResource<T>,V1beta1CertificateSigningRequestResource<T>
- All Known Implementing Classes:
ExtensibleResourceAdapter,ResourceAdapter
public interface Informable<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default SharedIndexInformer<T>inform()Similar to aWatch, but will attempt to handle failures after successfully started.default SharedIndexInformer<T>inform(ResourceEventHandler<? super T> handler)Similar to aWatch, but will attempt to handle failures after successfully started.SharedIndexInformer<T>inform(ResourceEventHandler<? super T> handler, long resync)Similar to aWatch, but will attempt to handle failures after successfully started.CompletableFuture<List<T>>informOnCondition(Predicate<List<T>> condition)SharedIndexInformer<T>runnableInformer(long resync)Similar to aWatch, but will attempt to handle failures after successfully started.Informable<T>withIndexers(Map<String,Function<T,List<String>>> indexers)Deprecated.please use methods on theSharedIndexInformerto add/remove indexesInformable<T>withLimit(Long limit)Set the limit to the number of resources to list at one time.
-
-
-
Method Detail
-
withIndexers
@Deprecated Informable<T> withIndexers(Map<String,Function<T,List<String>>> indexers)
Deprecated.please use methods on theSharedIndexInformerto add/remove indexesThe indexers to add toSharedIndexInformers created by subsequent inform calls;- Parameters:
indexers- to customize the indexing- Returns:
- the current
Informable
-
withLimit
Informable<T> withLimit(Long limit)
Set the limit to the number of resources to list at one time. This means that longer lists will take multiple requests to fetch.If the list fails to complete it will be re-attempted with this limit, rather than falling back to the full list. You should ensure that your handlers are either async or fast acting to prevent long delays in list processing that may cause results to expire before reaching the end of the list.
WARNING As noted in the go client: "paginated lists are always served directly from etcd, which is significantly less efficient and may lead to serious performance and scalability problems."
- Parameters:
limit- of a items in a list fetch- Returns:
- the current
Informable
-
inform
default SharedIndexInformer<T> inform()
Similar to aWatch, but will attempt to handle failures after successfully started. and provides a store of all the current resources.This returned informer will not support resync.
This call will be blocking for the initial list and watch.
You are expected to call stop to terminate the underlying Watch.
The processing of handler events will be in the client's
Executor.- Returns:
- a running
SharedIndexInformer
-
inform
default SharedIndexInformer<T> inform(ResourceEventHandler<? super T> handler)
Similar to aWatch, but will attempt to handle failures after successfully started. and provides a store of all the current resources.This returned informer will not support resync.
This call will be blocking for the initial list and watch.
You are expected to call stop to terminate the underlying Watch.
The processing of handler events will be in the client's
Executor.- Parameters:
handler- to notify- Returns:
- a running
SharedIndexInformer
-
inform
SharedIndexInformer<T> inform(ResourceEventHandler<? super T> handler, long resync)
Similar to aWatch, but will attempt to handle failures after successfully started. and provides a store of all the current resources.This call will be blocking for the initial list and watch.
You are expected to call stop to terminate the underlying Watch.
The processing of handler events will be in the client's
Executor.- Parameters:
handler- to notifyresync- the resync period or 0 for no resync- Returns:
- a running
SharedIndexInformer
-
runnableInformer
SharedIndexInformer<T> runnableInformer(long resync)
Similar to aWatch, but will attempt to handle failures after successfully started. and provides a store of all the current resources.You are expected to call stop to terminate the underlying Watch.
- Parameters:
resync- the resync period or 0 for no resync- Returns:
- a non-running
SharedIndexInformer
-
informOnCondition
CompletableFuture<List<T>> informOnCondition(Predicate<List<T>> condition)
Return aFuturewhen the list at this context satisfies the givenPredicate. The predicate will be tested against the state of the underlying informer store on every event. The returned future should be cancelled by the caller if not waiting for completion to close the underlying informerThe processing of events will be in the IO thread, blocking operations should be avoided.
- Parameters:
condition- thePredicateto test- Returns:
- a
CompletableFutureof the list of items after the condition is met
-
-