SSM rules
The rules in SSM consist of four parts:
<objects>: <trigger> | <conditions> | <commands>
The tables below describe possible values for objects, triggers, and conditions. The commands are described in the actions reference.
For more information on rules syntax, see the Define rules in SSM article; and more complex rules usage examples can be found in SSM rule usage examples.
Property | Abbreviation | Description |
---|---|---|
accessCount(interval) |
ac |
The access count during the given time interval |
accessCountTop(interval,N) |
acTop |
The topmost N for access count during the given time interval |
accessCountBottom(interval,N) |
acBot |
The bottommost N for access count during the given time interval |
accessCountTopOnStoragePolicy(interval, N, "$StoragePolicy") |
acTopSp |
The topmost N for access count with regard to a storage policy. The supported HDFS storage policies are:
|
accessCountBottomOnStoragePolicy(interval,N, "$StoragePolicy") |
acBotSp |
The bottommost N for access count with regard to a storage policy during the last time interval |
age |
— |
The time span from last modification moment to now |
atime |
— |
The last access time |
blocksize |
— |
The block size of the file |
ecPolicy |
— |
The erasure coding policy of the file |
inCache |
— |
The file is in the cache storage |
isDir |
— |
The file is a directory |
length |
— |
The length of the file in bytes. Currently, only numeric values are supported, which indicates the number of bytes |
mtime |
— |
The last modification time of the file |
path |
— |
The file path in HDFS |
storagePolicy |
— |
The storage policy of the file |
unsynced |
— |
The file is not synced |
A condition can include one of two possible time values:
-
<time>
— the exact time in the"yyyy-MM-dd HH:mm:ss:ms"
format,now
, ornow+<TimeInterval>
. For example,"2017-07-29 23:00:00"
,now+7day
. -
<TimeInterval>
— a time interval described as a number and a unit (5sec
,5min
,5day
) or in the formatTime - Time
, for example,now - "2016-03-19 23:00:00"
.
Value | Description | Example |
---|---|---|
at <time> |
Execute the rule at the given time |
at "2017-07-29 23:00:00" at now |
every <TimeInterval> |
Execute the rule at the given frequency |
every 1min |
from <Time> [To <Time>] |
Along with |
every 1day from now every 1min from now to now+7day |
Operator | Description | Example |
---|---|---|
Logical operator |
and, or, not |
accessCount(1min) > 0 and length = 5KB |
Digital operator |
+, -, *, /, % |
acTop - acBot > 0 |
Compare |
>, >=, <, <=, ==, != |
accessCount(1min) > 0 |