Skip to content

Commit 72a4fdf

Browse files
Fix ktlint issues for replication libs
Signed-off-by: aggarwalShivani <shivani.aggarwal@nokia.com>
1 parent e46f3b6 commit 72a4fdf

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

src/main/kotlin/org/opensearch/commons/replication/ReplicationPluginInterface.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ package org.opensearch.commons.replication
66

77
import org.opensearch.action.support.master.AcknowledgedResponse
88
import org.opensearch.client.node.NodeClient
9-
import org.opensearch.commons.replication.action.StopIndexReplicationRequest
109
import org.opensearch.commons.replication.action.ReplicationActions.UNFOLLOW_REPLICATION_ACTION_TYPE
10+
import org.opensearch.commons.replication.action.StopIndexReplicationRequest
1111
import org.opensearch.commons.utils.recreateObject
1212
import org.opensearch.core.action.ActionListener
1313
import org.opensearch.core.action.ActionResponse
1414
import org.opensearch.core.common.io.stream.Writeable
1515

16-
1716
/**
1817
* Transport action plugin interfaces for the cross-cluster-replication plugin.
1918
*/

src/main/kotlin/org/opensearch/commons/replication/action/ReplicationActions.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ object ReplicationActions {
2828
ActionType(STOP_REPLICATION_ACTION_NAME, ::AcknowledgedResponse)
2929
val UNFOLLOW_REPLICATION_ACTION_TYPE =
3030
ActionType(UNFOLLOW_REPLICATION_ACTION_NAME, ::AcknowledgedResponse)
31-
3231
}

src/main/kotlin/org/opensearch/commons/replication/action/StopIndexReplicationRequest.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package org.opensearch.commons.replication.action
22

33
import org.opensearch.action.ActionRequestValidationException
4-
import org.apache.logging.log4j.LogManager
54
import org.opensearch.action.IndicesRequest
65
import org.opensearch.action.support.IndicesOptions
76
import org.opensearch.action.support.master.AcknowledgedRequest
87
import org.opensearch.core.common.io.stream.StreamInput
98
import org.opensearch.core.common.io.stream.StreamOutput
10-
import org.opensearch.core.xcontent.*
11-
class StopIndexReplicationRequest : AcknowledgedRequest<StopIndexReplicationRequest>, IndicesRequest.Replaceable, ToXContentObject {
9+
import org.opensearch.core.xcontent.ObjectParser
10+
import org.opensearch.core.xcontent.ToXContent
11+
import org.opensearch.core.xcontent.ToXContentObject
12+
import org.opensearch.core.xcontent.XContentBuilder
13+
import org.opensearch.core.xcontent.XContentParser
14+
15+
class StopIndexReplicationRequest :
16+
AcknowledgedRequest<StopIndexReplicationRequest>, IndicesRequest.Replaceable, ToXContentObject {
1217
lateinit var indexName: String
1318
constructor(indexName: String) {
1419
this.indexName = indexName
@@ -17,7 +22,7 @@ class StopIndexReplicationRequest : AcknowledgedRequest<StopIndexReplicationRequ
1722
private constructor() {
1823
}
1924

20-
constructor(inp: StreamInput): super(inp) {
25+
constructor(inp: StreamInput) : super(inp) {
2126
indexName = inp.readString()
2227
}
2328
companion object {
@@ -30,7 +35,6 @@ class StopIndexReplicationRequest : AcknowledgedRequest<StopIndexReplicationRequ
3035
stopIndexReplicationRequest.indexName = followerIndex
3136
return stopIndexReplicationRequest
3237
}
33-
private val log = LogManager.getLogger(StopIndexReplicationRequest::class.java)
3438
}
3539

3640
override fun validate(): ActionRequestValidationException? {
@@ -59,4 +63,4 @@ class StopIndexReplicationRequest : AcknowledgedRequest<StopIndexReplicationRequ
5963
super.writeTo(out)
6064
out.writeString(indexName)
6165
}
62-
}
66+
}

src/test/kotlin/org/opensearch/commons/replication/ReplicationPluginInterfaceTests.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ internal class ReplicationPluginInterfaceTests {
2525

2626
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
2727
private lateinit var client: NodeClient
28+
2829
@Test
2930
fun stopReplication() {
3031
val request = Mockito.mock(StopIndexReplicationRequest::class.java)
@@ -40,4 +41,4 @@ internal class ReplicationPluginInterfaceTests {
4041
ReplicationPluginInterface.stopReplication(client, request, listener)
4142
Mockito.verify(listener, Mockito.times(1)).onResponse(ArgumentMatchers.eq(response))
4243
}
43-
}
44+
}

src/test/kotlin/org/opensearch/commons/replication/action/StopIndexReplicationRequestTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ internal class StopIndexReplicationRequestTests {
2020
assertEquals(request.indexName, recreatedRequest.indexName)
2121
assertNull(recreatedRequest.validate())
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)