volume compact
Runs the compactor to remove recalled data on the Data Fabric cluster or stale data on the tier.
Permissions Required
The user running the command must have one of the following:
- Full control (fc) on the cluster or volume
- Volume edit permissions
Syntax
- CLI
maprcli volume compact [ -cluster <cluster_name> ] -name <vol_name> [ -forcerecallexpiry true|false ] [ -scanopten <true|false>. default:true ] [ -batchstartcid start cid for batch. default:0 ] [ -batchsize batch size. default:0 ]- REST
Request Type POST Request URL http[s]://<host>:<port>/rest/volume/compact?<parameters>
Parameters
|
Parameter |
Description |
|---|---|
cluster |
The name of the cluster on which to run the command. |
forcerecallexpiry |
Specifies whether (true) or not (false) to
purge recalled data on the Data Fabric cluster. If
the command is run with the value for this set to true, the
compactor purges recalled data on the Data Fabric
cluster whether or not the expiry time for recalled data has been reached. If this
is not specified or if the value for this is false, the compactor
purges stale data on the tier and recalled data on the Data Fabric cluster if the expiry time for recalled data
has been reached or has passed. The default value is false. |
name |
The name of the volume. |
scanopten |
The parameter is used for performance optimization. true is
the default value, and true indicates that the volume compaction
optimizations are enabled. One of the compaction optimizations include skipping
containers that do not have enough garbage. This parameter is generally not set to
false, except when you wish to disable the performance
optimization feature for a particular reason. |
batchstartcid |
The container ID at which to start the compaction operation for a batch of
containers. The parameter is used in conjunction with the batchsize
parameter. |
batchsize |
The batchsize or number of containers for which the compaction process is to be
run, starting from and inclusive of container specified as
batchstartcid. The parameter is used in conjunction with the
batchstartcid parameter. |
Examples
Remove stale data on the tier for the volume named sampleVol:
# maprcli volume compact -name sampleVol -json
{
"timestamp":1528299575917,
"timeofday":"2018-06-06 08:39:35.917 GMT-0700 AM",
"status":"OK",
"total":0,
"data":[
],
"messages":[
"Successfully started compaction."
]
}# curl -X POST 'https://abc.sj.us:8443/rest/volume/compact?name=sampleVol' --user mapr:mapr
{"timestamp":1528299575917,"timeofday":"2018-06-06 08:39:35.917 GMT-0700 AM","status":"OK","total":0,"data":[],"messages":["Successfully started compaction."]}Remove recalled data immediately on the volume named sampleVol:
# maprcli volume compact -name sampleVol -forcerecallexpiry true -json
{
"timestamp":1528299765110,
"timeofday":"2018-06-06 08:42:45.110 GMT-0700 AM",
"status":"OK",
"total":0,
"data":[
],
"messages":[
"Successfully started compaction."
]
}# curl -X POST 'https://abc.sj.us:8443/rest/volume/compact?name=sampleVol&forcerecallexpiry=true' --user <username>:<password>
{"timestamp":1528299765110,"timeofday":"2018-06-06 08:42:45.110 GMT-0700 AM","status":"OK","total":0,"data":[],"messages":["Successfully started compaction."]}Run compaction for a batch of 100 containers on the bucket 'ec2' starting at container with container ID 2529
# maprcli volume compact -name ec2 -batchstartcid 2529 -batchsize 100 -json
{
"timestamp":1753948269170,
"timeofday":"2025-07-31 12:51:09.170 GMT-0700 AM",
"status":"OK",
"total":0,
"data":[
],
"messages":[
"Successfully started compaction."
]
}
# curl -X POST 'https://abc.sj.us:8443/rest/volume/compact?name=sampleVol&forcerecallexpiry=true' --user <username>:<password>
{"timestamp":1528299765110,"timeofday":"2018-06-06 08:42:45.110 GMT-0700 AM","status":"OK","total":0,"data":[],"messages":["Successfully started compaction."]}