create

Create gateway receivers, indexes, and regions.

create index

Create an index that can be used when executing queries.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:
create index --name=value --expression=value --region=value 
[--member=value] [--type=value] [--group=value]
name Required. Name for the index to create.
expression Required. Field of the region values that are referenced by the index.
region Required. Name/Path of the region which corresponds to the "from" clause in a query.
member Name/Id of the member on which index will be created.
type Type of the index. Valid values are: range, key and hash. The default type is range if the parameter is not specified.
group The index will be created on all the members in this member group.
Example Commands:
create index --name=MyKeyIndex --expression=region1.Id --region=region1

create region

Create a region with given path and configuration. You must specify either a --type or a --template-region for initial configuration when creating a region. Specifying a --key-constraint and --value-constraint makes object type information available during querying and indexing.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:
create region --name=value [--type=value] [--template-region=value] 
[--group=value(,value)*] [--skip-if-exists=value] [--key-constraint=value] 
[--value-constraint=value] [--enable-statistics=value] 
[--entry-idle-time-expiration=value] [--entry-idle-time-expiration-action=value] 
[--entry-time-to-live-expiration=value] [--entry-time-to-live-expiriation-action=value] 
[--region-idle-time-expiration=value] [--region-idle-time-expiration-action=value] 
[--region-time-to-live-expiration=value] [--region-time-to-live-expiration-action=value] 
[--disk-store=value] [--enable-synchronous-disk=value] [--enable-async-conflation=value] 
[--enable-subscription-conflation=value] [--cache-listener=value(,value)*] 
[--cache-loader=value] [--cache-writer=value] [--async-event-queue-id=value(,value)*] 
[--gateway-sender-id=value(,value)*] [--enable-concurrency-checks=value] 
[--enable-cloning=value] [--concurrency-level=value] [--colocated-with=value] 
[--local-max-memory=value] [--recovery-delay=value] [--redundant-copies=value] 
[--startup-recovery-delay=value] [--total-max-memory=value] [--total-num-buckets=value]
name Required. Name/Path of the region to be created.
type Required (if template-region is not specified.) Type of region to create. Options include: PARTITION, PARTITION_REDUNDANT, REPLICATE, LOCAL, etc.

To get a list of of all region type options, add the --type parameter and then select the TAB key to display a full list.

template-region Required (if type is not specified.) Name/Path of the region whose attributes should be duplicated when creating this region.
group Group(s) of members on which the region will be created.
skip-if-exists Skip region creation if the region already exists. If the parameter is specified without a value, the value is set to true. If the parameter is not specified, the value (default) is false.
key-constraint Fully qualified class name of the objects allowed as region keys. Ensures that keys for region entries are all of the same class.
value-constraint Fully qualified class name of the objects allowed as region values. If not specified, then region values can be of any class.
enable-statistics Whether to gather statistics for the region. Must be true to use expiration on the region.
entry-idle-time-expiration How long the region's entries can remain in the cache without being accessed. The default is no expiration of this type.
entry-idle-time-expiration-action Action to be taken on an entry that has exceeded the idle expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
entry-time-to-live-expiration How long the region's entries can remain in the cache without being accessed or updated. The default is no expiration of this type.
entry-time-to-live-expiration-action Action to be taken on an entry that has exceeded the TTL expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
region-idle-time-expiration How long the region can remain in the cache without being accessed. The default is no expiration of this type.
region-idle-time-expiration-action Action to be taken on a region that has exceeded the idle expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
region-time-to-live-expiration How long the region can remain in the cache without being accessed or updated. The default is no expiration of this type.
region-time-to-live-expiration-action Action to be taken on a region that has exceeded the TTL expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
disk-store Disk Store to be used by this region. The list disk-stores command can be used to display existing disk stores.
enable-synchronous-disk Whether writes are done synchronously for regions that persist data to disk.
enable-async-conflation Whether to allow aggregation of asynchronous TCP/IP messages sent by the producer member of the region. A false value causes all asynchronous messages to be sent individually.
enable-subscription-conflation Whether the server should conflate its messages to the client. A false value causes all server-client messages to be sent individually.
cache-listener Fully qualified class name of a plug-in to be instantiated for receiving after-event notification of changes to the region and its entries. Any number of cache listeners can be configured.
cache-loader Fully qualified class name of a plug-in to be instantiated for receiving notification of cache misses in the region. At most, one cache loader can be defined in each member for the region. For distributed regions, a cache loader may be invoked remotely from other members that have the region defined.
cache-writer Fully qualified class name of a plug-in to be instantiated for receiving before-event notification of changes to the region and its entries. The plug-in may cancel the event. At most, one cache writer can be defined in each member for the region.
async-event-queue-id IDs of the Async Event Queues that will be used for write-behind operations.
gateway-sender-id IDs of the Gateway Senders to which data will be routed.
enable-concurrency-checks Whether Region Version Vectors are implemented. Region Version Vectors are an extension to the versioning scheme that aid in synchronization of replicated regions.
enable-cloning Determines how fromDelta applies deltas to the local cache for delta propagation. When true, the updates are applied to a clone of the value and then the clone is saved to the cache. When false, the value is modified in place in the cache.
concurrency-level Estimate of the maximum number of application threads that will concurrently access a region entry at one time. This attribute does not apply to partitioned regions.
colocated-with Central Region with which this region should be colocated.
local-max-memory Maximum amount of memory, in megabytes, to be used by the region in this process. (The default is 90% of available heap.)
recovery-delay Delay in milliseconds that existing members will wait before satisfying redundancy after another member crashes. The default (value of -1) indicates that redundancy will not be recovered after a a failure.
redundant-copies Number of extra copies of buckets desired. Extra copies allow for both high availability in the face of VM departure (intended or unintended) and load balancing read operations. (Allowed values: 0, 1, 2 and 3)
startup-recovery-delay Delay in milliseconds that new members will wait before satisfying redundancy. -1 indicates that adding new members will not trigger redundancy recovery. The default is to recover redundancy immediately when a new member is added.
total-max-memory Maximum amount of memory, in megabytes, to be used by the region in all processes.
total-num-buckets Total number of hash buckets to be used by the region in all processes. (Default: 113).
Example Commands:
create region --name=region1 --type=REPLICATE_PERSISTENT \
--cache-writer=com.gemstone.gemfire.examples.MyCacheWriter \
--group=Group1 --disk-store=DiskStore1

create region --name=region12 --template-region=/region1

create region --name=region2 --type=REPLICATE \
--cache-listener=com.gemstone.gemfire.examples.MyCacheListener1,\
com.gemstone.gemfire.examples.MyCacheListener2 \
--group=Group1,Group2

create region --name=region3 --type=PARTITION_PERSISTENT --redundant-copies=2 --total-max-memory=1000 \
--startup-recovery-delay=5 --total-num-buckets=100 --disk-store=DiskStore2 \
--cache-listener=com.gemstone.gemfire.examples.MyCacheListener3 \
--group=Group2 --gateway-sender-id=2,3

create region --name=region4 --type=REPLICATE_PROXY --cache-listener=com.gemstone.gemfire.examples.MyCacheListener1 
--group=Group1,Group2
Sample Output:
gfsh>create region --name=myRegion --type=LOCAL
Member  | Status
------- | ---------------------------------------
server1 | Region "/myRegion" created on "server1"