From a9c6369b15b714a327f6e2b275d8a2711f025160 Mon Sep 17 00:00:00 2001 From: Ronnak Saxena Date: Tue, 5 Sep 2023 13:26:08 -0700 Subject: [PATCH] fixed detekt errors Signed-off-by: Ronnak Saxena --- .../indexmanagement/rollup/interceptor/ResponseInterceptor.kt | 3 ++- .../indexmanagement/rollup/interceptor/RollupInterceptor.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt index 2ce656c57..0e279c22c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/ResponseInterceptor.kt @@ -123,6 +123,7 @@ class ResponseInterceptor( } // Calculated the end time for the current shard index if it is a rollup index with data overlapp + @Suppress("SpreadOperator") fun getRollupEndTime(liveDataStartPoint: Long, rollupIndices: Array, dateTargetField: String): Long { // Build search request to find the maximum rollup timestamp <= liveDataStartPoint val sort = SortBuilders.fieldSort("$dateTargetField.date_histogram").order(SortOrder.DESC) @@ -163,7 +164,7 @@ class ResponseInterceptor( // Returns Pair(startRange: Long, endRange: Long) // Note startRange is inclusive and endRange is exclusive, they are Longs because the type is epoch milliseconds - @Suppress("LongMethod") + @Suppress("LongMethod", "SpreadOperator") fun findOverlap(response: QuerySearchResult): Pair { val job: Rollup = getRollupJob(response)!! // maybe throw a try catch later var dateSourceField: String = "" diff --git a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt index 454e58bc4..3bb16118a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/rollup/interceptor/RollupInterceptor.kt @@ -182,7 +182,7 @@ class RollupInterceptor( return } - @Suppress("SpreadOperator") + @Suppress("SpreadOperator", "NestedBlockDepth") override fun interceptHandler( action: String, executor: String,