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>>
The
ReadLocatorBuilder class builds a BiFunction that given
the current ownership of a partition and service will return a member to 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
FieldsModifier and TypeFieldDescriptionstatic final BiFunction<Ownership, PartitionedService, Member> A BiFunction implementation that returns a member that is 'closest' to this member based on provided metadata (member, machine, rack, or site).static final BiFunction<Ownership, PartitionedService, Member> A BiFunction implementation that returns the primary member of the ownership chain.static final BiFunction<Ownership, PartitionedService, Member> A BiFunction implementation that returns a random member of the ownership chain.static final BiFunction<Ownership, PartitionedService, Member> A BiFunction implementation that returns a random backup member of the ownership chain. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMemberLocatorType(ParameterResolver resolver) Return a string that represents the member to target reads against.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 Details
-
PRIMARY
A BiFunction implementation that returns the primary member of the ownership chain. -
RANDOM
A BiFunction implementation that returns a random member of the ownership chain. -
RANDOM_BACKUP
A BiFunction implementation that returns a random backup member of the ownership chain. -
CLOSEST
A BiFunction implementation that returns a member that is 'closest' to this member based on provided metadata (member, machine, rack, or site).
-
-
Constructor Details
-
ReadLocatorBuilder
public ReadLocatorBuilder()
-
-
Method Details
-
getMemberLocatorType
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
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, realizeMember> (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
-