parseRetentionToBackupConfig
public static TreeMap<Long,Integer> parseRetentionToBackupConfig(String config)
Parses the topic retention to back-up retention configuration string, and returns the information in a sorted map.
- Configuration string contains comma separated key value pairs. Keys represent topic retention (in days)
and values represent corresponding back-up retention (in days).
- For example, configuration string "0:0,3:3" means topics with retention of 0 or more days have a back-up
retention of 0 days. And, topics with retention of 3 or more days have a back-up retention of 3 days.
- Parsed string is stored and returned to the caller in a sorted map.
- Entries for topics with retention of 0 or more days and topics with infinite(-1) retention are resolvable. These
entries are added to the sorted map, if not supplied explicitly in the configuration string.
This method will throw an exception when it encounters any parsing errors in the configuration string.
Examples:
config string "0:0,3:3" will translate to a sorted map with entries { -1:3, 0:0, 3:3}
config string "1:1,2:2" will translate to a sorted map with entries { -1:2, 0:0, 1:1, 2:2}
- Parameters:
config
- comma separated key value pairs of topic retention to back-up retention
- Returns:
- sorted map of topic retention to back-up retention