Class RandomStrategy<T>
java.lang.Object
org.apache.curator.x.discovery.strategies.RandomStrategy<T>
- All Implemented Interfaces:
ProviderStrategy<T>
This strategy always picks a random instance from the list
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetInstance
(InstanceProvider<T> instanceProvider) Given a source of instances, return one of them for a single use.
-
Constructor Details
-
RandomStrategy
public RandomStrategy()
-
-
Method Details
-
getInstance
Description copied from interface:ProviderStrategy
Given a source of instances, return one of them for a single use.- Specified by:
getInstance
in interfaceProviderStrategy<T>
- Parameters:
instanceProvider
- the instance provider- Returns:
- the instance to use
- Throws:
Exception
- any errors
-