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
Modifier 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
-
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 providedParameterResolver
to resolve values any referencedParameter
s.void
setMemberLocatorType
(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:ParameterizedBuilder
Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolver
to resolve values any referencedParameter
s.- Specified by:
realize
in interfaceParameterizedBuilder<BiFunction<Ownership,
PartitionedService, Member>> - Parameters:
resolver
- theParameterResolver
for resolving namedParameter
sloader
- theClassLoader
for loading any necessary classes and ifnull
theClassLoader
used 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
-