Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 2 Administering ActiveSpaces with the Admin CLI : define | create space

define | create space
Command
Syntax
(define | create) space name <string>
(field name <string> type <string> [nullable <boolean>] (, field name <string> type <string> [nullable <boolean>] [encrypted <boolean>)*)
     key ( [type <string>] fields (<string> (, <string>)*))
     distribution_def ('KEY','field0','field1','field2' ...)
     (index ( name <string> [type <string>] fields (<string>
     (, <string>)*)))*
     [distribution_policy <string>]
     [persistence_type <string>]
     [persistence_policy <string>]
     [update_transport <string>]
     [replication_policy <string>]
     [replication_count <integer>]
     [min_seeders <integer>]
     [capacity <long>]
     [eviction_policy <string>]
     [ttl <long>]
     [lock_ttl <long>]
     [lock_wait <long>]
     [lock_scope <long>]
     [space_wait <long>]
     [write_timeout <long>]
     [read_timeout <long>]
     [phase_count <int>]
     [phase_interval <long>]
 
Purpose
Used to create a space.
Remarks
The supported data types for fields are:
Field types boolean, char, short, integer, long, float, double, blob, string, datetime
Distribution policies non_distributed, distributed
Persistence types none, share_all, share_nothing
Update transports unicast, multicast
Lock scopes thread, process
Parameters
The parameters for this command are listed and described in Table 8, define space Parameters.
The data type for a field must be one of the following: boolean, char, short, integer, long, float, double, string, datetime, blob.
Required. Identifies one or more fields (already specified with the field parameter) that will serve as a unique key for the space.
The fields keyword is required.
The type keyword is optional. The default index type is the “hash” index type.
The type keyword is optional. The default is index type is “tree.”
The fields keyword and fields are required
You can specify as many indexes as desired by specifying the indexes, one by one, after the key parameter. You just need to put them one after other after the key field. For example:
In the example, field0, field1, and field2 are defined as key fields and also as distribution def fields.
Optional. Determines whether management of entries in the space is shared among the seeders that have joined the space (distributed) or a single seeder is responsible for all entries in the space (non_distributed). The default value is distributed.
To specify no persistence, specify none. To specify shared all persistence (space members designated as persisters maintain data on disk), specify share-all. To specify shared-nothing persistence (each member maintains data on disk), specify share_nothing.
Optional. A value of sync specifies that replication is done in synchronous mode for the space, so that when an operation modifies one of the entries in the space, the operation only returns an indication of success when that modification has been positively replicated up to the degree of replication required for the space. A value of async specifies that replication is asynchronous.
Optional. If a put operation on a space would cause a seeder to exceed the space's capacity attribute, then the value of this attribute will dictate the result of this operation: if the value is 'none' (in quotes) then there will be no eviction and the operation will fail because the seeder is already at capacity. If the value is 'lru' (in quotes) then the seeder will evict another entry from the space using the 'least recently used' eviction algorithm. The default value is 'none' (no eviction).
thread  The lock applies to the current thread only.
process  The lock applies to the entire application.
Phase count is used in conjunction with the phase_interval parameter, which specifies how long each phase lasts, in milliseconds.
Phase interval is used in conjunction with the phase_count parameter. For example, to specify that there will be 10 phases and each phase duration is 200 milliseconds, you would enter:
Examples
Simple example
define space name 'myspace' (field name 'key' type 'integer' field name 'value' type 'string') key (fields ('key'))
 
With additional parameters
define space name 'testspace' (field name 'key' type 'double' field name 'value' type 'blob') key (fields ('key')) distribution_policy 'non_distributed' replication_count 1 replicated_policy ’sync’ capacity 10000 eviction_policy 'none' persistence_type ’share_nothing’ persistence_policy ’sync’
 
With distribution key parameters
 
define space name 'usertable3' (field name 'KEY' type 'string', field name 'field0' type 'string', field name 'field1' type 'string',field name 'field2' type 'string',field name 'field3' type 'string',field name 'field4' type 'string', field name 'field5' type 'string', field name 'field6' type 'string', field name 'field7' type 'string', field name 'field8' type 'string', field name 'field9' type 'string') key (fields ('KEY','field0','field1','field2')) distribution_def ('KEY','field0','field1','field2') distribution_policy 'distributed' replication_count 0
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved