table region pack

Manually triggers the packing of regions.

MapR Database automatically compacts or packs regions and reclaims space when 25% of the data contained in the partitions (max of 3 per tablet) has expired; however, for a time series table, you must run this command to reclaim space used by expired rows and to avoid read amplification, if the old rows are never accessed.

Permissions Required

To run this command, your user ID must have the following permissions:

NOTE The mapr user is not treated as a superuser. MapR Database does not allow the mapr user to run this command unless that user is given the relevant permission or permissions with access-control expressions.

Syntax

CLI
maprcli table region pack
  -path <table path>
  -fid <fid>|all
  [ -nthreads <number of threads> ]
REST
curl -k -X POST 
  'http[s]://<host>:<port>/rest/table/region/pack?path=<path>&fid=<fid>&<parameters>' 
  -u <username>:<password>
NOTE The mapr user is not treated as a superuser. MapR Database does not allow the mapr user to run this command unless that user is given the relevant permission or permissions with access-control expressions.

Parameters

Parameter Description
path

Specifies the path to the table.

  • For a path on the local cluster, start the path at the volume mount point. For example, if you want to pack a table named test under volume1 which has a mount point at /volume1, specify the following path: /volume1/test
  • For a path on another cluster, you must also specify the cluster name in the path. For example, if you want to pack a table named customer under volume1 in the sanfrancisco cluster, specify the following path: /mapr/sanfrancisco/volume1/customer
fid Specifies that you want to pack all table regions or a single table region that you identify with a FID. The output of maprcli table region list lists the FIDs for the table.
nthreads Specifies the number of threads allocated to process the packing of table regions. Default:16

Example

Packs the specified region:

CLI
maprcli table region pack -path /user/test5 -fid 2086.32.131296
REST
curl -k -X POST \
  'https://myhost:8443/rest/table/region/pack?path=%2Fuser%2Ftest5&fid=2086.32.131296' \
  -u mapr:mapr