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>>
TheReadLocatorBuilder
class builds aBiFunction
that given the currentownership
of a partition andservice
will return amember
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
Fields Modifier and Type Field Description static 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).static BiFunction<Ownership,PartitionedService,Member>
PRIMARY
A BiFunction implementation that returns the primary member of the ownership chain.static BiFunction<Ownership,PartitionedService,Member>
RANDOM
A BiFunction implementation that returns a random member of the ownership chain.static BiFunction<Ownership,PartitionedService,Member>
RANDOM_BACKUP
A 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 String
getMemberLocatorType(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 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 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: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
-
-