MarkLogic 9 Product Documentation
tieredstorage.partitionResize

tieredstorage.partitionResize(
   database-id as (Number|String),
   partition-name as String,
   forests-per-host as Number,
   host-ids as (Number|String)[],
   [data-directory as String?],
   [large-data-directory as String?],
   [fast-data-directory as String?],
   [options as String[]]
) as null

Summary

This function either creates or combines forests in a partition. For details, see Resizing Partitions in the Administrator's Guide.

Parameters
database-id ID of the database in which the partition will reside.
partition-name Name of the partition.
forests-per-host Number of forests per host in the partition to be created.
host-ids Ids of hosts on which the forests in the partition are to be created on.
data-directory The optional data directory of the forest. If no directory is specified, then it will be a private forest.
large-data-directory The optional directory where large objects are stored. If no directory is specified, then large objects will be stored in DATA_DIR/Forests/FOREST_NAME/Large.
fast-data-directory The optional directory for the fast data directory for this forest. The fast data directory is typically located on a fast storage device, such as an SSD.
options Valid option values include:
timeout=N
Specifies the number of seconds to wait for a forest to re-open after a configuration is made during the migration operation.
local-to-local
Indicates that the partition is to be moved between local storage to local storage. This is the default when no other direction parameter is specified and the type of storage cannot be derived from either the data directory path.
local-to-shared
Indicates that the partition is to be moved between local storage and shared storage. This option supports changing the host.
shared-to-local
Indicates that the partition is to be moved from shared storage to local storage. This option supports changing the host.
shared-to-shared
Indicates that the partition is to be moved from shared storage to shared storage. This type option supports changing the host.
failover=[none, local, shared]
If failover is local and multiple hosts are specified, any existing replica forests will be migrated/combined and new replica forests will be created if no replica forests exist.

Shared disk failover will be set up if failover is shared and multiple hosts are specified. The failover hosts will be chosen to cover as many different zones as possible.

If failover is none, any existing replica forests will be deleted.

If failover is left unspecified, and if local-disk failover is configured, and the data is being migrated/combined to shared storage, the local disk replicas will be removed, and shared-disk failover will be configured. If shared-disk failover is configured, and the data is being migrated/combined from shared storage to local storage, local-disk failover is going to replace to shared-disk failover. In all other scenarios, the failover policy will be left unchanged when not specified.

replicas=N
Specifies the number of replicas/failover hosts to maintain if failover.

Usage Notes

If the partition resides in a database configured for database replication, you cannot combine partitions in which forest overrides exist. An attempt to do so will result in a TS-FORESTHASOVERRIDE exception.

Example

const ts = require('/MarkLogic/tieredstorage');

declareUpdate();
ts.partitionResize(xdmp.database('Documents'), '2017-October', 15, xdmp.host(), '/home/2017-October');
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy