diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt index d3447ed99..3e4ddcac7 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatIndicesHelpers.kt @@ -53,7 +53,9 @@ class CatIndicesRequestWrapper(val pathParams: String = "") : ActionRequest() { if (pathParams.isNotBlank()) { indicesList = pathParams.split(",").toTypedArray() - require(validate() == null) { "The path parameters do not form a valid, comma-separated list of data streams, indices, or index aliases." } + require(validate() == null) { + "The path parameters do not form a valid, comma-separated list of data streams, indices, or index aliases." + } clusterHealthRequest = clusterHealthRequest.indices(*indicesList) clusterStateRequest = clusterStateRequest.indices(*indicesList) @@ -77,7 +79,7 @@ class CatIndicesResponseWrapper( clusterHealthResponse: ClusterHealthResponse, clusterStateResponse: ClusterStateResponse, indexSettingsResponse: GetSettingsResponse, - indicesStatsResponse: IndicesStatsResponse + indicesStatsResponse: IndicesStatsResponse, ) : ActionResponse(), ToXContentObject { var indexInfoList: List = listOf() @@ -110,7 +112,7 @@ class CatIndicesResponseWrapper( clusterHealthResponse: ClusterHealthResponse, clusterStateResponse: ClusterStateResponse, indexSettingsResponse: GetSettingsResponse, - indicesStatsResponse: IndicesStatsResponse + indicesStatsResponse: IndicesStatsResponse, ): List { val list = mutableListOf() @@ -430,7 +432,7 @@ class CatIndicesResponseWrapper( val priSuggestTotal: String?, val memoryTotal: String?, val priMemoryTotal: String?, - val searchThrottled: String? + val searchThrottled: String?, ) : ToXContentObject, Writeable { companion object { const val HEALTH_FIELD = "health" diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt index 47c35eca8..a5ed7877b 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/util/clusterMetricsMonitorHelpers/CatShardsHelpers.kt @@ -52,7 +52,9 @@ class CatShardsRequestWrapper(val pathParams: String = "") : ActionRequest() { if (pathParams.isNotBlank()) { indicesList = pathParams.split(",").toTypedArray() - require(validate() == null) { "The path parameters do not form a valid, comma-separated list of data streams, indices, or index aliases." } + require(validate() == null) { + "The path parameters do not form a valid, comma-separated list of data streams, indices, or index aliases." + } clusterStateRequest = clusterStateRequest.indices(*indicesList) indicesStatsRequest = indicesStatsRequest.indices(*indicesList) @@ -72,7 +74,7 @@ class CatShardsRequestWrapper(val pathParams: String = "") : ActionRequest() { class CatShardsResponseWrapper( stateResp: ClusterStateResponse, - indicesResp: IndicesStatsResponse + indicesResp: IndicesStatsResponse, ) : ActionResponse(), ToXContentObject { var shardInfoList: List = listOf() @@ -108,7 +110,7 @@ class CatShardsResponseWrapper( private fun compileShardInfo( stateResp: ClusterStateResponse, - indicesResp: IndicesStatsResponse + indicesResp: IndicesStatsResponse, ): List { val list = mutableListOf() @@ -173,7 +175,11 @@ class CatShardsResponseWrapper( searchScrollTotal = getOrNull(commonStats, CommonStats::getSearch, { it.total.scrollCount })?.toString(), segmentsCount = getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getCount)?.toString(), segmentsMemory = getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getZeroMemory)?.toString(), - segmentsIndexWriterMemory = getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getIndexWriterMemory)?.toString(), + segmentsIndexWriterMemory = getOrNull( + commonStats, + CommonStats::getSegments, + SegmentsStats::getIndexWriterMemory + )?.toString(), segmentsVersionMapMemory = getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getVersionMapMemory)?.toString(), fixedBitsetMemory = getOrNull(commonStats, CommonStats::getSegments, SegmentsStats::getBitsetMemory)?.toString(), globalCheckpoint = getOrNull(shardStats, ShardStats::getSeqNoStats, SeqNoStats::getGlobalCheckpoint)?.toString(), @@ -211,7 +217,9 @@ class CatShardsResponseWrapper( shardInfo = shardInfo.copy( unassignedReason = shard.unassignedInfo().reason.name, unassignedAt = UnassignedInfo.DATE_TIME_FORMATTER.format(unassignedTime), - unassignedFor = TimeValue.timeValueMillis(System.currentTimeMillis() - shard.unassignedInfo().unassignedTimeInMillis).stringRep, + unassignedFor = TimeValue.timeValueMillis( + System.currentTimeMillis() - shard.unassignedInfo().unassignedTimeInMillis + ).stringRep, unassignedDetails = shard.unassignedInfo().details ) } @@ -289,7 +297,7 @@ class CatShardsResponseWrapper( val unassignedAt: String?, val unassignedDetails: String?, val unassignedFor: String?, - val unassignedReason: String? + val unassignedReason: String?, ) : ToXContentObject, Writeable { companion object { const val INDEX_FIELD = "index"