From 0099cfac1cf5c43c211d5b749aff3f0252a1adba Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Wed, 15 Nov 2023 13:48:43 -0600 Subject: [PATCH] code review feedback --- .../org/elasticsearch/action/bulk/TransportBulkAction.java | 4 ++-- .../action/bulk/TransportSimulateBulkAction.java | 2 +- .../rest/action/ingest/RestSimulateIngestAction.java | 4 ---- .../action/bulk/TransportSimulateBulkActionTests.java | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java index 689d76e102aec..b89b5e2de7924 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java @@ -366,7 +366,7 @@ protected void doInternalExecute(Task task, BulkRequest bulkRequest, String exec } // Step 3: create all the indices that are missing, if there are any missing. start the bulk after all the creates come back. - createMissingIndicesAndindexData( + createMissingIndicesAndIndexData( task, bulkRequest, executorName, @@ -380,7 +380,7 @@ protected void doInternalExecute(Task task, BulkRequest bulkRequest, String exec /* * This method is responsible for creating any missing indices and indexing the data in the BulkRequest */ - protected void createMissingIndicesAndindexData( + protected void createMissingIndicesAndIndexData( Task task, BulkRequest bulkRequest, String executorName, diff --git a/server/src/main/java/org/elasticsearch/action/bulk/TransportSimulateBulkAction.java b/server/src/main/java/org/elasticsearch/action/bulk/TransportSimulateBulkAction.java index aa9ae619e49bf..7e2fef88c7680 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/TransportSimulateBulkAction.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/TransportSimulateBulkAction.java @@ -64,7 +64,7 @@ public TransportSimulateBulkAction( * request gets a corresponding CREATE response, using information from the request. */ @Override - protected void createMissingIndicesAndindexData( + protected void createMissingIndicesAndIndexData( Task task, BulkRequest bulkRequest, String executorName, diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulateIngestAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulateIngestAction.java index 598d6a6c9f799..e0d9dd95206cf 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulateIngestAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulateIngestAction.java @@ -16,7 +16,6 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.core.RestApiVersion; import org.elasticsearch.core.Tuple; import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.IngestDocument; @@ -69,9 +68,6 @@ public String getName() { @Override @SuppressWarnings("unchecked") public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { - if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) { - request.param("type"); - } String defaultIndex = request.param("index"); FetchSourceContext defaultFetchSourceContext = FetchSourceContext.parseFromRestRequest(request); String defaultPipeline = request.param("pipeline"); diff --git a/server/src/test/java/org/elasticsearch/action/bulk/TransportSimulateBulkActionTests.java b/server/src/test/java/org/elasticsearch/action/bulk/TransportSimulateBulkActionTests.java index c88d1bee1fa00..647eafb5f3cdd 100644 --- a/server/src/test/java/org/elasticsearch/action/bulk/TransportSimulateBulkActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/bulk/TransportSimulateBulkActionTests.java @@ -192,7 +192,7 @@ public void onFailure(Exception e) { Set autoCreateIndices = Set.of(); // unused Map indicesThatCannotBeCreated = Map.of(); // unused long startTime = 0; - bulkAction.createMissingIndicesAndindexData( + bulkAction.createMissingIndicesAndIndexData( task, bulkRequest, randomAlphaOfLength(10),