Skip to content

Commit

Permalink
Fixed ktlint errors.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Feb 27, 2024
1 parent 0017d44 commit ad95376
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data class BucketLevelTriggerRunResult(
override fun writeTo(out: StreamOutput) {
super.writeTo(out)
out.writeMap(aggregationResultBuckets, StreamOutput::writeString) {
valueOut: StreamOutput, aggResultBucket: AggregationResultBucket ->
valueOut: StreamOutput, aggResultBucket: AggregationResultBucket ->
aggResultBucket.writeTo(valueOut)
}
out.writeMap(actionResultsMap as Map<String, Any>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ class RestGetAlertsAction : BaseRestHandler() {
)

val getAlertsRequest = GetAlertsRequest(table, severityLevel, alertState, monitorId)
return RestChannelConsumer {
channel ->
return RestChannelConsumer { channel ->
client.execute(GetAlertsAction.INSTANCE, getAlertsRequest, RestToXContentListener(channel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class RestGetDestinationsAction : BaseRestHandler() {
destinationType
)
return RestChannelConsumer {
channel ->
channel ->
client.execute(GetDestinationsAction.INSTANCE, getDestinationsRequest, RestToXContentListener(channel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ class RestGetMonitorAction : BaseRestHandler() {
srcContext = FetchSourceContext.DO_NOT_FETCH_SOURCE
}
val getMonitorRequest = GetMonitorRequest(monitorId, RestActions.parseVersion(request), request.method(), srcContext)
return RestChannelConsumer {
channel ->
return RestChannelConsumer { channel ->
client.execute(GetMonitorAction.INSTANCE, getMonitorRequest, RestToXContentListener(channel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class RestIndexDestinationAction : BaseRestHandler() {
WriteRequest.RefreshPolicy.IMMEDIATE
}
val indexDestinationRequest = IndexDestinationRequest(id, seqNo, primaryTerm, refreshPolicy, request.method(), destination)
return RestChannelConsumer {
channel ->
return RestChannelConsumer { channel ->
client.execute(
IndexDestinationAction.INSTANCE, indexDestinationRequest,
indexDestinationResponse(channel, request.method())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ class TransportIndexDestinationAction @Inject constructor(
private fun checkShardsFailure(response: IndexResponse): String? {
var failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
response.shardInfo.failures.forEach { entry ->
failureReasons.append(entry.reason())
}
return failureReasons.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ class TransportIndexEmailAccountAction @Inject constructor(
private fun checkShardsFailure(response: IndexResponse): String? {
val failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
response.shardInfo.failures.forEach { entry ->
failureReasons.append(entry.reason())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ class TransportIndexEmailGroupAction @Inject constructor(
private fun checkShardsFailure(response: IndexResponse): String? {
val failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
response.shardInfo.failures.forEach { entry ->
failureReasons.append(entry.reason())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ class TransportIndexMonitorAction @Inject constructor(
private fun checkShardsFailure(response: IndexResponse): String? {
val failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
response.shardInfo.failures.forEach { entry ->
failureReasons.append(entry.reason())
}
return failureReasons.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,8 +1006,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val response = executeMonitor(monitor, params = DRYRUN_MONITOR)
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
(output["trigger_results"] as HashMap<String, Any>).forEach { _, v ->
assertTrue((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
assertEquals(monitor.name, output["monitor_name"])
Expand Down Expand Up @@ -1036,8 +1035,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val response = executeMonitor(monitor, params = DRYRUN_MONITOR)
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
(output["trigger_results"] as HashMap<String, Any>).forEach { _, v ->
assertTrue((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
assertEquals(monitor.name, output["monitor_name"])
Expand All @@ -1063,8 +1061,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val response = executeMonitor(monitor, params = DRYRUN_MONITOR)
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
(output["trigger_results"] as HashMap<String, Any>).forEach { _, v ->
assertTrue((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
@Suppress("UNCHECKED_CAST")
Expand Down Expand Up @@ -1092,8 +1089,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val response = executeMonitor(monitor, params = DRYRUN_MONITOR)
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
(output["trigger_results"] as HashMap<String, Any>).forEach { _, v ->
assertFalse((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
@Suppress("UNCHECKED_CAST")
Expand Down

0 comments on commit ad95376

Please sign in to comment.