Space

You can define tuple fields, key definitions, affinity definition, index definitions, and other advanced configurations in the Space shared resource .

Configuration

In the Configuration tab, you can specify the space name and define tuple fields.

A field is a portion of a tuple, similar to a single value in a column of a database table. A field is associated with a name, a type, and whether or not the field is nullable. If a field is nullable, the value for this field can be null.

To create a field, click the icon.

The following table describes the fields in the Configuration tab of the Space shared resource:

Field Module Property? Description
Name No Specifies a name for the Space shared resource.

The name must start with a letter or a digit and can include alphanumeric characters, "-", or "_".

The Field Definition panel includes the following fields:
Field Name No Specifies a field name.
The field name must start with a letter, and can include any combination of letters, numbers, and underscores (_).
Note: The following key words cannot be defined as fields: "not", "between", "like", "or", "and", "in", "null", and "Is". These key words are case sensitive.
Field Type No Select one field type from the following options:
  • BOOLEAN
  • CHAR
  • SHORT
  • INTEGER
  • LONG
  • FLOAT
  • DOUBLE
  • BLOB
  • STRING
  • DATETIME
Allow Field to be Null No Indicates whether this field can be null.
  • By default, this field is set to false, which indicates that the field cannot be null.
  • Select the check box to set this field to true, which indicates that the field can be null.
Encrypt Non-Key Data Field No Indicates whether this field is encrypted.
  • By default, this field is set to false, which indicates that the non-key data field is not encrypted.
  • Select the check box to set this field to true, which indicates that the non-key data field is encrypted.

Key Definition

In the Key Definition tab, you must set at least one of the defined fields as the key fields to make the space definition valid.

The following table describes the fields in the Key Definition tab of the Space shared resource:

Field Module Property? Description
Key Index Type No Specifies the index type for a key field:
  • HASH: speeds up queries where the filter is an exact match of a value to the field. For example, "field = value".By default, this option is selected.
  • TREE: speeds up queries where the filter is a range match of a value to the field. For example, "field > value".
An index of a key field in the space is created automatically.
Key Field Names No Click the icon to select the key fields.
Note: If the name of a field that is specified as a key is changed, you have to update the corresponding key field name manually.

Affinity Definition

In the Affinity Definition tab, you can select the key fields to be configured for affinity. You can use the affinity key fields to control the distribution of tuples so that tuples that have the same values for a particular field or fields can be stored in the same seeder.

The following table describes the fields in the Affinity Definition tab of the Space shared resource:

Field Module Property? Description
Affinity Key Field Names No Click the icon to select the key fields to be configured for affinity.

See TIBCO ActiveSpaces Developer’s Guide for detailed information.

Advanced

In the Advanced tab, You can specify the advanced configurations about operations in the space. All the configurations in this tab are optional.

The following table describes the fields in the Advanced tab of the Space shared resource:

Field Module Property? Description
Distribution Policy Yes Select one type of the distribution policy, which defines how to manage data in the space:
  • NON_DISTRIBUTED: A single seeder is responsible for all tuples in the space.
  • DISTRIBUTED: The management of entries in the space is shared among the seeders that have joined the space. By default, this option is selected.
  • ADDRESSED: This option is deprecated.
Capacity Yes Specifies the maximum number of tuples that can be stored in the space for each seeder.

The default value is -1, which indicates that an infinite number of entries are stored for each seeder.

The value of 0 is invalid.

Eviction Policy Yes Select one type of the eviction policy, which is applied when an operation causes the capacity to be exceeded:
  • NONE: no tuples are evicted from the space. The operation fails to store additional tuples in the space. By default, this option is selected.
  • LRU: uses the Least Recently Used (LRU) eviction algorithm to evict tuples from the space.
Persistence Type Yes Select one persistence type for data from the following options:
  • NONE: the persistence is not enabled for the space. By default, this option is selected.
  • SHARE_ALL: all the seeders in a space share a single persister or a set of persisters if data loss occurs.
  • SHARE_NOTHING: each seeder that joins a space maintains a copy of space data on disk if data loss occurs.
Note: When you configure a share-nothing persistence, you can use a unique name for each member joining the space, and specify an existing directory path for data storage.

See TIBCO ActiveSpaces Developer’s Guide for more information.

Persistence Policy Yes Select one type of the persistence policy, which defines how changes to the space are persisted:
  • NONE: the changes to the space cannot be persisted.
  • SYNC: the changes to the space can be persisted synchronously. By default, this option is selected.
  • ASYNC: the changes to the space can be persisted asynchronously.
Minimum Seeder Count Yes Specifies the minimum number of seeders that have to join the space before the space becomes ready. The default value is 1.

The value of 0 is invalid.

Replication Count Yes Specifies the degree of replication. The default value is 0, which indicates no replication is performed.

See TIBCO ActiveSpaces Developer’s Guide for more information.

Replication Policy Yes Select one type of the replication policy, which defines how to replicate data stored in a space:
  • SYNC: data is replicated synchronously. By default, this option is selected.
  • ASYNC: data is replicated asynchronously.
HostAware Replication Yes Select the HostAware Replication check box to enable host-aware replication.

When you use host-aware replication, data from seeders in one group is replicated to seeders in other groups. By default this check box is selected.

With host-aware replication, you can group seeders based on their member names. To organize seeders into groups, member names must be in the format of <group_name>.<member_name>.

The plug-in groups all seeders with the same group name together and their data is replicated to seeders outside of that group.

Entry Time to Live (milliseconds) Yes Specifies the amount of time in milliseconds that must have elapsed since the tuple was created or last modified before it expired.
Lock Time to Live (milliseconds) Yes Specifies the duration in milliseconds of a lock applied to the space.

If a thread does not clear the lock applied to a tuple within the specified lock time-to-live period, the system automatically clears the lock.

Lock Wait (milliseconds) Yes Specifies the amount of time in milliseconds that an operation attempting to modify a locked tuple waits for the lock to be cleared.
Space Wait (milliseconds) Yes Specifies a timeout value in milliseconds that applies to operations that cannot be processed because the space is not in the READY state.

The default value is 60000.

Write Timeout (milliseconds) Yes Specifies a write timeout value in milliseconds that applies to write operations that cannot be processed because the space is occupied.

The default value is 60000.

Read Timeout (milliseconds) Yes Specifies a read timeout value in milliseconds that applies to read operations that cannot be processed because the space is occupied.

The default value is 60000.

Query Limit Yes Specifies the number of tuples returned from a query operation.

The default value is 10000.

Query Timeout (milliseconds) Yes Specifies the amount of time in milliseconds that you have to wait before the query operation of TIBCO ActiveSpaces returns query results.

The default value is -1, which indicates querying indefinitely.

Index Definition

In the Index Definition tab, you can select the defined fields as indexes to accelerate the filtering of data when processing queries. An index uses memory to locate matching records, which is faster than iterating through every record.

To create an index, click the icon.

The following table describes the fields in the Index Definition tab of the Space shared resource:

Field Description
Index Name Specifies the name of an index.

The index name is a string and must start with a letter or an underscore (_). The name can include any combination of letters and numbers.

Index Type Select an index type from the following options:
  • HASH: Speed up queries where the filter is an exact match of a value to the field. For example, "field = value". By default, this option is selected.
  • TREE: Speed up queries where the filter is a range match of a value to the field. For example, "field > value".
Index Field Names Specifies the field names that are included in the index. You can create a composite index that includes more than one field.

Click the icon to select the field names you want to be indexed.