Class ReadLocatorBuilder
- java.lang.Object
-
- com.tangosol.coherence.config.builder.DefaultBuilderCustomization<BiFunction<Ownership,PartitionedService,Member>>
-
- com.tangosol.coherence.config.builder.ReadLocatorBuilder
-
- All Implemented Interfaces:
BuilderCustomization<BiFunction<Ownership,PartitionedService,Member>>,ParameterizedBuilder<BiFunction<Ownership,PartitionedService,Member>>
public class ReadLocatorBuilder extends DefaultBuilderCustomization<BiFunction<Ownership,PartitionedService,Member>> implements ParameterizedBuilder<BiFunction<Ownership,PartitionedService,Member>>
TheReadLocatorBuilderclass builds aBiFunctionthat given the currentownershipof a partition andservicewill return amemberto target reads against.- Since:
- 21.12
- Author:
- hr
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder
ParameterizedBuilder.ReflectionSupport
-
-
Field Summary
Fields Modifier and Type Field Description static BiFunction<Ownership,PartitionedService,Member>CLOSESTA BiFunction implementation that returns a member that is 'closest' to this member based on provided metadata (member, machine, rack, or site).static BiFunction<Ownership,PartitionedService,Member>PRIMARYA BiFunction implementation that returns the primary member of the ownership chain.static BiFunction<Ownership,PartitionedService,Member>RANDOMA BiFunction implementation that returns a random member of the ownership chain.static BiFunction<Ownership,PartitionedService,Member>RANDOM_BACKUPA BiFunction implementation that returns a random backup member of the ownership chain.
-
Constructor Summary
Constructors Constructor Description ReadLocatorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMemberLocatorType(ParameterResolver resolver)Return a string that represents the member to target reads against.BiFunction<Ownership,PartitionedService,Member>realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters)Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolverto resolve values any referencedParameters.voidsetMemberLocatorType(Expression<String> expr)Set the string that represents the member to target reads against.-
Methods inherited from class com.tangosol.coherence.config.builder.DefaultBuilderCustomization
getCustomBuilder, setCustomBuilder
-
-
-
-
Field Detail
-
PRIMARY
public static final BiFunction<Ownership,PartitionedService,Member> PRIMARY
A BiFunction implementation that returns the primary member of the ownership chain.
-
RANDOM
public static final BiFunction<Ownership,PartitionedService,Member> RANDOM
A BiFunction implementation that returns a random member of the ownership chain.
-
RANDOM_BACKUP
public static final BiFunction<Ownership,PartitionedService,Member> RANDOM_BACKUP
A BiFunction implementation that returns a random backup member of the ownership chain.
-
CLOSEST
public static final BiFunction<Ownership,PartitionedService,Member> CLOSEST
A BiFunction implementation that returns a member that is 'closest' to this member based on provided metadata (member, machine, rack, or site).
-
-
Method Detail
-
getMemberLocatorType
public String getMemberLocatorType(ParameterResolver resolver)
Return a string that represents the member to target reads against. Valid values are:- primary
- closest
- random
- random-backup
- Parameters:
resolver- theParameterResolver- Returns:
- a string that represents the member to target reads against
-
setMemberLocatorType
@Injectable public void setMemberLocatorType(Expression<String> expr)
Set the string that represents the member to target reads against. Valid values are:- primary
- closest
- random
- random-backup
- Parameters:
expr- the string that represents the member to target reads against
-
realize
public BiFunction<Ownership,PartitionedService,Member> realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters)
Description copied from interface:ParameterizedBuilderRealizes (creates if necessary) an instance of a object of type T, using the providedParameterResolverto resolve values any referencedParameters.- Specified by:
realizein interfaceParameterizedBuilder<BiFunction<Ownership,PartitionedService,Member>>- Parameters:
resolver- theParameterResolverfor resolving namedParametersloader- theClassLoaderfor loading any necessary classes and ifnulltheClassLoaderused to load the builder will be used insteadlistParameters- an optionalParameterList(may benull) to be used for realizing the instance, eg: used as constructor parameters- Returns:
- an instance of T
-
-