Space Configuration

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Section Summary: A single configuration file controls the behavior of the space - persistency, security, networking, memory usage and more. A separate configuration file controls the space container, a logical unit in which the space runs.

This page is specific to:
GigaSpaces 5.x

If you're interested in another version, click it below:
GigaSpaces 6.0
GigaSpaces 6.5

Overview

The space is the main component of GigaSpaces. It is a distributed shared memory unit, which stores data and can perform four basic operations: write, read, take, and notify. The space runs in a Space Container (see below). Each space has an XML configuration file – a schema – that controls its behavior. Several predefined schemas are provided with GigaSpaces. A space configuration can be loaded as a resource, and should be part of the classpath of the JVM running the space. You can configure the space by editing the schema, or using the GigaSpaces Browser.

To learn about space persistency configuration, please see Database Cache and Persistency.

Implicit & Explicit Indexing

In JavaSpaces, reading is based on template matching: an application writes a template, and the space searches sequentially for entries that match it. To improve performance, the space can maintain an index of class properties. This speeds read operations, but also consumes server resources, so you should only index fields commonly used for matching.

If you want the space to automatically index the first n fields of each class, use the <number-implicit-indexes> tag in the space schema. This is called implicit indexing.

To index certain fields of a specific class, implement as part of the entry class the method public static String[] __getSpaceIndexedFields(). This is called explicit indexing.

Clustering Options

The space schema includes the <config-url> tag, which specifies the location of the cluster schema used to cluster the space. Each space could have one cluster schema.

The cluster schema should be accessible to all cluster space members. You can copy the schema to the local directory of each space server, but the drawback is that you have to distribute it yourself. You can put it in a shared network directory, or on a web server, but then you must ensure that this location is available at runtime to every machine running a space in the cluster.

Concurrency Control

GigaSpaces is based on the concept of a working group, which consists of a pool of worker threads and a thread-safe request queue. The worker threads listens to requests on the queue, and each request is handled by one thread.

The thread pool itself is dynamic, in the sense that threads can be created dynamically when the system load increases (which increases the level of concurrency), and threads can be destroyed dynamically when system load decreases (which frees system resources).

The GigaSpaces engine distinguishes between three types of requests:

  • Immediate requests – write, take and read without timeout. These are processed immediately using the user's thread.
  • Time-based requests – take and read with timeout, and notification sequence generation. These are processed using a dedicated working group.
  • Notifications requests – dispatching events to registered clients. These are processed using a dedicated working group.

Space Filters

Filters are interceptors inside the GigaSpaces space engine that enable integration with external systems and implementation of user-defined logic based on space events. With concurrent access to the space, all clients share the same filter instance object where the space engine access the same filter object on behalf of each client. Every non-thread-safe attribute used as part of the filter implementation must be thread-safe protected.

Filters should not use 'heavy' business logic, because this can have a performance penalty.

Space Workers

Space workers allow you to run business logic in the space JVM. Workers are typically used for monitoring, to perform calculation-intensive operations, etc.

The space starts the worker business logic when started, and stops it when shut down. As opposed to space filters and the replications filters, the space does not call the worker implementation when a space operation is called. The worker can register for notifications, call take or read operations, or perform any other space operation. The worker accesses the space in embedded mode – there are no remote calls between worker and space.

The worker consumes memory from the same JVM the space is running.

The Space Container

The space container is a logical unit of the GigaSpaces server. Every space runs in a space container; more than one space can run in a single container. The container maintains a detailed list of the spaces running in it, registers its spaces into the Jini Lookup Service, and maintains the leases it receives. It listens to new lookup services that enter the environment and ensures that its spaces are registered to these lookup services.

Every GigaSpaces container is configured using an XML configuration file - the Container Schema.

Section Contents


Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
(None)