Package org.openspaces.core.multicluster
A client-side GigaSpace implementation that fronts several
already-deployed remote spaces - one per cluster / site - and routes each operation to one or more of
them according to the configured write mode, read mode and failover policy. Because
MultiClusterGigaSpace extends GigaSpace, application
code does not change: only the bean or factory that produces the GigaSpace is swapped.
It is built the way any other GigaSpace is built - hand the configurer the clusters, call
gigaSpace():
SpaceProxyConfigurer east = new SpaceProxyConfigurer("mySpace").lookupLocators("east-host:4174");
SpaceProxyConfigurer west = new SpaceProxyConfigurer("mySpace").lookupLocators("west-host:4174");
MultiClusterGigaSpace gigaSpace = new MultiClusterGigaSpaceConfigurer(
Map.of("us-east", east, "us-west", west))
.activeCluster("us-east")
.writeMode(WriteMode.WRITE_SYNC)
.readMode(ReadMode.READ_ROUND_ROBIN)
.gigaSpace();
The application connects; the proxy routes. Cluster proxies - whether handed in as
GigaSpace instances or built by the configurer from the SpaceConfigurers you passed -
are never owned by the multi-cluster proxy, exactly as a GigaSpace does not own the
SpaceConfigurer behind it. Closing the multi-cluster proxy releases only what it created
itself: the write executors and the deferred-mutation queue.
This package is the supported surface: the interface itself,
MultiClusterGigaSpaceConfigurer and
MultiClusterGigaSpaceFactoryBean for building one,
ClusterDescriptor for per-cluster topology metadata,
MultiClusterConfig and
MultiClusterProperties for the routing knobs, and
MultiClusterStats for what it reports - read-only, since the
proxy is what writes those counters. The event and exception sub-packages are part of
it too.
internal and everything beneath it are implementation - the router, the topology registry,
operation classification, read selectors, write executors, health, failover, and the stats recorder.
They are subject to change without notice, in the same way
com.gigaspaces.internal.client.spaceproxy is relative to IJSpace.
Two things to know before using it
- Fan-out modes are not a distributed transaction. Inside an active transaction the proxy narrows to the active cluster, or refuses, depending on the configured transaction policy.
- Either the proxy fans mutations out, or a WAN Gateway replicates them - doing both applies each mutation twice.
-
ClassDescriptionTopology metadata for one cluster: what to call it, where it is, and how much read traffic it should take.Fluent builder; only
nameis mandatory.The multi-cluster proxy: aGigaSpaceover several already-deployed clusters that routes every operation according to the configuredMultiClusterGigaSpace.WriteMode,MultiClusterGigaSpace.ReadModeandMultiClusterGigaSpace.FailoverPolicy.The complete routing configuration of a proxy instance, validated as a whole.AGigaSpacethat fronts several already-deployed remote spaces - one per cluster / site - and redirects each operation to one or more of them according to the configuredMultiClusterGigaSpace.WriteMode,MultiClusterGigaSpace.ReadModeandMultiClusterGigaSpace.FailoverPolicy.Notified on every multi-cluster state change: a cluster added or removed, a cluster failing, and the active cluster switching.What happens when the cluster an operation was routed to is unavailable.How read operations pick a cluster.How mutations (write,take,change,clear) are distributed.Programmatic configurer for a multi-cluster proxy, in the shape ofGigaSpaceConfigurer: hand it the clusters, set the routing modes, callMultiClusterGigaSpaceConfigurer.gigaSpace().Spring wiring for the proxy: aFactoryBeanthat produces aMultiClusterGigaSpaceand closes it with the context.The operational surface of a proxy, exposed over JMX.Reads routing configuration from a flat property map, so every mode can change without recompiling - which is the difference between "we need a release to move traffic" and "we edit a file".Read-only per-cluster counters: how many operations went where, how many failed, and how slow each cluster looks.Point-in-time view of one cluster's counters.How a quiesced cluster is treated.What the proxy does when a mutation is issued inside an active transaction while a fan-out write mode is configured.