SSM actions

Actions in SSM are commands that are applied to data if a certain condition in a rule is met.

The table below lists all possible actions in SSM.

SSM actions
Action Arguments Description

addec

[-policyName $policyName] [-codec $codecName -dataNum $dataNum -parityNum $parityNum -cellSize $cellSize]

Sets the requested data policy or an EC policy with the given parameters. For example, RS-6-3-1024k. The cellSize in bytes should be divisible by 1024. SSM supports human-readable values for cellSize, e.g. 1KB, 1MB

allssd

-file $file

Moves a file to an SSD storage

alldisk

-file $file

Moves a file to a disk storage

append

-file $file [-length $length -bufSize $bufSize]

Appends a file with the $length length and $bufSize buffer size

archive

-file $file

Archives a file

cache

-file $file [-replica $replica_num]

Caches a file in the HDFS cache. $replica_num — the number of replicas to be cached. If not specified, SSM will get the replica number for $file from HDFS or use 1 if it’s a directory

checkcompress

-file $file

Shows the compression status of a file. Not applicable to a directory

checkec

-file $file

Shows the EC policy of a file or a directory

checkstorage

-file $file

Shows the storage type of a file

checksum

-file $file

Shows the checksum of a file

compact

-file ['$file1','$file2',..] -containerFile $containerFile

Compacts the requested files to a container file. The compacted files must not have whitespace characters. The containers can’t be compacted

compress

-file $file [-bufSize $bufSize] [-codec $codec]

Compresses a file (not applicable to a directory). If the -bufSize option is not specified, SSM will use the value obtained by dividing the file size by the max number of splits, configured in smartdefault.xml. The least buffer size is 1 MB. SSM supports configuring human-readable values for bufSize, e.g. 1MB. SSM also supports different compression implementations, including Lz4, Bzip2, Zlib and snappy. If the -codec option is not specified, SSM will use Zlib by default

concat

-file $src -dest $dest

Concatenates the requested files in the target file. $src accepts a list of at least two files separated by comma

copy

-file $src -dest $dest [-offset $offset] [-length $length] [-bufSize $size]

Copies the requested file with additional parameters: offset, length, and buffer size

copy2s3

copy2s3 -file $file -dest $s3_dest

Copies a file to an S3 storage. The $s3_dest value must be a URL starting with s3a://

decompress

-file $file [-bufSize $size]

Decompresses a file (not applicable to a directory)

delete

-file $file

Deletes a file

disableec

-policy $policyName

Disables the given EC policy

ec

-file $file [-policy $policyName -bufSize $bufSize]

Changes the EC policy of a file to the given one. If the -policy option is not provided, SSM will use the default one configured in HDFS. If -bufSize is not provided, SSM will use the default value in bytes equivalent to 1 MB. SSM supports human-readable values for bufSize, e.g. 1KB, 1MB

echo

-msg $message

Prints a message

enableec

-policy $policyName

Enables the given EC policy

list

-file $src

Lists all files in a directory

listec

 — 

Lists all EC policies

merge

-file $src -dest $dest [-bufSize $size]

Merges files into the target file. The $src values must contain at least two files separated by comma

onedisk

-file $file

Moves one replica of a file to disk. Not applicable to EC blocks

onessd

-file $file

Moves one replica of a file to SSD. Not applicable to EC blocks

ramdisk

-file $file

Sets the LAZY_PERSIST storage policy. The $file parameter must be a directory with the RAM_DISK parameter configured beforehand

read

-file $file [-bufSize $size]

Reads a file with the given buffer size

removeec

-policy $policyName

Removes the given EC policy

rename

-file $src -dest $dest

Renames a file or a directory

truncate

-file $src -length $length

Truncates a file to the given size

truncate0

-file $src

Truncates a file to 0 size

uncache

-file $file

Uncaches a file from HDFS cache

uncompact

-containerFile $containerFile

Uncompacts a container to the original files

unec

-file $file [-bufSize $bufSize]

Changes the EC policy for a file to replication. If the -bufSize value is not given, SSM will use the default value in bytes equivalent to 1 MB. SSM supports human-readable values for bufSize, e.g. 1KB, 1MB

write

-file $file -length $length [-bufSize $size]

Writes random data to a file with the given buffer size and length

sleep

-m $millisecond

Sleeps for the given number of milliseconds

sync

-dest $dest -preserve $attributes

Syncs a file in $dest and preserves the attributes provided as a comma-separated list: owner, group, permissions, replication, modification-time

distcp

-file $file -target $target [DistCp additional options]

Uses the Hadoop distcp command on given files

user defined actions

 — 

Allows to implement user-defined actions

Found a mistake? Seleсt text and press Ctrl+Enter to report it