From f21379eefa9ff1301263faa9a867081ea357b0ce Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Mon, 5 Feb 2024 09:43:59 -0800 Subject: [PATCH] Removed dev logs and comments. Signed-off-by: AWSHurneyt --- .../org/opensearch/commons/alerting/model/Alert.kt | 2 -- .../commons/alerting/model/ClusterMetricsInput.kt | 14 ++------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt index afe3f606..66b758e4 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/Alert.kt @@ -579,8 +579,6 @@ data class Alert( aggregationResultBucket?.innerXContent(builder) if (!clusters.isNullOrEmpty()) builder.field(CLUSTERS_FIELD, clusters.toTypedArray()) - // TODO hurneyt: Calling .toTypedArray() is required for a List field to be successfully added to the alert document. - // Add a unit test that confirms each List, and other lists, call .toTypedArray() builder.endObject() return builder diff --git a/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt b/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt index 7dd7a12e..fc2a1353 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt @@ -33,8 +33,6 @@ data class ClusterMetricsInput( // Verify parameters are valid during creation init { - logger.info("hurneyt ClusterMetricsInput::clusters = $clusters") - require(validateFields()) { "The uri.api_type field, uri.path field, or uri.uri field must be defined." } @@ -51,12 +49,7 @@ data class ClusterMetricsInput( if (url.isNotEmpty() && validateFieldsNotEmpty()) { require(constructedUri == constructUrlFromInputs()) { - "hurneyt The provided URL and URI fields form different URLs." + - "\nurl = $url " + - "\npath = $path " + - "\npathParams = $pathParams " + - "\nconstructedUri = $constructedUri " + - "\nconstructOutput = ${constructUrlFromInputs()}" + "The provided URL and URI fields form different URLs." } } @@ -142,10 +135,7 @@ data class ClusterMetricsInput( xcp.currentToken(), xcp ) - while (xcp.nextToken() != XContentParser.Token.END_ARRAY) { - logger.info("hurneyt ClusterMetricsInput::parseInner xcp.text() = ${xcp.text()}") - clusters.add(xcp.text()) - } + while (xcp.nextToken() != XContentParser.Token.END_ARRAY) clusters.add(xcp.text()) } } }