Command | Syntax | Description |
CPC.UPDATE | CPC.UPDATE key item [EX|EXAT|PX|PXAT time]
| Adds an item to the specified TairCpc key. If the key does not exist, the key is created. If the item already exists in the key, the item is not added. |
CPC.ESTIMATE | CPC.ESTIMATE key
| Retrieves the cardinality estimate of the specified TairCpc key after deduplication. The return value is of the DOUBLE type, but you can ignore the decimals and round it to the nearest integer. |
CPC.UPDATE2EST | CPC.UPDATE2EST key item [EX|EXAT|PX|PXAT time]
| Adds an item to the specified TairCpc key and returns the new cardinality estimate of the key after the update. If the key does not exist, the key is created. |
CPC.UPDATE2JUD | CPC.UPDATE2JUD key item [EX|EXAT|PX|PXAT time]
| Adds an item to the specified TairCpc key and returns the new cardinality estimate of the key after the update and the difference between the original and new estimates. If the item is added and no duplication exists, a difference of 1 is returned. If the item already exists, a difference of 0 is returned. If the key does not exist, the key is created. |
CPC.ARRAY.UPDATE | CPC.ARRAY.UPDATE key timestamp item [EX|EXAT|PX|PXAT time] [SIZE size] [WIN window_length]
| Adds an item to the specified TairCpc key within the time window to which the specified timestamp belongs. If the key does not exist, the key is created. SIZE indicates the number of time windows, and WIN indicates the length of each time window. The length is measured in milliseconds. The key is updated as data streams are added to the key. During this process, data that is generated during a time-window range is saved. The time-window range is calculated by using the following formula: Time-window range = SIZE × WIN . Data that is generated outside of this time-window range is overwritten and deleted. SIZE and WIN are valid only at the point in time when the key is created. Note For example, if you want to calculate the amount of data in the key that was generated per minute in the previous 10 minutes, you can set SIZE to 10 (10 time windows) and WIN to 60000 (1 minute for each time window). In this case, if you write the data that was generated during the 11th minute to the key, the data that was generated during the first minute is overwritten and deleted. |
CPC.ARRAY.ESTIMATE | CPC.ARRAY.ESTIMATE key timestamp
| Retrieves the cardinality estimate of the specified TairCpc key within the time window to which the specified timestamp belongs. |
CPC.ARRAY.ESTIMATE.RANGE | CPC.ARRAY.ESTIMATE.RANGE key start_time end_time
| Retrieves the cardinality estimates of the specified TairCpc key within the time windows in the specified time range. The time range is a closed interval. |
CPC.ARRAY.ESTIMATE.RANGE.MERGE | CPC.ARRAY.ESTIMATE.RANGE.MERGE key timestamp range
| Retrieves the cardinality estimate of the specified TairCpc key after merging and deduplication from a specific point in time to the Nth time window backward. N is the value of the range parameter. |
CPC.ARRAY.UPDATE2EST | CPC.ARRAY.UPDATE2EST key timestamp item [EX|EXAT|PX|PXAT time] [SIZE size] [WIN window_length]
| Adds an item to the specified TairCpc key within the time window to which the specified timestamp belongs and returns the new cardinality estimate of the key after the update within the time window. If the key does not exist, the key is created. This command creates the key by using parameters consistent with those used for the CPC.ARRAY.UPDATE command. |
CPC.ARRAY.UPDATE2JUD | CPC.ARRAY.UPDATE2JUD key timestamp item [EX|EXAT|PX|PXAT time] [SIZE size] [WIN window_length]
| Adds an item to the specified TairCpc key within the time window to which the specified timestamp belongs and returns the new cardinality estimate of the key after the update within the time window and the difference between the original and new estimates. If the item is added and no duplication exists, a difference of 1 is returned. If the item already exists, a difference of 0 is returned. If the key does not exist, the key is created. This command creates the key by using parameters consistent with those used for the CPC.ARRAY.UPDATE command. |
DEL | DEL key [key ...]
| Deletes one or more TairCpc keys. |