in priam/src/main/java/com/netflix/priam/notification/BackupNotificationMgr.java [106:148]
public void notify(AbstractBackupPath abp, UploadStatus uploadStatus) {
JSONObject jsonObject = new JSONObject();
try {
Set<AbstractBackupPath.BackupFileType> updatedNotifiedBackupFileTypeSet =
getUpdatedNotifiedBackupFileTypesSet(this.notifiedBackupFileTypes);
if (updatedNotifiedBackupFileTypeSet.isEmpty()
|| updatedNotifiedBackupFileTypeSet.contains(abp.getType())) {
jsonObject.put("s3bucketname", this.config.getBackupPrefix());
jsonObject.put("s3clustername", abp.getClusterName());
jsonObject.put("s3namespace", abp.getRemotePath());
jsonObject.put("keyspace", abp.getKeyspace());
jsonObject.put("cf", abp.getColumnFamily());
jsonObject.put("region", abp.getRegion());
jsonObject.put("rack", instanceInfo.getRac());
jsonObject.put("token", abp.getToken());
jsonObject.put("filename", abp.getFileName());
jsonObject.put("uncompressfilesize", abp.getSize());
jsonObject.put("compressfilesize", abp.getCompressedFileSize());
jsonObject.put("backuptype", abp.getType().name());
jsonObject.put("uploadstatus", uploadStatus.name().toLowerCase());
jsonObject.put("compression", abp.getCompression().name());
jsonObject.put("encryption", abp.getEncryption().name());
jsonObject.put("isincremental", abp.isIncremental());
// SNS Attributes for filtering messages. Cluster name and backup file type.
Map<String, MessageAttributeValue> messageAttributes =
getMessageAttributes(jsonObject);
this.notificationService.notify(jsonObject.toString(), messageAttributes);
} else {
logger.debug(
"BackupFileType {} is not in the list of notified component types {}",
abp.getType().name(),
StringUtils.join(notifiedBackupFileTypesSet, ", "));
}
} catch (JSONException exception) {
logger.error(
"JSON exception during generation of notification for upload {}. Local file {}. Ignoring to continue with rest of backup. Msg: {}",
uploadStatus,
abp.getFileName(),
exception.getLocalizedMessage());
}
}