Field definitions describe the format of the data that will be stored in the space. A valid space definition must contain at least one field definition. Field definitions are created by the FieldDef’s
create() method, and can be put (or taken) from space definitions. Field definitions can also be reused and put into as many space definitions as needed (for example when using some fields as
foreign keys to correlate tuples stored in different spaces).
A field definition is created by using the FieldDef's
create() method. A field definition has two mandatory attributes which are provided to the
create() method: a
name and a
type.
For the space definition to be valid, at least one of the defined fields must to be used as a key field. In the Java API, you can specify a set of fields to be used as key fields can be specified by using the SpaceDef's
setKey method and passing it a number of strings containing the space names.
In the C API, you can call the tibasKeyDefCreate() function to specify a single string containing a comma-separated list of field names to use as a key.
For more information on the C API function, see the reference article for the tibasspaceDef_SetDistributionFields() function in chapter 5 of the TIBCO ActiveSpaces C Reference, “SpaceDef.”
When you define a space using the define | create space command in the ActiveSpaces Admin CLI, you can specify the
distribution_def parameter to set specified keys for distribution fields. And when you issue the
show spaces command, the command output indicates any fields that are set up as distribution fields.
For more information, see the reference article for define | create space in chapter 2 of the
TIBCO ActiveSpaces Administration Guide, “Administering ActiveSpaces with the Admin CLI.”
No operations on a space are possible unless the space is in the READY state. To help synchronize applications with the space state, each space has a
SpaceWait attribute. This attribute is the number of milliseconds a space operation will block for and wait for the space to reach the
READY state if it is not in that state at the time the operation is invoked.
ActiveSpaces allows you to alter the fields in a space that is already defined by using the as-admin utility or by calling
Metaspace.alterspace(). The C API and the .NET API provide equivalent operations. There is no disruption in service when you alter the space.
ActiveSpaces allows you to add indexes to a space that is already defined or drop indexes from the space. You can add or drop indexes by using the as-admin utility or by calling
Metaspace.alterspace(). The C API and the .NET API provide equivalent operations. There is no disruption in service. ActiveSpaces builds the new indexes in the background, and when they are ready, sues them automatically to optimize queries.