Class DefaultMultiClusterGigaSpace
- All Implemented Interfaces:
AutoCloseable, GigaSpace, MultiClusterGigaSpace
GigaSpace over several already-deployed clusters that routes every
operation according to the configured MultiClusterGigaSpace.WriteMode, MultiClusterGigaSpace.ReadMode and MultiClusterGigaSpace.FailoverPolicy.
Construct one directly and register the clusters, which is all a multi-cluster proxy needs:
DefaultMultiClusterGigaSpace gigaSpace = new DefaultMultiClusterGigaSpace("orders");
gigaSpace.registerCluster("us-east", east); // the first registered becomes the active one
gigaSpace.registerCluster("us-west", west);
gigaSpace.setWriteMode(WriteMode.WRITE_SYNC);
gigaSpace.setReadMode(ReadMode.READ_ROUND_ROBIN);
gigaSpace.write(new Order(1)); // applied to both clusters
...
gigaSpace.close(); // the cluster proxies stay yours to close
Or hand the clusters and the configuration to the constructor, which registers them in iteration order and makes the first one active:
Map<String, GigaSpace> clusters = new LinkedHashMap<>();
clusters.put("us-east", east);
clusters.put("us-west", west);
MultiClusterGigaSpace gigaSpace = new DefaultMultiClusterGigaSpace("orders",
MultiClusterConfig.defaults().withWriteMode(WriteMode.WRITE_SYNC), clusters);
MultiClusterGigaSpaceConfigurer builds the same object with validation, a priority list and
SpaceConfigurer support; prefer it when the topology is known up front. This class is the one to
construct when the clusters arrive at runtime, or when a framework needs a plain constructor.
What it does not own
The cluster proxies are never owned by this object. Whatever you registered - aGigaSpace, or one
a SpaceConfigurer built - stays yours to close. close() releases only what this proxy
created: the write executors and the deferred-mutation queue.
Semantics worth knowing
Fan-out is not a distributed transaction; inside a transaction every operation is pinned to the active cluster.READ_ROUND_ROBIN is eventually consistent by construction - read-your-writes needs
READ_ACTIVE. getClustered() and
invalid reference
#executorBuilder(Object...)
UnsupportedOperationException, because what they return would be a live handle onto one cluster
that silently stops honouring the routing modes.
Extending it
Subclass it to build your own proxy. EveryGigaSpace operation goes through one of the protected
hooks routeRead(String, Function), routeMutation(OperationKind, String, boolean, Function), routeExecute(String, boolean, Function), routeLocal(String, Function) and
routeDiagnostic(String, Function), so overriding one hook covers every overload in that category - auditing,
metrics, tracing or an extra guard in one place. Individual operations and control methods can be
overridden too; call super to keep the routing modes and failover. Give the subclass a
(MultiClusterSetup) constructor and hand it to MultiClusterGigaSpaceConfigurer.proxyFactory
or MultiClusterGigaSpaceFactoryBean.setProxyFactory(Function), so the configurer, a properties file or
Spring build it instead of this class:
public class AuditedGigaSpace extends DefaultMultiClusterGigaSpace {
public AuditedGigaSpace(MultiClusterSetup setup) {
super(setup);
}
protected <R> R routeMutation(OperationKind kind, String operation, boolean async,
Function<GigaSpace, R> call) {
audit.record(operation, getActiveClusterName());
return super.routeMutation(kind, operation, async, call);
}
}
MultiClusterGigaSpace gigaSpace = new MultiClusterGigaSpaceConfigurer()
.cluster("us-east", east)
.cluster("us-west", west)
.proxyFactory(AuditedGigaSpace::new)
.gigaSpace();
Thread-safe: registration, configuration and failover may run concurrently with space operations.
- Since:
- 18.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface MultiClusterGigaSpace
MultiClusterGigaSpace.ClusterStateListener, MultiClusterGigaSpace.FailoverPolicy, MultiClusterGigaSpace.ReadMode, MultiClusterGigaSpace.WriteMode -
Constructor Summary
ConstructorsConstructorDescriptionAn unnamed proxy with no clusters and the default configuration; register clusters to use it.A named proxy with no clusters and the default configuration.DefaultMultiClusterGigaSpace(String name, MultiClusterConfig config) A named proxy with no clusters yet; register them withregisterCluster(String, GigaSpace).DefaultMultiClusterGigaSpace(String name, MultiClusterConfig config, Map<String, ? extends GigaSpace> clusters) A proxy over the given clusters, registered in iteration order - so pass aLinkedHashMapwhen the default failover order matters, sinceMap.of()does not preserve order.DefaultMultiClusterGigaSpace(String name, MultiClusterConfig config, Map<String, ? extends GigaSpace> clusters, boolean jmx) As above, and optionally exposed over JMX asorg.openspaces.core.multicluster:type=MultiClusterGigaSpace,name=NAME- give each proxy in a JVM a distinct name if you turn it on.Builds the proxy from an assembled setup - whatMultiClusterGigaSpaceConfigurerproduces, and the constructor a subclass calls from its own(MultiClusterSetup)constructor so thatMultiClusterGigaSpaceConfigurer.proxyFactorycan build it.DefaultMultiClusterGigaSpace(MultiClusterSetup setup, ClusterAvailability availability) Builds the proxy with availability decided elsewhere, which turns off the built-in health tracking and failover machinery. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClusterEventListener(ClusterEventListener listener) Registers a listener that receives the same events with an explicitClusterEventTyperather than the convention below.voidbooleanaddClusterToPriorityList(String clusterName) Makes a cluster a promotion candidate again, appended to the configured order if it was not in it.booleanaddClusterToReadRotation(String clusterName) Puts a cluster back into round-robin reads after it was removed.aggregate(ISpaceQuery<T> query, AggregationSet aggregationSet) Executes the specified query along with the specified aggregations collocated at the space.aggregate(ISpaceQuery<T> query, AggregationSet aggregationSet, ReadModifiers readModifiers) <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, long timeout) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers) Changes an existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, long timeout) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers) Changes an existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.<T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers, AsyncFutureListener<ChangeResult<T>> listener) Changes existing objects in space in an asynchronous manner, returning immidiately with a future.asyncLoad(SpaceDataSourceLoadRequest spaceDataSourceLoadRequest) Loads data from aSpaceDataSourceon demand The Space data source is created withSpaceDataSourceFactoryLoaded data can be adapted using theSpaceTypeSchemaAdapter<T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, long timeout) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, long timeout, AsyncFutureListener<T> listener) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, long timeout, ReadModifiers modifiers) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, long timeout, ReadModifiers modifiers, AsyncFutureListener<T> listener) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, AsyncFutureListener<T> listener) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(T template) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(T template, long timeout) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(T template, long timeout, AsyncFutureListener<T> listener) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(T template, long timeout, ReadModifiers modifiers) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(T template, long timeout, ReadModifiers modifiers, AsyncFutureListener<T> listener) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncRead(T template, AsyncFutureListener<T> listener) Reads any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, long timeout) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, long timeout, AsyncFutureListener<T> listener) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, long timeout, TakeModifiers modifiers) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, long timeout, TakeModifiers modifiers, AsyncFutureListener<T> listener) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, AsyncFutureListener<T> listener) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(T template) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(T template, long timeout) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(T template, long timeout, AsyncFutureListener<T> listener) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(T template, long timeout, TakeModifiers modifiers) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(T template, long timeout, TakeModifiers modifiers, AsyncFutureListener<T> listener) Take (remove) any matching entry from the space in an asynchronous manner.<T> AsyncFuture<T> asyncTake(T template, AsyncFutureListener<T> listener) Take (remove) any matching entry from the space in an asynchronous manner.<T> ChangeResult<T> change(ISpaceQuery<T> query, ChangeSet changeSet) Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> change(ISpaceQuery<T> query, ChangeSet changeSet, long timeout) Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> change(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers) Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> change(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> change(T template, ChangeSet changeSet, ChangeModifiers modifiers) Changes existing objects in space, returning a change result which provides details of the operation affect.<T> ChangeResult<T> change(T template, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Changes existing objects in space, returning a change result which provides details of the operation affect.voidRemoves the entries that match the specified template and the specified transaction from this space.intclear(Object template, int maxEntries, ClearModifiers modifiers) Removes up tomaxEntriesentries that match the specified template from this space, under the current transaction (if any).intclear(Object template, ClearModifiers modifiers) Removes the entries that match the specified template and the specified transaction from this space.voidDrops the read pin, soREAD_ACTIVEreads follow the write-active cluster again.voidclose()Releases the write executors and the deferred-mutation queue.protected final MultiClusterControlSupportcontrol()The topology and mode controls everyMultiClusterGigaSpacecontrol method delegates to.intCount any matching entry from the space.intcount(Object template, CountModifiers modifiers) Count any matching entries from the space.<T extends Serializable, R>
AsyncFuture<R> execute(DistributedTask<T, R> task) Executes the task on all the primary space nodes within the cluster (broadcast).<T extends Serializable, R>
AsyncFuture<R> execute(DistributedTask<T, R> task, Object... routing) Executes a task on all the nodes that correspond to the list of routing values.<T extends Serializable>
AsyncFuture<T> Executes a task on a specific space node.<T extends Serializable>
AsyncFuture<T> execute(Task<T> task, AsyncFutureListener<T> listener) Executes a task on a specific space node.<T extends Serializable>
AsyncFuture<T> Executes a task on a specific space node.<T extends Serializable>
AsyncFuture<T> execute(Task<T> task, Object routing, AsyncFutureListener<T> listener) Executes a task on a specific space node.executeDurable(UUID uuid) executeDurable(UUID uuid, Object context) <T extends Serializable, R>
ExecutorBuilder<T, R> executorBuilder(AsyncResultsReducer<T, R> reducer) Constructs an executor builder allowing to accumulate different tasks required to be executed into a single execute mechanism with all the results reduced by the reducer provided.voidForcefully triggers failover to the next healthy cluster in the priority list.protected static AggregationSetfreshCopy(AggregationSet aggregationSet) A copy of the aggregation set for one attempt.Returns the currently designated primary active GigaSpace proxy, ornullif none.Returns the name of the currently designated primary active cluster - the one taking mutations - ornullif none.Returns all currently active (in-flight) operations on the space instance backing this proxy.getCluster(String clusterName) Resolves a GigaSpace proxy by its registered cluster name.Returns a clustered view of thisGigaSpaceinstance.getClusterName(GigaSpace spaceProxy) Resolves the registered cluster name for a given GigaSpace proxy instance.The order clusters will actually be promoted in: the configured priorities first, then any registered cluster the configuration omits, minus anything removed byMultiClusterGigaSpace.removeClusterFromPriorityList(String)or dropped after a failure.Returns the current running transaction.Gets the defaultChangeModifiersset during thisGigaSpaceconfiguration.Gets the defaultClearModifiersset during thisGigaSpaceconfiguration.Gets the defaultCountModifiersset during thisGigaSpaceconfiguration.Gets the defaultReadModifiersset during thisGigaSpaceconfiguration.Gets the defaultTakeModifiersset during thisGigaSpaceconfiguration.Gets the defaultWriteModifiersset during thisGigaSpaceconfiguration.Returns the exception translator associated with this GigaSpace instance.intReturns the consecutive failure threshold.Returns the rolling failure window.Returns the last completed operations on the space instance backing this proxy (up to configured max).getLastOperations(int limit) Returns the last completed operations on the space instance backing this proxy, up to the given limit.getName()Returns the name of the GigaSpace.The proxy of the clusterMultiClusterGigaSpace.getReadActiveClusterName()names, ornull.The clusterMultiClusterGigaSpace.ReadMode.READ_ACTIVEreads go to: the pinned read cluster, or the active cluster when nothing is pinned.The clusters currently eligible forMultiClusterGigaSpace.ReadMode.READ_ROUND_ROBINreads, in registration order.Returns the registered clusters, keyed by name, in registration order.getSpace()Returns theIJSpaceused by this GigaSpace implementation to delegate different space operations.Returns the space name.getStats()Per-cluster operation counters, failures and observed latency.Returns the transaction provider allowing to access the current running transaction.Gets the type manager of this GigaSpace instance.booleanisClusterHealthy(String clusterName) Returns true if the cluster identified by name is reachable.booleanisClusterHealthy(GigaSpace spaceProxy) Returns true if the specified GigaSpace cluster instance is reachable.booleanReturns wether or not this space is secured.<T> SpaceIterator<T> iterator(ISpaceQuery<T> template) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(ISpaceQuery<T> template, int batchSize) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(ISpaceQuery<T> template, int batchSize, ReadModifiers modifiers) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(ISpaceQuery<T> template, SpaceIteratorConfiguration spaceIteratorConfiguration) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(T template) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(T template, int batchSize) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(T template, int batchSize, ReadModifiers modifiers) Returns an iterator over the entries in the space which match the specified template.<T> SpaceIterator<T> iterator(T template, SpaceIteratorConfiguration spaceIteratorConfiguration) Returns an iterator over the entries in the space which match the specified template.Creates a new DataEventSession with the default configuration.Creates a new DataEventSession with the specified configuration.<T> ISpaceQuery<T> prepareTemplate(Object template) Translates the template object into pre-processed packet which will be sent to the space.<T> Tread(ISpaceQuery<T> template) Read any matching object from the space, blocking until one exists.<T> Tread(ISpaceQuery<T> template, long timeout) Read any matching object from the space, blocking until one exists.<T> Tread(ISpaceQuery<T> template, long timeout, ReadModifiers modifiers) Read any matching object from the space, blocking until one exists.<T> Tread(T template) Read any matching object from the space, blocking until one exists.<T> Tread(T template, long timeout) Read any matching object from the space, blocking until one exists.<T> Tread(T template, long timeout, ReadModifiers modifiers) Read any matching object from the space, blocking until one exists.<T> TRead an object from the space matching the specified id query.<T> TRead an object from the space matching the specified id query.<T> TreadById(IdQuery<T> query, long timeout, ReadModifiers modifiers) Read an object from the space matching the specified id query.<T> TRead an object from the space matching its id and the class.<T> TRead an object from the space matching its id, the class and the routing value.<T> TRead an object from the space matching its id, the class and the routing value.<T> TreadById(Class<T> clazz, Object id, Object routing, long timeout, ReadModifiers modifiers) Read an object from the space matching its id, the class and the routing value.<T> ReadByIdsResult<T> Read objects from the space matching the specified IDs query.<T> ReadByIdsResult<T> readByIds(IdsQuery<T> query, ReadModifiers modifiers) Read objects from the space matching the specified IDs query, with the providedReadModifiers.<T> ReadByIdsResult<T> Read objects from the space matching their IDs and the specified class.<T> ReadByIdsResult<T> Read objects from the space matching their IDs, the specified class and routing key.<T> ReadByIdsResult<T> Read objects from the space matching their IDs, the specified class and the routing keys.<T> ReadByIdsResult<T> readByIds(Class<T> clazz, Object[] ids, Object[] routingKeys, ReadModifiers modifiers) Read objects from the space matching their IDs, the specified class and the routing keys, with the providedReadModifiers.<T> ReadByIdsResult<T> readByIds(Class<T> clazz, Object[] ids, Object routingKey, ReadModifiers modifiers) Read objects from the space matching their IDs, the specified class type and routing key, with the providedReadModifiers.<T> TreadIfExists(ISpaceQuery<T> template) Read any matching object from the space, returningnullif there currently is none.<T> TreadIfExists(ISpaceQuery<T> template, long timeout) Read any matching object from the space, returningnullif there currently is none.<T> TreadIfExists(ISpaceQuery<T> template, long timeout, ReadModifiers modifiers) Read any matching object from the space, returningnullif there currently is none.<T> TreadIfExists(T template) Read any matching object from the space, returningnullif there currently is none.<T> TreadIfExists(T template, long timeout) Read any matching object from the space, returningnullif there currently is none.<T> TreadIfExists(T template, long timeout, ReadModifiers modifiers) Read any matching object from the space, returningnullif there currently is none.<T> TreadIfExistsById(IdQuery<T> query) Read an object from the space matching the specified id query.<T> TreadIfExistsById(IdQuery<T> query, long timeout) Read an object from the space matching the specified id query.<T> TreadIfExistsById(IdQuery<T> query, long timeout, ReadModifiers modifiers) Read an object from the space matching the specified id query.<T> TreadIfExistsById(Class<T> clazz, Object id) Read an object from the space matching its id and the class.<T> TreadIfExistsById(Class<T> clazz, Object id, Object routing) Read an object from the space matching its id, the class and the routing value.<T> TreadIfExistsById(Class<T> clazz, Object id, Object routing, long timeout) Read an object from the space matching its id, the class and the routing value.<T> TreadIfExistsById(Class<T> clazz, Object id, Object routing, long timeout, ReadModifiers modifiers) Read an object from the space matching its id, the class and the routing value.<T> T[]readMultiple(ISpaceQuery<T> template) Read any matching entries from the space.<T> T[]readMultiple(ISpaceQuery<T> template, int maxEntries) Read any matching entries from the space.<T> T[]readMultiple(ISpaceQuery<T> template, int maxEntries, ReadModifiers modifiers) Read any matching entries from the space.<T> T[]readMultiple(T template) Read any matching entries from the space.<T> T[]readMultiple(T template, int maxEntries) Read any matching entries from the space.<T> T[]readMultiple(T template, int maxEntries, ReadModifiers modifiers) Read any matching entries from the space.voidregisterCluster(String clusterName, GigaSpace spaceProxy) Registers a GigaSpace cluster proxy target under a named identifier.<T extends Serializable, R>
UUIDregisterDurableTask(DurableTask<T, R> eventTask) voidbooleanremoveClusterFromPriorityList(String clusterName) Removes a cluster from failover promotion without unregistering it.booleanremoveClusterFromReadRotation(String clusterName) Takes a cluster out of round-robin reads.voidrouteDiagnostic(String operation, Function<GigaSpace, ?> call) Runs a diagnostic call on every registered cluster and concatenates the results.protected <R> RrouteExecute(String operation, boolean durable, Function<GigaSpace, R> call) Runs a task or durable-task operation on the active cluster; a plainexecuteis also fanned out whenfanOutTasksis on.protected <R> RrouteLocal(String operation, Function<GigaSpace, R> call) Runs a local or metadata call (getName, getSpace, default modifiers, ...) against the active cluster's proxy, without health tracking or failover.protected <R> RrouteMutation(OperationKind kind, String operation, boolean async, Function<GigaSpace, R> call) Runs a mutation (write, take, change, clear, ...) per the write mode: on the active cluster only, or fanned out to the others as well.protected final MultiClusterRouterrouter()The router, for tests and for embeddings that need the health monitor or the deferred queue.protected <R> RRuns a read-style operation (read, count, readMultiple, aggregate, iterator, ...) on the cluster the read mode selects, retrying elsewhere per the failover policy.voidsetActiveCluster(String clusterName) Sets the primary active cluster by name.voidsetActiveCluster(GigaSpace spaceProxy) Sets the primary active cluster by direct instance reference.voidsetClusterPriorityList(List<String> priorityNames) Sets the ordered fallback list of cluster names for automated promotion.voidvoidsetFailureThreshold(int consecutiveFailuresThreshold) Sets the consecutive failure threshold required before marking a cluster unhealthy.voidsetFailureWindow(Duration failureWindow) Defines the rolling window duration for error threshold evaluation.voidsetMVCCGenerationsState(MVCCGenerationsState generationsState) voidsetQuiesceToken(QuiesceToken token) voidsetReadActiveCluster(String clusterName) PinsMultiClusterGigaSpace.ReadMode.READ_ACTIVEreads toclusterName, separately from the cluster taking mutations - a dedicated read cluster and a dedicated write cluster.voidprotected static MultiClusterSetupsetupFor(String name, MultiClusterConfig config, Map<String, ? extends GigaSpace> clusters, boolean jmx) Assembles a setup from a name, a configuration and clusters registered in iteration order, for a subclass that offers the same convenience constructors as this class.voidsetWriteActiveCluster(String clusterName) MakesclusterNamethe write-active cluster: mutations, transactions, task execution and metadata calls go there.void<T> ISpaceQuery<T> The process of serializing an entry for transmission to a JavaSpaces service will be identical if the same entry is used twice.<T> Ttake(ISpaceQuery<T> template) Take (remove) any matching entry from the space, blocking until one exists.<T> Ttake(ISpaceQuery<T> template, long timeout) Take (remove) any matching entry from the space, blocking until one exists.<T> Ttake(ISpaceQuery<T> template, long timeout, TakeModifiers modifiers) Take (remove) any matching entry from the space, blocking until one exists.<T> Ttake(T template) Take (remove) any matching entry from the space, blocking until one exists.<T> Ttake(T template, long timeout) Take (remove) any matching entry from the space, blocking until one exists.<T> Ttake(T template, long timeout, TakeModifiers modifiers) Take (remove) any matching entry from the space, blocking until one exists.<T> TTake (remove) an object from the space matching the specified id query.<T> TTake (remove) an object from the space matching the specified id query.<T> TtakeById(IdQuery<T> query, long timeout, TakeModifiers modifiers) Take (remove) an object from the space matching the specified id query.<T> TTake (remove) an object from the space matching its id and the class.<T> TTake (remove) an object from the space matching its id, the class and the routing value.<T> TTake (remove) an object from the space matching its id, the class and the routing value.<T> TtakeById(Class<T> clazz, Object id, Object routing, long timeout, TakeModifiers modifiers) Take (remove) an object from the space matching its id, the class and the routing value.<T> TakeByIdsResult<T> Take (remove) objects from the space matching the specified IDs query.<T> TakeByIdsResult<T> takeByIds(IdsQuery<T> query, TakeModifiers modifiers) Take (remove) objects from the space matching the specified IDs query, with the providedReadModifiers.<T> TakeByIdsResult<T> Take (remove) objects from the space matching their IDs and the specified class.<T> TakeByIdsResult<T> Take (remove) objects from the space matching their IDs, the specified class and routing key.<T> TakeByIdsResult<T> Take (remove) objects from the space matching their IDs, the specified class and the routing keys.<T> TakeByIdsResult<T> takeByIds(Class<T> clazz, Object[] ids, Object[] routingKeys, TakeModifiers modifiers) Take (remove) objects from the space matching their IDs, the specified class and the routing keys, with the providedReadModifiers.<T> TakeByIdsResult<T> takeByIds(Class<T> clazz, Object[] ids, Object routingKey, TakeModifiers modifiers) Take (remove) objects from the space matching their IDs, the specified class type and routing key, with the providedReadModifiers.<T> TtakeIfExists(ISpaceQuery<T> template) Take (remove) any matching entry from the space, returningnullif there currently is none.<T> TtakeIfExists(ISpaceQuery<T> template, long timeout) Take (remove) any matching entry from the space, returningnullif there currently is none.<T> TtakeIfExists(ISpaceQuery<T> template, long timeout, TakeModifiers modifiers) Take (remove) any matching entry from the space, returningnullif there currently is none.<T> TtakeIfExists(T template) Take (remove) any matching entry from the space, returningnullif there currently is none.<T> TtakeIfExists(T template, long timeout) Take (remove) any matching entry from the space, returningnullif there currently is none.<T> TtakeIfExists(T template, long timeout, TakeModifiers modifiers) Take (remove) any matching entry from the space, returningnullif there currently is none.<T> TtakeIfExistsById(IdQuery<T> query) Take (remove) an object from the space matching the specified id query.<T> TtakeIfExistsById(IdQuery<T> query, long timeout) Take (remove) an object from the space matching the specified id query.<T> TtakeIfExistsById(IdQuery<T> query, long timeout, TakeModifiers modifiers) Take (remove) an object from the space matching the specified id query.<T> TtakeIfExistsById(Class<T> clazz, Object id) Take (remove) an object from the space matching its id and the class.<T> TtakeIfExistsById(Class<T> clazz, Object id, Object routing) Take (remove) an object from the space matching its id, the class and the routing value.<T> TtakeIfExistsById(Class<T> clazz, Object id, Object routing, long timeout) Take (remove) an object from the space matching its id, the class and the routing value.<T> TtakeIfExistsById(Class<T> clazz, Object id, Object routing, long timeout, TakeModifiers modifiers) Take (remove) an object from the space matching its id, the class and the routing value.<T> T[]takeMultiple(ISpaceQuery<T> template) Takes (removes) all the entries matching the specified template from this space.<T> T[]takeMultiple(ISpaceQuery<T> template, int maxEntries) Takes (removes) all the entries matching the specified template from this space.<T> T[]takeMultiple(ISpaceQuery<T> template, int maxEntries, TakeModifiers modifiers) Takes (removes) all the entries matching the specified template from this space.<T> T[]takeMultiple(T template) Takes (removes) all the entries matching the specified template from this space.<T> T[]takeMultiple(T template, int maxEntries) Takes (removes) all the entries matching the specified template from this space.<T> T[]takeMultiple(T template, int maxEntries, TakeModifiers modifiers) Takes (removes) all the entries matching the specified template from this space.toString()voidunregisterCluster(String clusterName) Unregisters a target cluster by name.voidunregisterCluster(GigaSpace spaceProxy) Unregisters a target cluster by its proxy instance.<T> LeaseContext<T> write(T entry) Writes a new object to the space, returning itsLeaseContext.<T> LeaseContext<T> write(T entry, long lease) Writes a new object to the space, returning itsLeaseContext.<T> LeaseContext<T> write(T entry, long lease, long timeout, WriteModifiers modifiers) Writes a new object to the space, returning itsLeaseContext.<T> LeaseContext<T> write(T entry, WriteModifiers modifiers) Writes a new object to the space, returning itsLeaseContext.<T> LeaseContext<T>[]writeMultiple(T[] entries) Writes the specified entries to this space.<T> LeaseContext<T>[]writeMultiple(T[] entries, long lease) Writes the specified entries to this space.<T> LeaseContext<T>[]writeMultiple(T[] entries, long[] leases, long timeout, WriteModifiers modifiers) Writes the specified entries to this space.<T> LeaseContext<T>[]writeMultiple(T[] entries, long[] leases, WriteModifiers modifiers) Writes the specified entries to this space.<T> LeaseContext<T>[]writeMultiple(T[] entries, long lease, long timeout, WriteModifiers modifiers) Writes the specified entries to this space.<T> LeaseContext<T>[]writeMultiple(T[] entries, long lease, WriteModifiers modifiers) Writes the specified entries to this space.<T> LeaseContext<T>[]writeMultiple(T[] entries, WriteModifiers modifiers) Writes the specified entries to this space.
-
Constructor Details
-
DefaultMultiClusterGigaSpace
public DefaultMultiClusterGigaSpace()An unnamed proxy with no clusters and the default configuration; register clusters to use it. -
DefaultMultiClusterGigaSpace
A named proxy with no clusters and the default configuration. -
DefaultMultiClusterGigaSpace
A named proxy with no clusters yet; register them withregisterCluster(String, GigaSpace). -
DefaultMultiClusterGigaSpace
public DefaultMultiClusterGigaSpace(String name, MultiClusterConfig config, Map<String, ? extends GigaSpace> clusters) A proxy over the given clusters, registered in iteration order - so pass aLinkedHashMapwhen the default failover order matters, sinceMap.of()does not preserve order. The first cluster registered becomes the active one. -
DefaultMultiClusterGigaSpace
public DefaultMultiClusterGigaSpace(String name, MultiClusterConfig config, Map<String, ? extends GigaSpace> clusters, boolean jmx) As above, and optionally exposed over JMX asorg.openspaces.core.multicluster:type=MultiClusterGigaSpace,name=NAME- give each proxy in a JVM a distinct name if you turn it on. -
DefaultMultiClusterGigaSpace
Builds the proxy from an assembled setup - whatMultiClusterGigaSpaceConfigurerproduces, and the constructor a subclass calls from its own(MultiClusterSetup)constructor so thatMultiClusterGigaSpaceConfigurer.proxyFactorycan build it. Treat the setup as opaque: pass it on, do not take it apart. -
DefaultMultiClusterGigaSpace
Builds the proxy with availability decided elsewhere, which turns off the built-in health tracking and failover machinery. Internal: used by tests and by embeddings that track cluster health themselves.
-
-
Method Details
-
setupFor
protected static MultiClusterSetup setupFor(String name, MultiClusterConfig config, Map<String, ? extends GigaSpace> clusters, boolean jmx) Assembles a setup from a name, a configuration and clusters registered in iteration order, for a subclass that offers the same convenience constructors as this class. -
router
The router, for tests and for embeddings that need the health monitor or the deferred queue. -
control
The topology and mode controls everyMultiClusterGigaSpacecontrol method delegates to. -
routeRead
Runs a read-style operation (read, count, readMultiple, aggregate, iterator, ...) on the cluster the read mode selects, retrying elsewhere per the failover policy.- Parameters:
operation- the GigaSpace method name, used in logs, stats and error messages
-
routeMutation
protected <R> R routeMutation(OperationKind kind, String operation, boolean async, Function<GigaSpace, R> call) Runs a mutation (write, take, change, clear, ...) per the write mode: on the active cluster only, or fanned out to the others as well.- Parameters:
kind- what the mutation is, which decides how it may be fanned out and retriedasync- whether the operation returns a future, so the fan-out must not block on it
-
routeExecute
-
routeLocal
-
routeDiagnostic
-
registerCluster
Description copied from interface:MultiClusterGigaSpaceRegisters a GigaSpace cluster proxy target under a named identifier. The first cluster registered becomes the active one unless an active cluster was already chosen.- Specified by:
registerClusterin interfaceMultiClusterGigaSpace
-
unregisterCluster
Description copied from interface:MultiClusterGigaSpaceUnregisters a target cluster by name. If it was the active cluster, the next cluster in the priority list is promoted.- Specified by:
unregisterClusterin interfaceMultiClusterGigaSpace
-
unregisterCluster
Description copied from interface:MultiClusterGigaSpaceUnregisters a target cluster by its proxy instance.- Specified by:
unregisterClusterin interfaceMultiClusterGigaSpace
-
setActiveCluster
Description copied from interface:MultiClusterGigaSpaceSets the primary active cluster by name. It takes the mutations and, with any read pin dropped, theMultiClusterGigaSpace.ReadMode.READ_ACTIVEreads too - reads and writes are back on one cluster.- Specified by:
setActiveClusterin interfaceMultiClusterGigaSpace- See Also:
-
setActiveCluster
Description copied from interface:MultiClusterGigaSpaceSets the primary active cluster by direct instance reference.- Specified by:
setActiveClusterin interfaceMultiClusterGigaSpace
-
getActiveClusterName
Description copied from interface:MultiClusterGigaSpaceReturns the name of the currently designated primary active cluster - the one taking mutations - ornullif none.- Specified by:
getActiveClusterNamein interfaceMultiClusterGigaSpace
-
getActiveCluster
Description copied from interface:MultiClusterGigaSpaceReturns the currently designated primary active GigaSpace proxy, ornullif none.- Specified by:
getActiveClusterin interfaceMultiClusterGigaSpace
-
setWriteActiveCluster
Description copied from interface:MultiClusterGigaSpaceMakesclusterNamethe write-active cluster: mutations, transactions, task execution and metadata calls go there. UnlikeMultiClusterGigaSpace.setActiveCluster(String)it leaves a pinned read cluster alone; with no pin,READ_ACTIVEreads follow the write role as usual.- Specified by:
setWriteActiveClusterin interfaceMultiClusterGigaSpace
-
setReadActiveCluster
Description copied from interface:MultiClusterGigaSpacePinsMultiClusterGigaSpace.ReadMode.READ_ACTIVEreads toclusterName, separately from the cluster taking mutations - a dedicated read cluster and a dedicated write cluster.Reads served there see a write only once the WAN Gateway or a
WRITE_SYNCfan-out has carried it over, so this gives up read-your-writes. Reads inside a transaction still go to the write-active cluster, where the transaction is. If the pinned cluster becomes unreachable the read role fails over on its own, to the next cluster in priority order that is not taking the writes, and the write role is left alone.MultiClusterGigaSpace.ReadMode.READ_ROUND_ROBINreads ignore the pin.- Specified by:
setReadActiveClusterin interfaceMultiClusterGigaSpace
-
clearReadActiveCluster
public void clearReadActiveCluster()Description copied from interface:MultiClusterGigaSpaceDrops the read pin, soREAD_ACTIVEreads follow the write-active cluster again.- Specified by:
clearReadActiveClusterin interfaceMultiClusterGigaSpace
-
getReadActiveClusterName
Description copied from interface:MultiClusterGigaSpaceThe clusterMultiClusterGigaSpace.ReadMode.READ_ACTIVEreads go to: the pinned read cluster, or the active cluster when nothing is pinned.nullif there is neither.- Specified by:
getReadActiveClusterNamein interfaceMultiClusterGigaSpace
-
getReadActiveCluster
Description copied from interface:MultiClusterGigaSpaceThe proxy of the clusterMultiClusterGigaSpace.getReadActiveClusterName()names, ornull.- Specified by:
getReadActiveClusterin interfaceMultiClusterGigaSpace
-
getRegisteredClusters
Description copied from interface:MultiClusterGigaSpaceReturns the registered clusters, keyed by name, in registration order.- Specified by:
getRegisteredClustersin interfaceMultiClusterGigaSpace
-
getCluster
Description copied from interface:MultiClusterGigaSpaceResolves a GigaSpace proxy by its registered cluster name.- Specified by:
getClusterin interfaceMultiClusterGigaSpace
-
getClusterName
Description copied from interface:MultiClusterGigaSpaceResolves the registered cluster name for a given GigaSpace proxy instance.- Specified by:
getClusterNamein interfaceMultiClusterGigaSpace
-
setWriteMode
- Specified by:
setWriteModein interfaceMultiClusterGigaSpace
-
getWriteMode
- Specified by:
getWriteModein interfaceMultiClusterGigaSpace
-
setReadMode
- Specified by:
setReadModein interfaceMultiClusterGigaSpace
-
getReadMode
- Specified by:
getReadModein interfaceMultiClusterGigaSpace
-
setFailoverPolicy
- Specified by:
setFailoverPolicyin interfaceMultiClusterGigaSpace
-
getFailoverPolicy
- Specified by:
getFailoverPolicyin interfaceMultiClusterGigaSpace
-
setClusterPriorityList
Description copied from interface:MultiClusterGigaSpaceSets the ordered fallback list of cluster names for automated promotion. Registered clusters missing from the list keep their registration order behind the listed ones.- Specified by:
setClusterPriorityListin interfaceMultiClusterGigaSpace
-
getClusterPriorityList
Description copied from interface:MultiClusterGigaSpaceThe order clusters will actually be promoted in: the configured priorities first, then any registered cluster the configuration omits, minus anything removed byMultiClusterGigaSpace.removeClusterFromPriorityList(String)or dropped after a failure.It reports what failover will do rather than what was once configured - a cluster removed on failure is gone from this list, and one registered afterwards appears in it.
- Specified by:
getClusterPriorityListin interfaceMultiClusterGigaSpace
-
addClusterToPriorityList
Description copied from interface:MultiClusterGigaSpaceMakes a cluster a promotion candidate again, appended to the configured order if it was not in it.- Specified by:
addClusterToPriorityListin interfaceMultiClusterGigaSpace- Returns:
trueif this call changed the list
-
removeClusterFromPriorityList
Description copied from interface:MultiClusterGigaSpaceRemoves a cluster from failover promotion without unregistering it.A cluster removed this way is not silently re-appended by the fallback ordering, unlike one that was simply never listed - otherwise a cluster dropped after a failure would be re-elected by the next promotion.
- Specified by:
removeClusterFromPriorityListin interfaceMultiClusterGigaSpace- Returns:
trueif this call changed the list
-
getReadRotation
Description copied from interface:MultiClusterGigaSpaceThe clusters currently eligible forMultiClusterGigaSpace.ReadMode.READ_ROUND_ROBINreads, in registration order.Registering a cluster puts it in the rotation. A failure takes it out - and leaves it out until this application decides it is ready, which is what
MultiClusterGigaSpace.addClusterToReadRotation(String)is for.- Specified by:
getReadRotationin interfaceMultiClusterGigaSpace
-
addClusterToReadRotation
Description copied from interface:MultiClusterGigaSpacePuts a cluster back into round-robin reads after it was removed.- Specified by:
addClusterToReadRotationin interfaceMultiClusterGigaSpace- Returns:
trueif this call changed the rotation
-
removeClusterFromReadRotation
Description copied from interface:MultiClusterGigaSpaceTakes a cluster out of round-robin reads. It stays registered, and stays usable as the active cluster: the rotation governs balanced reads only, so removing the active cluster from it does not stop reads reaching that cluster throughMultiClusterGigaSpace.ReadMode.READ_ACTIVE.- Specified by:
removeClusterFromReadRotationin interfaceMultiClusterGigaSpace- Returns:
trueif this call changed the rotation
-
setFailureThreshold
public void setFailureThreshold(int consecutiveFailuresThreshold) Description copied from interface:MultiClusterGigaSpaceSets the consecutive failure threshold required before marking a cluster unhealthy.- Specified by:
setFailureThresholdin interfaceMultiClusterGigaSpace
-
getFailureThreshold
public int getFailureThreshold()Description copied from interface:MultiClusterGigaSpaceReturns the consecutive failure threshold.- Specified by:
getFailureThresholdin interfaceMultiClusterGigaSpace
-
setFailureWindow
Description copied from interface:MultiClusterGigaSpaceDefines the rolling window duration for error threshold evaluation.- Specified by:
setFailureWindowin interfaceMultiClusterGigaSpace
-
getFailureWindow
Description copied from interface:MultiClusterGigaSpaceReturns the rolling failure window.- Specified by:
getFailureWindowin interfaceMultiClusterGigaSpace
-
isClusterHealthy
Description copied from interface:MultiClusterGigaSpaceReturns true if the cluster identified by name is reachable.- Specified by:
isClusterHealthyin interfaceMultiClusterGigaSpace
-
isClusterHealthy
Description copied from interface:MultiClusterGigaSpaceReturns true if the specified GigaSpace cluster instance is reachable.- Specified by:
isClusterHealthyin interfaceMultiClusterGigaSpace
-
failoverToNextCluster
public void failoverToNextCluster()Description copied from interface:MultiClusterGigaSpaceForcefully triggers failover to the next healthy cluster in the priority list.- Specified by:
failoverToNextClusterin interfaceMultiClusterGigaSpace
-
addClusterStateListener
- Specified by:
addClusterStateListenerin interfaceMultiClusterGigaSpace
-
removeClusterStateListener
- Specified by:
removeClusterStateListenerin interfaceMultiClusterGigaSpace
-
addClusterEventListener
Description copied from interface:MultiClusterGigaSpaceRegisters a listener that receives the same events with an explicitClusterEventTyperather than the convention below.- Specified by:
addClusterEventListenerin interfaceMultiClusterGigaSpace
-
removeClusterEventListener
- Specified by:
removeClusterEventListenerin interfaceMultiClusterGigaSpace
-
getName
-
getSpaceName
Description copied from interface:GigaSpaceReturns the space name.- Specified by:
getSpaceNamein interfaceGigaSpace
-
isSecured
-
getSpace
Description copied from interface:GigaSpaceReturns theIJSpaceused by this GigaSpace implementation to delegate different space operations.Allows the use of space operations that are not exposed by this interface, as well as use as a parameter to other low level GigaSpace components.
If a transaction object is required for low level operations (as low level operations do not have declarative transaction ex) the
GigaSpace.getTxProvider()should be used to acquire the current running transaction. -
getClustered
Description copied from interface:GigaSpaceReturns a clustered view of thisGigaSpaceinstance.GigaSpace gigaSpace = new GigaSpaceConfigurer(space).clustered(true).gigaSpace();
If this instance is already a clustered view (was initially constructed using the clustered flag), will return the same instance being used to issue the call. If this is a GigaSpace that works directly with a cluster member, will return a clustered view (as if it was constructed with the clustered flag set). Note that this method might return different instances when being called by different threads.GigaSpace nonClusteredViewOfGigaSpace= ... // acquire non-clustered view of a clustered space GigaSpace space=nonClusteredViewofGigaSpace.getClustered(); // space != nonClusteredViewOfSpace
GigaSpace clusteredViewOfGigaSpace= ... // acquire clustered view of a clustered space GigaSpace space=clusteredViewofGigaSpace.getClustered(); // space == clusteredViewOfSpace
- Specified by:
getClusteredin interfaceGigaSpace- See Also:
-
getTxProvider
Description copied from interface:GigaSpaceReturns the transaction provider allowing to access the current running transaction.- Specified by:
getTxProviderin interfaceGigaSpace
-
getCurrentTransaction
Description copied from interface:GigaSpaceReturns the current running transaction. Can benullif no transaction is in progress.- Specified by:
getCurrentTransactionin interfaceGigaSpace
-
getExceptionTranslator
Description copied from interface:GigaSpaceReturns the exception translator associated with this GigaSpace instance.- Specified by:
getExceptionTranslatorin interfaceGigaSpace
-
getDefaultWriteModifiers
Description copied from interface:GigaSpaceGets the defaultWriteModifiersset during thisGigaSpaceconfiguration. This value is configured either by using aGigaSpaceConfigureror through the pu.xml.- Specified by:
getDefaultWriteModifiersin interfaceGigaSpace
-
getDefaultClearModifiers
Description copied from interface:GigaSpaceGets the defaultClearModifiersset during thisGigaSpaceconfiguration. This value is configured either by using aGigaSpaceConfigureror through the pu.xml.- Specified by:
getDefaultClearModifiersin interfaceGigaSpace
-
getDefaultCountModifiers
Description copied from interface:GigaSpaceGets the defaultCountModifiersset during thisGigaSpaceconfiguration. This value is configured either by using aGigaSpaceConfigureror through the pu.xml. If there is an active transaction and that transaction has any isolation level set on it, that isolation level will be merged into the returned modifiers with any previously set isolation level on the modifiers overriden.- Specified by:
getDefaultCountModifiersin interfaceGigaSpace
-
getDefaultReadModifiers
Description copied from interface:GigaSpaceGets the defaultReadModifiersset during thisGigaSpaceconfiguration. This value is configured either by using aGigaSpaceConfigureror through the pu.xml. If there is an active transaction and that transaction has any isolation level set on it, that isolation level will be merged into the returned modifiers with any previously set isolation level on the modifiers overriden.- Specified by:
getDefaultReadModifiersin interfaceGigaSpace
-
getDefaultTakeModifiers
Description copied from interface:GigaSpaceGets the defaultTakeModifiersset during thisGigaSpaceconfiguration. This value is configured either by using aGigaSpaceConfigureror through the pu.xml.- Specified by:
getDefaultTakeModifiersin interfaceGigaSpace
-
getDefaultChangeModifiers
Description copied from interface:GigaSpaceGets the defaultChangeModifiersset during thisGigaSpaceconfiguration. This value is configured either by using aGigaSpaceConfigureror through the pu.xml.- Specified by:
getDefaultChangeModifiersin interfaceGigaSpace
-
clear
Description copied from interface:GigaSpaceRemoves the entries that match the specified template and the specified transaction from this space.If the clear operation conducted without transaction (null as value) it will clear all entries that are not under transaction. Therefore entries under transaction would not be removed from the space.
The clear operation supports inheritance, therefore template class matching objects and its sub classes matching objects are part of the candidates population to be removed from the space. You can in fact clean all space objects (that are not under transaction) by calling:
gigaSpace.clear(null).Notice: The clear operation does not remove notify templates, i.e. registration for notifications.
-
clear
Description copied from interface:GigaSpaceRemoves the entries that match the specified template and the specified transaction from this space.If the clear operation conducted without transaction (null as value) it will clear all entries that are not under transaction. Therefore entries under transaction would not be removed from the space.
The clear operation supports inheritance, therefore template class matching objects and its sub classes matching objects are part of the candidates population to be removed from the space. You can in fact remove all space objects (that are not under transaction) by calling:
gigaSpace.clear(null).Notice: The clear operation does not remove notify templates i.e. registration for notifications.
- Specified by:
clearin interfaceGigaSpace- Parameters:
template- the template to use for matchingmodifiers- one or a union ofClearModifiers.- Returns:
- The number of cleared entries
-
clear
Description copied from interface:GigaSpaceRemoves up tomaxEntriesentries that match the specified template from this space, under the current transaction (if any). In mixed-version rolling upgrades, bounded clear may fall back to an unbounded clear to maintain cluster consistency, in which case more thanmaxEntriesentries may be removed. If executed without a transaction, only entries not under transaction are cleared. The clear operation supports inheritance.Notice: The clear operation does not remove notify templates i.e. registration for notifications.
- Specified by:
clearin interfaceGigaSpace- Parameters:
template- the template to use for matchingmaxEntries- the maximum number of entries to remove. UseInteger.MAX_VALUEfor an unbounded clear (equivalent toGigaSpace.clear(Object, ClearModifiers)).modifiers- one or a union ofClearModifiers.- Returns:
- The number of cleared entries
-
count
Description copied from interface:GigaSpaceCount any matching entry from the space. If a running within a transaction will count all the entries visible under the transaction. -
count
Description copied from interface:GigaSpaceCount any matching entries from the space. If this is running within a transaction will count all the entries visible under the transaction.Allows to specify modifiers using
ReadModifierswhich allows to programmatically control the isolation level this count operation will be performed under.- Specified by:
countin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").modifiers- one or a union ofCountModifiers.- Returns:
- The number of matching entries
-
snapshot
Description copied from interface:GigaSpaceThe process of serializing an entry for transmission to a JavaSpaces service will be identical if the same entry is used twice. This is most likely to be an issue with templates that are used repeatedly to search for entries with read or take.
The client-side implementations of read and take cannot reasonably avoid this duplicated effort, since they have no efficient way of checking whether the same template is being used without intervening modification.
The snapshot method gives the JavaSpaces service implementor a way to reduce the impact of repeated use of the same entry. Invoking snapshot with an Entry will return another Entry object that contains a snapshot of the original entry. Using the returned snapshot entry is equivalent to using the unmodified original entry in all operations on the same JavaSpaces service.
Modifications to the original entry will not affect the snapshot. You can snapshot a null template; snapshot may or may not return null given a null template. The entry returned from snapshot will be guaranteed equivalent to the original unmodified object only when used with the space. Using the snapshot with any other JavaSpaces service will generate an
IllegalArgumentExceptionunless the other space can use it because of knowledge about the JavaSpaces service that generated the snapshot.The snapshot will be a different object from the original, may or may not have the same hash code, and equals may or may not return true when invoked with the original object, even if the original object is unmodified. A snapshot is guaranteed to work only within the virtual machine in which it was generated. If a snapshot is passed to another virtual machine (for example, in a parameter of an RMI call), using it--even with the same JavaSpaces service--may generate an
IllegalArgumentException. -
readById
Description copied from interface:GigaSpaceRead an object from the space matching its id and the class. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.readById(Class, Object, Object)can be used to specify the routing. -
readById
Description copied from interface:GigaSpaceRead an object from the space matching its id, the class and the routing value. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
readById
Description copied from interface:GigaSpaceRead an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.- Specified by:
readByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the space- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readById
public <T> T readById(Class<T> clazz, Object id, Object routing, long timeout, ReadModifiers modifiers) Description copied from interface:GigaSpaceRead an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.- Specified by:
readByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofReadModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readById
Description copied from interface:GigaSpaceRead an object from the space matching the specified id query. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.readById(Class, Object, Object)can be used to specify the routing. -
readById
Description copied from interface:GigaSpaceRead an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout. -
readById
Description copied from interface:GigaSpaceRead an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout.- Specified by:
readByIdin interfaceGigaSpace- Parameters:
query- Query to search by.timeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofReadModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
read
public <T> T read(T template) Description copied from interface:GigaSpaceRead any matching object from the space, blocking until one exists. Returnnullif the timeout expires.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
readin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").- Returns:
- A copy of the object read from the space.
-
read
public <T> T read(T template, long timeout) Description copied from interface:GigaSpaceRead any matching object from the space, blocking until one exists. Returnnullif the timeout expires.- Specified by:
readin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.- Returns:
- A copy of the object read from the space.
-
read
Description copied from interface:GigaSpaceRead any matching object from the space, blocking until one exists. Returnnullif the timeout expires.Overloads
GigaSpace.read(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
readin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the object read from the space.
-
read
Description copied from interface:GigaSpaceRead any matching object from the space, blocking until one exists. Returnnullif the timeout expires.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
read
Description copied from interface:GigaSpaceRead any matching object from the space, blocking until one exists. Returnnullif the timeout expires.- Specified by:
readin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.- Returns:
- A copy of the object read from the space.
-
read
Description copied from interface:GigaSpaceRead any matching object from the space, blocking until one exists. Returnnullif the timeout expires.Overloads
GigaSpace.read(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
readin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").listener- A listener to be notified when a result arrives- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.listener- A listener to be notified when a result arrives- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Overloads
GigaSpace.asyncRead(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the object read from the space.
-
asyncRead
public <T> AsyncFuture<T> asyncRead(T template, long timeout, ReadModifiers modifiers, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Overloads
GigaSpace.asyncRead(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.listener- A listener to be notified when a result arrives- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.- Returns:
- A copy of the object read from the space.
-
asyncRead
public <T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, long timeout, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.listener- A listener to be notified when a result arrives- Returns:
- A copy of the object read from the space.
-
asyncRead
Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Overloads
GigaSpace.asyncRead(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the object read from the space.
-
asyncRead
public <T> AsyncFuture<T> asyncRead(ISpaceQuery<T> template, long timeout, ReadModifiers modifiers, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceReads any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Overloads
GigaSpace.asyncRead(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
asyncReadin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.listener- A listener to be notified when a result arrives- Returns:
- A copy of the object read from the space.
-
readIfExistsById
Description copied from interface:GigaSpaceRead an object from the space matching its id and the class. Returnsnullif there is no match.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.readById(Class, Object, Object)can be used to specify the routing.- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entry- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExistsById
Description copied from interface:GigaSpaceRead an object from the space matching its id, the class and the routing value. Returnsnullif there is no match.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing value- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExistsById
Description copied from interface:GigaSpaceRead an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the space- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExistsById
public <T> T readIfExistsById(Class<T> clazz, Object id, Object routing, long timeout, ReadModifiers modifiers) Description copied from interface:GigaSpaceRead an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofReadModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExistsById
Description copied from interface:GigaSpaceRead an object from the space matching the specified id query. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.readById(Class, Object, Object)can be used to specify the routing.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
query- Query to search by.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExistsById
Description copied from interface:GigaSpaceRead an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
query- Query to search by.timeout- The timeout value to wait for a matching entry if it does not exists within the space- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExistsById
Description copied from interface:GigaSpaceRead an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsByIdin interfaceGigaSpace- Parameters:
query- Query to search by.timeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofReadModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
readIfExists
public <T> T readIfExists(T template) Description copied from interface:GigaSpaceRead any matching object from the space, returningnullif there currently is none. Matching and timeouts are done as inread, except that blocking in this call is done only if necessary to wait for transactional state to settle.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
readIfExistsin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").- Returns:
- A copy of the object read from the space.
-
readIfExists
public <T> T readIfExists(T template, long timeout) Description copied from interface:GigaSpaceRead any matching object from the space, returningnullif there currently is none. Matching and timeouts are done as inread, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.- Returns:
- A copy of the object read from the space.
-
readIfExists
Description copied from interface:GigaSpaceRead any matching object from the space, returningnullif there currently is none. Matching and timeouts are done as inread, except that blocking in this call is done only if necessary to wait for transactional state to settle.Overloads
GigaSpace.read(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
readIfExistsin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against template withnullfields being wildcards ("match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the object read from the space.
-
readIfExists
Description copied from interface:GigaSpaceRead any matching object from the space, returningnullif there currently is none. Matching and timeouts are done as inread, except that blocking in this call is done only if necessary to wait for transactional state to settle.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
readIfExistsin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.- Returns:
- A copy of the object read from the space.
-
readIfExists
Description copied from interface:GigaSpaceRead any matching object from the space, returningnullif there currently is none. Matching and timeouts are done as inread, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
readIfExistsin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.- Returns:
- A copy of the object read from the space.
-
readIfExists
Description copied from interface:GigaSpaceRead any matching object from the space, returningnullif there currently is none. Matching and timeouts are done as inread, except that blocking in this call is done only if necessary to wait for transactional state to settle.Overloads
GigaSpace.read(Object, long)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
readIfExistsin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching object. A timeout of 0 means to wait no time at all.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the object read from the space.
-
readMultiple
public <T> T[] readMultiple(T template) Description copied from interface:GigaSpaceRead any matching entries from the space. Matching is done as inreadwithout timeout (0). Returns an unbounded array of matches. Returns an empty array if no match was found. Same as callingreadMultiple(template, Integer.MAX_VALUE).- Specified by:
readMultiplein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasses- Returns:
- A copy of the entries read from the space.
-
readMultiple
public <T> T[] readMultiple(T template, int maxEntries) Description copied from interface:GigaSpaceRead any matching entries from the space. Matching is done as inreadwithout timeout (0). Returns an array with matches bound bymaxEntries. Returns an empty array if no match was found.- Specified by:
readMultiplein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesmaxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.- Returns:
- A copy of the entries read from the space.
-
readMultiple
Description copied from interface:GigaSpaceRead any matching entries from the space. Matching is done as inreadwithout timeout (0). Returns an array with matches bound bymaxEntries. Returns an empty array if no match was found.Overloads
GigaSpace.readMultiple(Object, int)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
readMultiplein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesmaxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the entries read from the space.
-
readMultiple
Description copied from interface:GigaSpaceRead any matching entries from the space. Matching is done as inreadwithout timeout (0). Returns an unbounded array of matches. Returns an empty array if no match was found.- Specified by:
readMultiplein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.- Returns:
- A copy of the entries read from the space.
-
readMultiple
Description copied from interface:GigaSpaceRead any matching entries from the space. Matching is done as inreadwithout timeout (0). Returns an array with matches bound bymaxEntries. Returns an empty array if no match was found.- Specified by:
readMultiplein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.maxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.- Returns:
- A copy of the entries read from the space.
-
readMultiple
Description copied from interface:GigaSpaceRead any matching entries from the space. Matching is done as inreadwithout timeout (0). Returns an array with matches bound bymaxEntries. Returns an empty array if no match was found.Overloads
GigaSpace.readMultiple(Object, int)by adding amodifiersparameter. Equivalent when called with the default modifier -ReadModifiers.REPEATABLE_READ. Modifiers are used to define the behavior of a read operation.- Specified by:
readMultiplein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.maxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.modifiers- one or a union ofReadModifiers.- Returns:
- A copy of the entries read from the space.
-
readByIds
Description copied from interface:GigaSpaceRead objects from the space matching their IDs and the specified class.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will broadcast to all partitions. Use
GigaSpace.readByIds(Class, Object[], Object)to specify the routing explicitly and avoid broadcast if needed. -
readByIds
Description copied from interface:GigaSpaceRead objects from the space matching their IDs, the specified class and routing key.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKey. If it is null, the operation will broadcast to all partitions. -
readByIds
public <T> ReadByIdsResult<T> readByIds(Class<T> clazz, Object[] ids, Object routingKey, ReadModifiers modifiers) Description copied from interface:GigaSpaceRead objects from the space matching their IDs, the specified class type and routing key, with the providedReadModifiers.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKey. If it is null, the operation will broadcast to all partitions.ReadModifiers.FIFOis not supported by this operation - the results are always ordered in correlation with the input IDs array.- Specified by:
readByIdsin interfaceGigaSpace- Parameters:
clazz- The class.ids- The object IDs array.routingKey- The routing of the provided object IDs.modifiers- The read modifier to use (One or several ofReadModifiers).- Returns:
- a ReadByIdsResult containing the matched results.
-
readByIds
Description copied from interface:GigaSpaceRead objects from the space matching their IDs, the specified class and the routing keys.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKeys. If it is null, the operation will broadcast to all partitions.routingKeysshould be correlated withids, i.e. their length should be the same, and the routing key of ID i in the IDs array is the element at position i in the routing keys array. -
readByIds
public <T> ReadByIdsResult<T> readByIds(Class<T> clazz, Object[] ids, Object[] routingKeys, ReadModifiers modifiers) Description copied from interface:GigaSpaceRead objects from the space matching their IDs, the specified class and the routing keys, with the providedReadModifiers.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKeys. If it is null, the operation will broadcast to all partitions.routingKeysshould be correlated withids, i.e. their length should be the same, and the routing key of ID i in the IDs array is the element at position i in the routing keys array.ReadModifiers.FIFOis not supported by this operation - the results are always ordered in correlation with the input IDs array.- Specified by:
readByIdsin interfaceGigaSpace- Parameters:
clazz- The class type.ids- The objects\ IDs array.routingKeys- The object routing keys array.modifiers- The read modifier to use (One or several ofReadModifiers).- Returns:
- a ReadByIdsResult containing the matched results.
-
readByIds
Description copied from interface:GigaSpaceRead objects from the space matching the specified IDs query. -
readByIds
Description copied from interface:GigaSpaceRead objects from the space matching the specified IDs query, with the providedReadModifiers.- Specified by:
readByIdsin interfaceGigaSpace- Parameters:
query- Query to search by.modifiers- The read modifier to use (One or several ofReadModifiers).- Returns:
- a ReadByIdsResult containing the matched results.
-
takeByIds
Description copied from interface:GigaSpaceTake (remove) objects from the space matching their IDs and the specified class.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will broadcast to all partitions. Use
GigaSpace.readByIds(Class, Object[], Object)to specify the routing explicitly and avoid broadcast if needed. -
takeByIds
Description copied from interface:GigaSpaceTake (remove) objects from the space matching their IDs, the specified class and routing key.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKey. If it is null, the operation will broadcast to all partitions. -
takeByIds
public <T> TakeByIdsResult<T> takeByIds(Class<T> clazz, Object[] ids, Object routingKey, TakeModifiers modifiers) Description copied from interface:GigaSpaceTake (remove) objects from the space matching their IDs, the specified class type and routing key, with the providedReadModifiers.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKey. If it is null, the operation will broadcast to all partitions.ReadModifiers.FIFOis not supported by this operation - the results are always ordered in correlation with the input IDs array.- Specified by:
takeByIdsin interfaceGigaSpace- Parameters:
clazz- The class.ids- The object IDs array.routingKey- The routing of the provided object IDs.modifiers- The read modifier to use (One or several ofReadModifiers).- Returns:
- a TakeByIdsResult containing the matched results.
-
takeByIds
Description copied from interface:GigaSpaceTake (remove) objects from the space matching their IDs, the specified class and the routing keys.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKeys. If it is null, the operation will broadcast to all partitions.routingKeysshould be correlated withids, i.e. their length should be the same, and the routing key of ID i in the IDs array is the element at position i in the routing keys array. -
takeByIds
public <T> TakeByIdsResult<T> takeByIds(Class<T> clazz, Object[] ids, Object[] routingKeys, TakeModifiers modifiers) Description copied from interface:GigaSpaceTake (remove) objects from the space matching their IDs, the specified class and the routing keys, with the providedReadModifiers.Note, if the space is partitioned and the Class defines that routing is not done via the Id property, the operation will be routed according to
routingKeys. If it is null, the operation will broadcast to all partitions.routingKeysshould be correlated withids, i.e. their length should be the same, and the routing key of ID i in the IDs array is the element at position i in the routing keys array.ReadModifiers.FIFOis not supported by this operation - the results are always ordered in correlation with the input IDs array.- Specified by:
takeByIdsin interfaceGigaSpace- Parameters:
clazz- The class type.ids- The objects\ IDs array.routingKeys- The object routing keys array.modifiers- The read modifier to use (One or several ofReadModifiers).- Returns:
- a TakeByIdsResult containing the matched results.
-
takeByIds
Description copied from interface:GigaSpaceTake (remove) objects from the space matching the specified IDs query. -
takeByIds
Description copied from interface:GigaSpaceTake (remove) objects from the space matching the specified IDs query, with the providedReadModifiers.- Specified by:
takeByIdsin interfaceGigaSpace- Parameters:
query- Query to search by.modifiers- The read modifier to use (One or several ofReadModifiers).- Returns:
- a ReadByIdsResult containing the matched results.
-
takeById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id and the class. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.takeById(Class, Object, Object)can be used to specify the routing. -
takeById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id, the class and the routing value. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
takeById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.- Specified by:
takeByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the space- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeById
public <T> T takeById(Class<T> clazz, Object id, Object routing, long timeout, TakeModifiers modifiers) Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.- Specified by:
takeByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofTakeModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching the specified id query. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.readById(Class, Object, Object)can be used to specify the routing. -
takeById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout. -
takeById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout.- Specified by:
takeByIdin interfaceGigaSpace- Parameters:
query- Query to search by.timeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofTakeModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
take
public <T> T take(T template) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, blocking until one exists. Returnnullif the timeout expires.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
take
public <T> T take(T template, long timeout) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, blocking until one exists. Returnnullif the timeout expires.- Specified by:
takein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.- Returns:
- A removed entry from the space
-
take
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, blocking until one exists. Returnnullif the timeout expires.- Specified by:
takein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.- Returns:
- A removed entry from the space
-
take
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, blocking until one exists. Returnnullif the timeout expires.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
take
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, blocking until one exists. Returnnullif the timeout expires.- Specified by:
takein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.- Returns:
- A removed entry from the space
-
take
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, blocking until one exists. Returnnullif the timeout expires.- Specified by:
takein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").listener- A listener to be notified when a result arrives- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.listener- A listener to be notified when a result arrives- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.- Returns:
- A removed entry from the space
-
asyncTake
public <T> AsyncFuture<T> asyncTake(T template, long timeout, TakeModifiers modifiers, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.listener- A listener to be notified when a result arrives- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.- Returns:
- A removed entry from the space
-
asyncTake
public <T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, long timeout, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.listener- A listener to be notified when a result arrives.- Returns:
- A removed entry from the space
-
asyncTake
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.- Returns:
- A removed entry from the space
-
asyncTake
public <T> AsyncFuture<T> asyncTake(ISpaceQuery<T> template, long timeout, TakeModifiers modifiers, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space in an asynchronous manner. Returns immediately with a future. The future can then be used to check if there is a match or not. Once a match is found or the timeout expires, the future will return a result (nullin case there was no match).- Specified by:
asyncTakein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.listener- A listener to be notified when a result arrives.- Returns:
- A removed entry from the space
-
takeIfExistsById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id and the class. Returnsnullif there is no match.Matching and timeouts are done as in
takeById, except that blocking in this call is done only if necessary to wait for transactional state to settle.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.takeById(Class, Object, Object)can be used to specify the routing.- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entry- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExistsById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id, the class and the routing value. Returnsnullif there is no match.Matching and timeouts are done as in
takeById, except that blocking in this call is done only if necessary to wait for transactional state to settle.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing value- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExistsById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
takeById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the space- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExistsById
public <T> T takeIfExistsById(Class<T> clazz, Object id, Object routing, long timeout, TakeModifiers modifiers) Description copied from interface:GigaSpaceTake (remove) an object from the space matching its id, the class and the routing value. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
takeById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
clazz- The class of the entryid- The id of the entryrouting- The routing valuetimeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofTakeModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExistsById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching the specified id query. Returnsnullif there is no match.The timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
Note, if the space is partitioned, and the Entry has a specific property for its routing value, the operation will broadcast to all partitions. The
GigaSpace.readById(Class, Object, Object)can be used to specify the routing.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
query- Query to search by.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExistsById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
query- Query to search by.timeout- The timeout value to wait for a matching entry if it does not exists within the space- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExistsById
Description copied from interface:GigaSpaceTake (remove) an object from the space matching the specified id query. Returnsnullif there is no match within the specified timeout.Matching and timeouts are done as in
readById, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsByIdin interfaceGigaSpace- Parameters:
query- Query to search by.timeout- The timeout value to wait for a matching entry if it does not exists within the spacemodifiers- one or a union ofTakeModifiers.- Returns:
- A matching object, or
nullif no matching is found within the timeout value.
-
takeIfExists
public <T> T takeIfExists(T template) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, returningnullif there currently is none. Matching and timeouts are done as intake, except that blocking in this call is done only if necessary to wait for transactional state to settle.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
takeIfExistsin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").- Returns:
- A removed entry from the space
-
takeIfExists
public <T> T takeIfExists(T template, long timeout) Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, returningnullif there currently is none. Matching and timeouts are done as intake, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.- Returns:
- A removed entry from the space
-
takeIfExists
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, returningnullif there currently is none. Matching and timeouts are done as intake, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being wildcards ( "match anything") other fields being values ("match exactly on the serialized form").timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.- Returns:
- A removed entry from the space
-
takeIfExists
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, returningnullif there currently is none. Matching and timeouts are done as intake, except that blocking in this call is done only if necessary to wait for transactional state to settle.Note, the timeout is the default timeout this interface is configured with (using its factory) and defaults to 0.
- Specified by:
takeIfExistsin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.- Returns:
- A removed entry from the space
-
takeIfExists
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, returningnullif there currently is none. Matching and timeouts are done as intake, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.- Returns:
- A removed entry from the space
-
takeIfExists
Description copied from interface:GigaSpaceTake (remove) any matching entry from the space, returningnullif there currently is none. Matching and timeouts are done as intake, except that blocking in this call is done only if necessary to wait for transactional state to settle.- Specified by:
takeIfExistsin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.timeout- How long the client is willing to wait for a transactionally proper matching entry. A timeout of 0 means to wait no time at all.modifiers- one or a union ofTakeModifiers.- Returns:
- A removed entry from the space
-
takeMultiple
public <T> T[] takeMultiple(T template) Description copied from interface:GigaSpaceTakes (removes) all the entries matching the specified template from this space. Same as callingtakeMultiple(template, Integer.MAX_VALUE).- Specified by:
takeMultiplein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasses- Returns:
- Removed matched entries from the space
-
takeMultiple
public <T> T[] takeMultiple(T template, int maxEntries) Description copied from interface:GigaSpaceTakes (removes) all the entries matching the specified template from this space.- Specified by:
takeMultiplein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesmaxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.- Returns:
- Removed matched entries from the space
-
takeMultiple
Description copied from interface:GigaSpaceTakes (removes) all the entries matching the specified template from this space.- Specified by:
takeMultiplein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesmaxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.modifiers- one or a union ofTakeModifiers.- Returns:
- Removed matched entries from the space
-
takeMultiple
Description copied from interface:GigaSpaceTakes (removes) all the entries matching the specified template from this space.- Specified by:
takeMultiplein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.- Returns:
- Removed matched entries from the space
-
takeMultiple
Description copied from interface:GigaSpaceTakes (removes) all the entries matching the specified template from this space.- Specified by:
takeMultiplein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.maxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.- Returns:
- Removed matched entries from the space
-
takeMultiple
Description copied from interface:GigaSpaceTakes (removes) all the entries matching the specified template from this space.- Specified by:
takeMultiplein interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.maxEntries- A limit on the number of entries to be returned. UseInteger.MAX_VALUEfor the uppermost limit.modifiers- one or a union ofTakeModifiers.- Returns:
- Removed matched entries from the space
-
write
Description copied from interface:GigaSpaceWrites a new object to the space, returning itsLeaseContext.By default uses the
WriteModifiers.UPDATE_OR_WRITEmodifier (seeGigaSpace.write(Object, long, long, WriteModifiers). In order to force the operation to perform "write" only (a bit more performant), theWriteModifiers.WRITE_ONLYmodifier can be used resulting in anEntryAlreadyInSpaceExceptionif the entry already exists in the space (it must have an id for this exception to be raised).If the object has a primary key that isn't auto - generated, and the modifiers value is one of
WriteModifiers.UPDATE_OR_WRITE,WriteModifiers.UPDATE_ONLYorWriteModifiers.PARTIAL_UPDATE, it will call to the update method, returning a LeaseContext holder. This lease is unknown to the grantor, unless an actual 'write' was performed.The entry will be written using the default lease this interface is configured with (using the its factory). In order to explicitly define the lease, please use
GigaSpace.write(Object, long).- Specified by:
writein interfaceGigaSpace- Parameters:
entry- The entry to write to the space- Returns:
- A usable
Leaseon a successful write, ornullif performed with the proxy configured with NoWriteLease flag.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returnsnullon a successful write or the previous value - on successful update (Only ifWriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null).UpdateOperationTimeoutExceptionis thrown if timeout occurred while trying to update the object.
-
write
Description copied from interface:GigaSpaceWrites a new object to the space, returning itsLeaseContext.By default uses the
WriteModifiers.UPDATE_OR_WRITEmodifier (seeGigaSpace.write(Object, long, long, WriteModifiers). In order to force the operation to perform "write" only (a bit more performant), theWriteModifiers.WRITE_ONLYmodifier can be used resulting in anEntryAlreadyInSpaceExceptionif the entry already exists in the space (it must have an id for this exception to be raised).If the object has a primary key that isn't auto - generated, and the modifiers value is one of
WriteModifiers.UPDATE_OR_WRITE,WriteModifiers.UPDATE_ONLYorWriteModifiers.PARTIAL_UPDATE, it will call to the update method, returning a LeaseContext holder. This lease is unknown to the grantor, unless an actual 'write' was performed.- Specified by:
writein interfaceGigaSpace- Parameters:
entry- The entry to write to the spacelease- The lease the entry will be written with, in milliseconds.- Returns:
- A usable
Leaseon a successful write, ornullif performed with the proxy configured with NoWriteLease flag.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returnsnullon a successful write or the previous value - on successful update (Only ifWriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null).UpdateOperationTimeoutExceptionis thrown if timeout occurred while trying to update the object.
-
write
Description copied from interface:GigaSpaceWrites a new object to the space, returning itsLeaseContext.By default uses the
WriteModifiers.UPDATE_OR_WRITEmodifier (seeGigaSpace.write(Object, long, long, WriteModifiers). In order to force the operation to perform "write" only (a bit more performant), theWriteModifiers.WRITE_ONLYmodifier can be used resulting in anEntryAlreadyInSpaceExceptionif the entry already exists in the space (it must have an id for this exception to be raised).If the object has a primary key that isn't auto - generated, and the modifiers value is one of
WriteModifiers.UPDATE_OR_WRITE,WriteModifiers.UPDATE_ONLYorWriteModifiers.PARTIAL_UPDATE, it will call to the update method, returning a LeaseContext holder. This lease is unknown to the grantor, unless an actual 'write' was performed.The entry will be written using the default lease this interface is configured with (using the its factory). In order to explicitly define the lease, please use
GigaSpace.write(Object, long).- Specified by:
writein interfaceGigaSpace- Parameters:
entry- The entry to write to the spacemodifiers- one or a union ofWriteModifiers.- Returns:
- A usable
Leaseon a successful write, ornullif performed with the proxy configured with NoWriteLease flag.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returnsnullon a successful write or the previous value - on successful update (Only ifWriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null).UpdateOperationTimeoutExceptionis thrown if timeout occurred while trying to update the object.
-
write
Description copied from interface:GigaSpaceWrites a new object to the space, returning itsLeaseContext.By default uses the
WriteModifiers.UPDATE_OR_WRITEmodifier. In order to force the operation to perform "write" only (a bit more performant), theWriteModifiers.WRITE_ONLYmodifier can be used resulting in anEntryAlreadyInSpaceExceptionif the entry already exists in the space (it must have an id for this exception to be raised).If the object has a primary key that isn't auto - generated, and the modifiers value is one of
WriteModifiers.UPDATE_OR_WRITE,WriteModifiers.UPDATE_ONLYorWriteModifiers.PARTIAL_UPDATE, it will call to the update method, returning a LeaseContext holder. This lease is unknown to the grantor, unless an actual 'write' was performed.- Specified by:
writein interfaceGigaSpace- Parameters:
entry- The entry to write to the spacelease- The lease the entry will be written with, in milliseconds.timeout- The timeout of an update operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.modifiers- one or a union ofWriteModifiers.- Returns:
- A usable
Leaseon a successful write, ornullif performed with the proxy configured with NoWriteLease flag.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returnsnullon a successful write or the previous value - on successful update (Only ifWriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null).UpdateOperationTimeoutExceptionis thrown if timeout occurred while trying to update the object.
-
writeMultiple
Description copied from interface:GigaSpaceWrites the specified entries to this space.The entry will be written using the default lease this interface is configured with (using the its factory). In order to explicitly define the lease, please use
GigaSpace.writeMultiple(Object[], long).- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- The entries to write to the space.- Returns:
- Leases for the written entries
-
writeMultiple
Description copied from interface:GigaSpaceWrites the specified entries to this space.- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- The entries to write to the space.lease- The lease the entry will be written with, in milliseconds.- Returns:
- Leases for the written entries
-
writeMultiple
Description copied from interface:GigaSpaceWrites the specified entries to this space.- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- The entries to write to the space.modifiers- one or a union ofWriteModifiers.- Returns:
- Leases for the written entries
-
writeMultiple
Description copied from interface:GigaSpaceWrites the specified entries to this space. Same as a single write but for a group of entities sharing the same transaction (if any), applied with the same specified operation modifier. The semantics of a single write and a batch update are similar - the return value for each corresponds to it's cell in the returned array. see'returns'for possible return values.- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- the entries to write.lease- the requested lease time, in millisecondsmodifiers- one or a union ofWriteModifiers.- Returns:
- array in which each cell is corresponding to the written entry at the same index in
the entries array, each cell is a usable
Leaseon a successful write, ornullif performed with NoWriteLease attribute.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returns:- null - on a successful write
- previous value -
on successful update (Only if
WriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null)
- or, OperationTimeoutException - thrown if timeout occurred
-
writeMultiple
public <T> LeaseContext<T>[] writeMultiple(T[] entries, long lease, long timeout, WriteModifiers modifiers) Description copied from interface:GigaSpaceWrites the specified entries to this space. Same as a single write but for a group of entities sharing the same transaction (if any), applied with the same specified operation modifier. The semantics of a single write and a batch update are similar - the return value for each corresponds to it's cell in the returned array. see'returns'for possible return values.- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- the entries to write.lease- the requested lease time, in millisecondstimeout- The timeout of the update operations, in milliseconds. If entries are locked by another transactionmodifiers- one or a union ofWriteModifiers.- Returns:
- array in which each cell is corresponding to the written entry at the same index in
the entries array, each cell is a usable
Leaseon a successful write, ornullif performed with NoWriteLease attribute.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returns:- null - on a successful write
- previous value -
on successful update (Only if
WriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null)
- or, OperationTimeoutException - thrown if timeout occurred
-
writeMultiple
Description copied from interface:GigaSpaceWrites the specified entries to this space. Same as a single write but for a group of entities sharing the same transaction (if any), applied with the same specified operation modifier. The semantics of a single write and a batch update are similar - the return value for each corresponds to it's cell in the returned array. see'returns'for possible return values.- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- the entries to write.leases- the requested lease time per entry, in millisecondsmodifiers- one or a union ofWriteModifiers.- Returns:
- array in which each cell is corresponding to the written entry at the same index in
the entries array, each cell is a usable
Leaseon a successful write, ornullif performed with NoWriteLease attribute.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returns:- null - on a successful write
- previous value -
on successful update (Only if
WriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null)
- or, OperationTimeoutException - thrown if timeout occurred
-
writeMultiple
public <T> LeaseContext<T>[] writeMultiple(T[] entries, long[] leases, long timeout, WriteModifiers modifiers) Description copied from interface:GigaSpaceWrites the specified entries to this space. Same as a single write but for a group of entities sharing the same transaction (if any), applied with the same specified operation modifier. The semantics of a single write and a batch update are similar - the return value for each corresponds to it's cell in the returned array. see'returns'for possible return values.- Specified by:
writeMultiplein interfaceGigaSpace- Parameters:
entries- the entries to write.leases- the requested lease time per entry, in millisecondstimeout- The timeout of the update operations, in milliseconds. If entries are locked by another transactionmodifiers- one or a union ofWriteModifiers.- Returns:
- array in which each cell is corresponding to the written entry at the same index in
the entries array, each cell is a usable
Leaseon a successful write, ornullif performed with NoWriteLease attribute.when
WriteModifiers.UPDATE_OR_WRITEmodifier is applied,LeaseContext.getObject()returns:- null - on a successful write
- previous value -
on successful update (Only if
WriteModifiers.RETURN_PREV_ON_UPDATEis used, otherwise null)
- or, OperationTimeoutException - thrown if timeout occurred
-
iterator
Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template.- Specified by:
iteratorin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasses- Returns:
- An iterator over the entries which match the template.
-
iterator
Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template.- Specified by:
iteratorin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesbatchSize- Maximum number of entries to fetch on each batch.- Returns:
- An iterator over the entries which match the template.
-
iterator
Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template.- Specified by:
iteratorin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesbatchSize- Maximum number of entries to fetch on each batch.modifiers- one or a union ofReadModifiers.- Returns:
- An iterator over the entries which match the template.
-
iterator
public <T> SpaceIterator<T> iterator(T template, SpaceIteratorConfiguration spaceIteratorConfiguration) Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template.- Specified by:
iteratorin interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclassesspaceIteratorConfiguration-SpaceIteratorConfiguration.- Returns:
- An iterator over the entries which match the template.
-
iterator
Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template. -
iterator
Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template. -
iterator
public <T> SpaceIterator<T> iterator(ISpaceQuery<T> template, int batchSize, ReadModifiers modifiers) Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template.- Specified by:
iteratorin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.batchSize- Maximum number of entries to fetch on each batch.modifiers- one or a union ofReadModifiers.- Returns:
- An iterator over the entries which match the template.
-
iterator
public <T> SpaceIterator<T> iterator(ISpaceQuery<T> template, SpaceIteratorConfiguration spaceIteratorConfiguration) Description copied from interface:GigaSpaceReturns an iterator over the entries in the space which match the specified template.- Specified by:
iteratorin interfaceGigaSpace- Parameters:
template- A query to be executed against the space. Most common one isSQLQuery.spaceIteratorConfiguration-SpaceIteratorConfiguration.- Returns:
- An iterator over the entries which match the template.
-
execute
Description copied from interface:GigaSpaceExecutes a task on a specific space node. The space node it will execute on should be controlled by having a method that return the routing value annotated withSpaceRouting.In order to control the routing externally, use
GigaSpace.execute(org.openspaces.core.executor.Task, Object).The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available. -
execute
public <T extends Serializable> AsyncFuture<T> execute(Task<T> task, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceExecutes a task on a specific space node. The space node it will execute on should be controlled by having a method that return the routing value annotated withSpaceRouting.In order to control the routing externally, use
GigaSpace.execute(org.openspaces.core.executor.Task, Object).The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available. -
execute
Description copied from interface:GigaSpaceExecutes a task on a specific space node. The space node it will execute on should is controlled by the routing value provided as a second parameter.The routing object itself does not have to be the actual routing value, but can be a POJO that defined a method annotated with
@SpaceRoutingannotation (this works well when wanting to use entries as the routing parameters).In order to control the using the Task itself, use
GigaSpace.execute(org.openspaces.core.executor.Task).The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available.- Specified by:
executein interfaceGigaSpace- Parameters:
task- The task to executerouting- The routing value that will control on which node the task will be executed on- Returns:
- a Future representing pending completion of the task, and whose
get()method will return the task value upon completion.
-
execute
public <T extends Serializable> AsyncFuture<T> execute(Task<T> task, Object routing, AsyncFutureListener<T> listener) Description copied from interface:GigaSpaceExecutes a task on a specific space node. The space node it will execute on should is controlled by the routing value provided as a second parameter.The routing object itself does not have to be the actual routing value, but can be a POJO that defined a method annotated with
@SpaceRoutingannotation (this works well when wanting to use entries as the routing parameters).In order to control the using the Task itself, use
GigaSpace.execute(org.openspaces.core.executor.Task).The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available.- Specified by:
executein interfaceGigaSpace- Parameters:
task- The task to executerouting- The routing value that will control on which node the task will be executed onlistener- A listener to be notified when execution completes- Returns:
- a Future representing pending completion of the task, and whose
get()method will return the task value upon completion.
-
execute
public <T extends Serializable, R> AsyncFuture<R> execute(DistributedTask<T, R> task, Object... routing) Description copied from interface:GigaSpaceExecutes a task on all the nodes that correspond to the list of routing values. The task is executed on each space node with all the results reduced by theAsyncResultsReducer.reduce(java.util.List)operation.The routing object itself does not have to be the actual routing value, but can be a POJO that defined a method annotated with
@SpaceRoutingannotation (this works well when wanting to use entries as the routing parameters).The task can optionally implement
AsyncResultFilterthat can control if tasks should continue to accumulate or it should break and execute the reduce operation on the results received so far.The future actual result will be the reduced result of the execution, or the exception thrown during during the reduce operation. The moderator can be used as a mechanism to listen for results as they arrive.
The last parameter can be of type
AsyncFutureListenerwhich, this case, it will be used to register a listener to be notified of the result.The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available.- Specified by:
executein interfaceGigaSpace- Parameters:
task- The task to executerouting- A list of routing values, each resulting in an execution of the task on the space node it corresponds to- Returns:
- a Future representing pending completion of the task, and whose
get()method will return the task value upon completion.
-
execute
Description copied from interface:GigaSpaceExecutes the task on all the primary space nodes within the cluster (broadcast). The task is executed on each space node with all the results reduced by theAsyncResultsReducer.reduce(java.util.List)operation.The task can optionally implement
AsyncResultFilterthat can control if tasks should continue to accumulate or it should break and execute the reduce operation on the results received so far.The future actual result will be the reduced result of the execution, or the exception thrown during during the reduce operation. The moderator can be used as a mechanism to listen for results as they arrive.
The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available. -
executorBuilder
public <T extends Serializable, R> ExecutorBuilder<T,R> executorBuilder(AsyncResultsReducer<T, R> reducer) Description copied from interface:GigaSpaceConstructs an executor builder allowing to accumulate different tasks required to be executed into a single execute mechanism with all the results reduced by the reducer provided.The reducer can optionally implement
AsyncResultFilterthat can control if tasks should continue to accumulate or it should break and execute the reduce operation on the results received so far.The space that the task is executed within can be accessible by marking a field with type
GigaSpaceusing theTaskGigaSpaceannotation. Another option is by implementing theTaskGigaSpaceAwareinterface.Resource injection can be enabled by marking the task with
AutowireTaskor withAutowireTaskMarker. Resources defined within processing unit (space node) the task is executed on are accessible by using either theAutowiredor javax.annotation.Resource annotations (assuming they are enabled usingcontext:annotation-config). Bean life cycle methods, such asClusterInfoAwareandApplicationContextAwareare also available.- Specified by:
executorBuilderin interfaceGigaSpace- Parameters:
reducer- The reducer to reduce the results of all the different tasks added.- Returns:
- The executor builder.
-
getTypeManager
Description copied from interface:GigaSpaceGets the type manager of this GigaSpace instance.- Specified by:
getTypeManagerin interfaceGigaSpace- See Also:
-
aggregate
Description copied from interface:GigaSpaceExecutes the specified query along with the specified aggregations collocated at the space. -
aggregate
public <T> AggregationResult aggregate(ISpaceQuery<T> query, AggregationSet aggregationSet, ReadModifiers readModifiers) -
freshCopy
A copy of the aggregation set for one attempt.Aggregators are stateful on the client: each partition's intermediate result is reduced into the caller's aggregator instances as it arrives. When an attempt fails part-way - one partition answered, another could not be reached - those instances already hold the partial sum, and the retry on another cluster would add its full answer on top: a count of 45 for 30 entries, returned as a success. A copy per attempt starts every attempt clean, and leaves the caller's set untouched for reuse. Cloned the way the space proxy copies an aggregate request.
-
change
Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier. -
change
Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.timeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A
ChangeResultcontaining the details of the change operation affect. - See Also:
-
change
public <T> ChangeResult<T> change(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers) Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifiers- Returns:
- A
ChangeResultcontaining the details of the change operation affect. - See Also:
-
change
public <T> ChangeResult<T> change(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierstimeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A
ChangeResultcontaining the details of the change operation affect. - See Also:
-
asyncChange
Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.listener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, long timeout) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.timeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.timeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.listener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers) Description copied from interface:GigaSpaceChanges an existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifiers- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierslistener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierstimeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(ISpaceQuery<T> query, ChangeSet changeSet, ChangeModifiers modifiers, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
query- Query to search by.changeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierstimeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.listener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
- See Also:
-
change
Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.- Returns:
- A
ChangeResultcontaining the details of the change operation affect.
-
change
Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.timeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A
ChangeResultcontaining the details of the change operation affect.
-
change
Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifiers- Returns:
- A
ChangeResultcontaining the details of the change operation affect.
-
change
public <T> ChangeResult<T> change(T template, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Description copied from interface:GigaSpaceChanges existing objects in space, returning a change result which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
changein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierstimeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A
ChangeResultcontaining the details of the change operation affect.
-
asyncChange
Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.listener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.timeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.timeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.listener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers) Description copied from interface:GigaSpaceChanges an existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifiers- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierslistener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers, long timeout) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierstimeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
asyncChange
public <T> Future<ChangeResult<T>> asyncChange(T template, ChangeSet changeSet, ChangeModifiers modifiers, long timeout, AsyncFutureListener<ChangeResult<T>> listener) Description copied from interface:GigaSpaceChanges existing objects in space in an asynchronous manner, returning immidiately with a future. The future can be used to check the change operation results which provides details of the operation affect. The change operation is designed for performance optimization, By allowing to change an existing object unlike with regular updating write operation which usually requires reading the object before applying to update to it. As part of the optimization, when the operation is replicated, on a best effort it will try to replicate only the required data which is needed to apply the changes on the entry in the replicated target.Modifiers can be used to specify behavior of the change operation, by default uses the
ChangeModifiers.NONEmodifier.- Specified by:
asyncChangein interfaceGigaSpace- Parameters:
template- The template used for matching. Matching is done against the template withnullfields being. wildcards ("match anything") other fields being values ("match exactly on the serialized form"). The template can also be one of the differentISpaceQueryclasseschangeSet- Changes to apply to the matched entry.modifiers- one or a union ofChangeModifierstimeout- The timeout of the operation, in milliseconds. If the entry is locked by another transaction wait for the specified number of milliseconds for it to be released.listener- A listener to be notified when a result arrives.- Returns:
- A future containing the details of the change operation affect which arrived asynchronously.
-
newDataEventSession
Description copied from interface:GigaSpaceCreates a new DataEventSession with the default configuration.- Specified by:
newDataEventSessionin interfaceGigaSpace- Returns:
- a new data event session.
-
newDataEventSession
Description copied from interface:GigaSpaceCreates a new DataEventSession with the specified configuration.- Specified by:
newDataEventSessionin interfaceGigaSpace- Parameters:
config- The configuration settings for the new data event session.- Returns:
- a new data event session.
-
setQuiesceToken
- Specified by:
setQuiesceTokenin interfaceGigaSpace
-
setMVCCGenerationsState
- Specified by:
setMVCCGenerationsStatein interfaceGigaSpace
-
prepareTemplate
Description copied from interface:GigaSpaceTranslates the template object into pre-processed packet which will be sent to the space. The process of serializing an entry for transmission to the space will be identical if the same entry is used twice. The prepareTemplate method gives a way to reduce the impact of repeated use of the same entry therefore it is extremely useful when dealing with many template matching operations (i.e read and take). This method will not access the space, all processing is done in client side only.- Specified by:
prepareTemplatein interfaceGigaSpace- Parameters:
template- to be translated intoISpaceQuery- Returns:
- pre-processed
ISpaceQuerywhich represents the translated template - See Also:
-
asyncLoad
public AsyncFuture<SpaceDataSourceLoadResult> asyncLoad(SpaceDataSourceLoadRequest spaceDataSourceLoadRequest) Description copied from interface:GigaSpaceLoads data from aSpaceDataSourceon demand The Space data source is created withSpaceDataSourceFactoryLoaded data can be adapted using theSpaceTypeSchemaAdapter- Specified by:
asyncLoadin interfaceGigaSpace- Parameters:
spaceDataSourceLoadRequest-SpaceDataSourceLoadRequest- Returns:
- A future containing the details of the load operation affect which arrived * asynchronously.
-
registerDurableTask
- Specified by:
registerDurableTaskin interfaceGigaSpace
-
executeDurable
- Specified by:
executeDurablein interfaceGigaSpace
-
executeDurable
- Specified by:
executeDurablein interfaceGigaSpace
-
listDurableTasks
- Specified by:
listDurableTasksin interfaceGigaSpace
-
unregisterDurableTask
- Specified by:
unregisterDurableTaskin interfaceGigaSpace
-
getActiveOperations
Description copied from interface:GigaSpaceReturns all currently active (in-flight) operations on the space instance backing this proxy. Tracking is performed server-side byOperationTrackingFilterand covers every client hitting that instance, not just this proxy. Enabled together with LRMI network activity monitoring for the space instance.- Specified by:
getActiveOperationsin interfaceGigaSpace
-
getLastOperations
Description copied from interface:GigaSpaceReturns the last completed operations on the space instance backing this proxy (up to configured max). Tracking is performed server-side byOperationTrackingFilterand covers every client hitting that instance, not just this proxy. Enabled together with LRMI network activity monitoring for the space instance.- Specified by:
getLastOperationsin interfaceGigaSpace
-
getLastOperations
Description copied from interface:GigaSpaceReturns the last completed operations on the space instance backing this proxy, up to the given limit. Tracking is performed server-side byOperationTrackingFilterand covers every client hitting that instance, not just this proxy. Enabled together with LRMI network activity monitoring for the space instance.- Specified by:
getLastOperationsin interfaceGigaSpace- Parameters:
limit- max number of records to return
-
getStats
Per-cluster operation counters, failures and observed latency.- Specified by:
getStatsin interfaceMultiClusterGigaSpace
-
close
public void close()Releases the write executors and the deferred-mutation queue. The cluster proxies are not touched - they belong to whoever registered them. Idempotent.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMultiClusterGigaSpace
-
toString
-