Record Class ClusterDescriptor
java.lang.Object
java.lang.Record
org.openspaces.core.multicluster.ClusterDescriptor
- Record Components:
name- logical cluster name used in configuration, metrics and log linessite- free-form site / region label, reported in the topology, ornulllocal- whether this cluster is co-located with the clientweight- relative share for weighted read balancing,>= 1
Topology metadata for one cluster: what to call it, where it is, and how much read traffic it should
take. It describes a cluster the application has already connected to - it does not say how to
connect, because the application owns that.
Connection details deliberately live outside this record. A cluster enters the proxy as a
GigaSpace the application built, or as a
SpaceConfigurer it hands over:
GigaSpace east = new GigaSpaceConfigurer(
new SpaceProxyConfigurer("mySpace").lookupLocators("east-host:4174")).gigaSpace();
MultiClusterGigaSpace proxy = new MultiClusterGigaSpaceConfigurer()
.cluster(ClusterDescriptor.builder("us-east").site("us-east-1").local(true).build(), east)
.cluster("us-west", west)
.gigaSpace();
A descriptor is optional. cluster(name, proxy) registers a cluster with default metadata -
no site, not local, weight 1. Supply one when read routing needs more to go on: weighted
MultiClusterGigaSpace.ReadMode.READ_ROUND_ROBIN has nothing but weight() to
distribute by, and site() and local() are what the reported topology shows.
Instances are immutable; build them with builder(String).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent builder; onlynameis mandatory. -
Constructor Summary
ConstructorsConstructorDescriptionClusterDescriptor(String name, String site, boolean local, int weight) Creates an instance of aClusterDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterDescriptor.Builderfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanlocal()Returns the value of thelocalrecord component.name()Returns the value of thenamerecord component.static ClusterDescriptorA descriptor carrying nothing but the name: no site, not local, weight1.site()Returns the value of thesiterecord component.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Constructor Details
-
Method Details
-
of
A descriptor carrying nothing but the name: no site, not local, weight1. -
builder
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
site
-
local
-
weight
-