|
@@ -49,11 +49,19 @@ public class ClusterAlertsUtil {
|
|
|
private static final Pattern UNIQUE_WATCH_ID_PROPERTY =
|
|
private static final Pattern UNIQUE_WATCH_ID_PROPERTY =
|
|
|
Pattern.compile(Pattern.quote("${monitoring.watch.unique_id}"));
|
|
Pattern.compile(Pattern.quote("${monitoring.watch.unique_id}"));
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Replace the <code>${monitoring.watch.unique_id}</code> field in the watches.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @see #createUniqueWatchId(ClusterService, String)
|
|
|
|
|
+ */
|
|
|
|
|
+ private static final Pattern VERSION_CREATED_PROPERTY =
|
|
|
|
|
+ Pattern.compile(Pattern.quote("${monitoring.version_created}"));
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* The last time that all watches were updated. For now, all watches have been updated in the same version and should all be replaced
|
|
* The last time that all watches were updated. For now, all watches have been updated in the same version and should all be replaced
|
|
|
* together.
|
|
* together.
|
|
|
*/
|
|
*/
|
|
|
- public static final int LAST_UPDATED_VERSION = Version.V_7_0_0.id;
|
|
|
|
|
|
|
+ public static final int LAST_UPDATED_VERSION = Version.V_7_5_0.id;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* An unsorted list of Watch IDs representing resource files for Monitoring Cluster Alerts.
|
|
* An unsorted list of Watch IDs representing resource files for Monitoring Cluster Alerts.
|
|
@@ -113,6 +121,7 @@ public class ClusterAlertsUtil {
|
|
|
source = CLUSTER_UUID_PROPERTY.matcher(source).replaceAll(clusterUuid);
|
|
source = CLUSTER_UUID_PROPERTY.matcher(source).replaceAll(clusterUuid);
|
|
|
source = WATCH_ID_PROPERTY.matcher(source).replaceAll(watchId);
|
|
source = WATCH_ID_PROPERTY.matcher(source).replaceAll(watchId);
|
|
|
source = UNIQUE_WATCH_ID_PROPERTY.matcher(source).replaceAll(uniqueWatchId);
|
|
source = UNIQUE_WATCH_ID_PROPERTY.matcher(source).replaceAll(uniqueWatchId);
|
|
|
|
|
+ source = VERSION_CREATED_PROPERTY.matcher(source).replaceAll(Integer.toString(LAST_UPDATED_VERSION));
|
|
|
|
|
|
|
|
return source;
|
|
return source;
|
|
|
} catch (final IOException e) {
|
|
} catch (final IOException e) {
|