MarkLogic Server 11.0 Product Documentation
tieredstorage:range-partition-create

tieredstorage:range-partition-create(
   $database-id as xs:unsignedLong,
   $partition-name as xs:string,
   $lower as xs:anyAtomicType?,
   $upper as xs:anyAtomicType?,
   $forests-per-host as xs:unsignedInt,
   $host-ids as xs:unsignedLong*,
   [$data-directory as xs:string?],
   [$large-data-directory as xs:string?],
   [$fast-data-directory as xs:string?],
   [$options as xs:string*]
) as empty-sequence()

Summary

This function creates forests on the specified hosts and forms a range partition with the specified partition range. All of the forests will share the partition name as their prefix, as well as the range policy settings. The names of the created forests will either be in the form of partition- name-[fixed-digit-number] or partition-name-[fixed-digit-number]-[M,Rn], if local disk failover is configured. For details, see Creating Range 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.
lower Lower bound of partition range.
upper Upper bound of partition range.
forests-per-host Number of forests per host in the partition to be created.
host-ids Ids of hosts on which to create the partition forests.
data-directory The optional data directory of the forests. If no directory is specified, then the forests will be private.
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 the forests. The fast data directory is typically located on a fast storage device, such as an SSD.
options Valid option values include:
failover =[none, local, shared]
If failover is local and multiple hosts are specified, new replica(s) will be created.

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, neither will be set up.

If failover is left unspecified, it will be local unless data directories are on shared platforms such as HDFS and S3.

replicas=N
Specifies the number of replicas/failover forests to configure for local-disk or shared-disk failover.

Example

xquery version "1.0-ml";
import module namespace ts="http://marklogic.com/xdmp/tieredstorage" 
          at "/MarkLogic/tieredstorage.xqy";

ts:range-partition-create(
     xdmp:database("Documents"),
     "2012",
     xs:date("2012-01-01"),xs:date("2012-12-31"), 
     2, 
     (xdmp:host("host-1.marklogic.com"), xdmp:host("host-2.marklogic.com")), 
     "/forest", 
     (), 
     (), 
     ("failover=local","replicas=1"))

(: Creates a range partition, named 2012, on the Documents database with a date range of 1/1/2012
   through 12/31/2012. The partition consists of four master forests and four replica forests
   distributed across two hosts and configured for local disk failover. :)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy