Skip to content

Commit

Permalink
Misc - removing comments, adding newline, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshu Setia committed Sep 9, 2020
1 parent 1c85f18 commit 9af7fdf
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.elasticsearch.common.xcontent.ToXContent.Params
import org.elasticsearch.common.xcontent.XContentBuilder
import org.elasticsearch.rest.action.RestActions
import java.io.IOException
import java.util.*
import java.util.function.Function

class RefreshSynonymAnalyzerResponse : BroadcastResponse {
Expand Down Expand Up @@ -109,10 +108,6 @@ class RefreshSynonymAnalyzerResponse : BroadcastResponse {
init {
declareBroadcastFields(PARSER)
}

// fun fromXContent(parser: XContentParser?): RefreshSynonymAnalyzerResponse? {
// return PARSER.apply(parser, null)
// }
}

@Throws(IOException::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ class ShardRefreshSynonymAnalyzerResponse : BroadcastShardResponse {
out.writeOptionalString(indexName)
out.writeStringArray(reloadedAnalyzers.toTypedArray())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ class TransportRefreshSynonymAnalyzerAction :
return ShardRefreshSynonymAnalyzerResponse(`in`)
}

// override fun newResponse(
// request: RefreshSynonymAnalyzerRequest?,
// totalShards: Int,
// successfulShards: Int,
// failedShards: Int,
// responses: List<EmptyResult?>?,
// shardFailures: List<DefaultShardOperationFailedException>,
// clusterState: ClusterState?
// ): RefreshSynonymAnalyzerResponse? {
// return RefreshSynonymAnalyzerResponse(totalShards, successfulShards, failedShards, shardFailures)
// }

override fun newResponse(
request: RefreshSynonymAnalyzerRequest?,
totalShards: Int,
Expand All @@ -106,7 +94,7 @@ class TransportRefreshSynonymAnalyzerAction :
@Throws(IOException::class)
override fun shardOperation(request: RefreshSynonymAnalyzerRequest?, shardRouting: ShardRouting): ShardRefreshSynonymAnalyzerResponse {
val indexShard: IndexShard = indicesService.indexServiceSafe(shardRouting.shardId().index).getShard(shardRouting.shardId().id())
logger.info("Plugin reloading search analyzers")
logger.info("Reloading search analyzers for ${shardRouting.shardId().index.name}")
val reloadedAnalyzers: List<String> = indexShard.mapperService().reloadSearchAnalyzers(analysisRegistry)
return ShardRefreshSynonymAnalyzerResponse(shardRouting.shardId(), shardRouting.indexName, reloadedAnalyzers)
}
Expand All @@ -118,9 +106,6 @@ class TransportRefreshSynonymAnalyzerAction :
return clusterState.routingTable().allShards(concreteIndices)
}

// TODO(setiah): Check if md5 content validation possible on nodes
// TODO(setiah): Check if needed to block refresh when cluster has metadata write block
// Why it should be ok? - Indices cache cannot be cleared when there is a metadata write block. Similar to that.
override fun checkGlobalBlock(state: ClusterState, request: RefreshSynonymAnalyzerRequest?): ClusterBlockException? {
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ class RefreshSynonymAnalyzerActionIT : IndexManagementRestTestCase() {
""".trimIndent()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ class RestRefreshSynonymAnalyzerActionIT : IndexManagementRestTestCase() {
assertEquals("index_closed_exception", (response.get("error") as HashMap<*, *>).get("type"))
}
}
}
}

0 comments on commit 9af7fdf

Please sign in to comment.