/** * Save the zookeeper state from before the update to disk. * The following file name format will be used: {@code {yyyyMMdd}T{HHmmss}.{unique long}.old}. * If there are multiple files with the same timestamp, the unique long will prevent the file names from clashing. */ private void maybePersistOldState(Map<String, String> oldState) { if (backupPrefixAndPath != null) { try { writeBackup(backupPrefixAndPath.getSecond(), oldState); } catch (Exception e) { logger.error("Could not write previous state backup file", e); accountServiceMetrics.backupErrorCount.inc(); } } }