diff --git a/buildSrc/src/main/resources/checkstyle_suppressions.xml b/buildSrc/src/main/resources/checkstyle_suppressions.xml index df90fe70497f5..058fcfbc33f89 100644 --- a/buildSrc/src/main/resources/checkstyle_suppressions.xml +++ b/buildSrc/src/main/resources/checkstyle_suppressions.xml @@ -143,11 +143,6 @@ - - - - - @@ -395,10 +390,6 @@ - - - - diff --git a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineRequestBuilder.java b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineRequestBuilder.java index f96a5ffbe2488..1073086998b45 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineRequestBuilder.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineRequestBuilder.java @@ -22,7 +22,8 @@ import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -public class GetPipelineRequestBuilder extends MasterNodeReadOperationRequestBuilder { +public class GetPipelineRequestBuilder + extends MasterNodeReadOperationRequestBuilder { public GetPipelineRequestBuilder(ElasticsearchClient client, GetPipelineAction action) { super(client, action, new GetPipelineRequest()); diff --git a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineTransportAction.java b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineTransportAction.java index 540f46982a569..db94448fe35d6 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineTransportAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/GetPipelineTransportAction.java @@ -39,7 +39,8 @@ public class GetPipelineTransportAction extends TransportMasterNodeReadAction listener) throws Exception { + protected void masterOperation(GetPipelineRequest request, ClusterState state, ActionListener listener) + throws Exception { listener.onResponse(new GetPipelineResponse(IngestService.getPipelines(state, request.getIds()))); } diff --git a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java index 38e1f2fb54b5b..e7686773a2378 100644 --- a/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java +++ b/server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java @@ -70,7 +70,8 @@ protected AcknowledgedResponse newResponse() { } @Override - protected void masterOperation(PutPipelineRequest request, ClusterState state, ActionListener listener) throws Exception { + protected void masterOperation(PutPipelineRequest request, ClusterState state, ActionListener listener) + throws Exception { NodesInfoRequest nodesInfoRequest = new NodesInfoRequest(); nodesInfoRequest.clear(); nodesInfoRequest.ingest(true); diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java index a4320d264110e..4c6fb7df62050 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulateExecutionServiceTests.java @@ -103,7 +103,8 @@ public void testExecuteItem() throws Exception { public void testExecuteVerboseItemExceptionWithoutOnFailure() throws Exception { TestProcessor processor1 = new TestProcessor("processor_0", "mock", ingestDocument -> {}); - TestProcessor processor2 = new TestProcessor("processor_1", "mock", ingestDocument -> { throw new RuntimeException("processor failed"); }); + TestProcessor processor2 = new TestProcessor("processor_1", "mock", + ingestDocument -> { throw new RuntimeException("processor failed"); }); TestProcessor processor3 = new TestProcessor("processor_2", "mock", ingestDocument -> {}); Pipeline pipeline = new Pipeline("_id", "_description", version, new CompoundProcessor(processor1, processor2, processor3)); SimulateDocumentResult actualItemResponse = executionService.executeDocument(pipeline, ingestDocument, true); @@ -117,7 +118,8 @@ public void testExecuteVerboseItemExceptionWithoutOnFailure() throws Exception { assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getFailure(), nullValue()); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument(), not(sameInstance(ingestDocument))); assertIngestDocument(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument(), ingestDocument); - assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument().getSourceAndMetadata(), not(sameInstance(ingestDocument.getSourceAndMetadata()))); + assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument().getSourceAndMetadata(), + not(sameInstance(ingestDocument.getSourceAndMetadata()))); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(1).getProcessorTag(), equalTo("processor_1")); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(1).getIngestDocument(), nullValue()); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(1).getFailure(), instanceOf(RuntimeException.class)); @@ -126,7 +128,8 @@ public void testExecuteVerboseItemExceptionWithoutOnFailure() throws Exception { } public void testExecuteVerboseItemWithOnFailure() throws Exception { - TestProcessor processor1 = new TestProcessor("processor_0", "mock", ingestDocument -> { throw new RuntimeException("processor failed"); }); + TestProcessor processor1 = new TestProcessor("processor_0", "mock", + ingestDocument -> { throw new RuntimeException("processor failed"); }); TestProcessor processor2 = new TestProcessor("processor_1", "mock", ingestDocument -> {}); TestProcessor processor3 = new TestProcessor("processor_2", "mock", ingestDocument -> {}); Pipeline pipeline = new Pipeline("_id", "_description", version, @@ -151,7 +154,8 @@ public void testExecuteVerboseItemWithOnFailure() throws Exception { metadata.put(CompoundProcessor.ON_FAILURE_PROCESSOR_TYPE_FIELD, "mock"); metadata.put(CompoundProcessor.ON_FAILURE_PROCESSOR_TAG_FIELD, "processor_0"); metadata.put(CompoundProcessor.ON_FAILURE_MESSAGE_FIELD, "processor failed"); - assertIngestDocument(simulateDocumentVerboseResult.getProcessorResults().get(1).getIngestDocument(), ingestDocumentWithOnFailureMetadata); + assertIngestDocument(simulateDocumentVerboseResult.getProcessorResults().get(1).getIngestDocument(), + ingestDocumentWithOnFailureMetadata); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(1).getFailure(), nullValue()); @@ -175,7 +179,8 @@ public void testExecuteVerboseItemExceptionWithIgnoreFailure() throws Exception assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getFailure(), sameInstance(exception)); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument(), not(sameInstance(ingestDocument))); assertIngestDocument(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument(), ingestDocument); - assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument().getSourceAndMetadata(), not(sameInstance(ingestDocument.getSourceAndMetadata()))); + assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument().getSourceAndMetadata(), + not(sameInstance(ingestDocument.getSourceAndMetadata()))); } public void testExecuteVerboseItemWithoutExceptionAndWithIgnoreFailure() throws Exception { @@ -191,7 +196,8 @@ public void testExecuteVerboseItemWithoutExceptionAndWithIgnoreFailure() throws assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getFailure(), nullValue()); assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument(), not(sameInstance(ingestDocument))); assertIngestDocument(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument(), ingestDocument); - assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument().getSourceAndMetadata(), not(sameInstance(ingestDocument.getSourceAndMetadata()))); + assertThat(simulateDocumentVerboseResult.getProcessorResults().get(0).getIngestDocument().getSourceAndMetadata(), + not(sameInstance(ingestDocument.getSourceAndMetadata()))); } public void testExecuteItemWithFailure() throws Exception { diff --git a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java b/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java index 65f82ceacff59..5b85761d44a9b 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/SimulatePipelineResponseTests.java @@ -56,11 +56,14 @@ public void testSerialization() throws IOException { Iterator expectedResultIterator = response.getResults().iterator(); for (SimulateDocumentResult result : otherResponse.getResults()) { if (isVerbose) { - SimulateDocumentVerboseResult expectedSimulateDocumentVerboseResult = (SimulateDocumentVerboseResult) expectedResultIterator.next(); + SimulateDocumentVerboseResult expectedSimulateDocumentVerboseResult = + (SimulateDocumentVerboseResult) expectedResultIterator.next(); assertThat(result, instanceOf(SimulateDocumentVerboseResult.class)); SimulateDocumentVerboseResult simulateDocumentVerboseResult = (SimulateDocumentVerboseResult) result; - assertThat(simulateDocumentVerboseResult.getProcessorResults().size(), equalTo(expectedSimulateDocumentVerboseResult.getProcessorResults().size())); - Iterator expectedProcessorResultIterator = expectedSimulateDocumentVerboseResult.getProcessorResults().iterator(); + assertThat(simulateDocumentVerboseResult.getProcessorResults().size(), + equalTo(expectedSimulateDocumentVerboseResult.getProcessorResults().size())); + Iterator expectedProcessorResultIterator = + expectedSimulateDocumentVerboseResult.getProcessorResults().iterator(); for (SimulateProcessorResult simulateProcessorResult : simulateDocumentVerboseResult.getProcessorResults()) { SimulateProcessorResult expectedProcessorResult = expectedProcessorResultIterator.next(); assertThat(simulateProcessorResult.getProcessorTag(), equalTo(expectedProcessorResult.getProcessorTag())); @@ -80,7 +83,8 @@ public void testSerialization() throws IOException { assertThat(result, instanceOf(SimulateDocumentBaseResult.class)); SimulateDocumentBaseResult simulateDocumentBaseResult = (SimulateDocumentBaseResult) result; if (simulateDocumentBaseResult.getIngestDocument() != null) { - assertIngestDocument(simulateDocumentBaseResult.getIngestDocument(), expectedSimulateDocumentBaseResult.getIngestDocument()); + assertIngestDocument(simulateDocumentBaseResult.getIngestDocument(), + expectedSimulateDocumentBaseResult.getIngestDocument()); } if (expectedSimulateDocumentBaseResult.getFailure() == null) { assertThat(simulateDocumentBaseResult.getFailure(), nullValue()); @@ -181,8 +185,8 @@ public void testFromXContentWithFailures() throws IOException { Supplier instanceSupplier = SimulatePipelineResponseTests::createTestInstanceWithFailures; //exceptions are not of the same type whenever parsed back boolean assertToXContentEquivalence = false; - AbstractXContentTestCase.testFromXContent(NUMBER_OF_TEST_RUNS, instanceSupplier, supportsUnknownFields(), getShuffleFieldsExceptions(), - getRandomFieldsExcludeFilter(), this::createParser, this::doParseInstance, - this::assertEqualInstances, assertToXContentEquivalence, getToXContentParams()); + AbstractXContentTestCase.testFromXContent(NUMBER_OF_TEST_RUNS, instanceSupplier, supportsUnknownFields(), + getShuffleFieldsExceptions(), getRandomFieldsExcludeFilter(), this::createParser, this::doParseInstance, + this::assertEqualInstances, assertToXContentEquivalence, getToXContentParams()); } } diff --git a/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java b/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java index bc4589ff5d36c..93a48817077e6 100644 --- a/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java +++ b/server/src/test/java/org/elasticsearch/action/ingest/WriteableIngestDocumentTests.java @@ -88,7 +88,8 @@ public void testEqualsAndHashcode() throws Exception { otherIngestMetadata = Collections.unmodifiableMap(ingestMetadata); } - WriteableIngestDocument otherIngestDocument = new WriteableIngestDocument(new IngestDocument(otherSourceAndMetadata, otherIngestMetadata)); + WriteableIngestDocument otherIngestDocument = + new WriteableIngestDocument(new IngestDocument(otherSourceAndMetadata, otherIngestMetadata)); if (changed) { assertThat(ingestDocument, not(equalTo(otherIngestDocument))); assertThat(otherIngestDocument, not(equalTo(ingestDocument))); @@ -96,7 +97,8 @@ public void testEqualsAndHashcode() throws Exception { assertThat(ingestDocument, equalTo(otherIngestDocument)); assertThat(otherIngestDocument, equalTo(ingestDocument)); assertThat(ingestDocument.hashCode(), equalTo(otherIngestDocument.hashCode())); - WriteableIngestDocument thirdIngestDocument = new WriteableIngestDocument(new IngestDocument(Collections.unmodifiableMap(sourceAndMetadata), Collections.unmodifiableMap(ingestMetadata))); + WriteableIngestDocument thirdIngestDocument = new WriteableIngestDocument( + new IngestDocument(Collections.unmodifiableMap(sourceAndMetadata), Collections.unmodifiableMap(ingestMetadata))); assertThat(thirdIngestDocument, equalTo(ingestDocument)); assertThat(ingestDocument, equalTo(thirdIngestDocument)); assertThat(ingestDocument.hashCode(), equalTo(thirdIngestDocument.hashCode())); @@ -114,7 +116,8 @@ public void testSerialization() throws IOException { for (int i = 0; i < numFields; i++) { ingestMetadata.put(randomAlphaOfLengthBetween(5, 10), randomAlphaOfLengthBetween(5, 10)); } - WriteableIngestDocument writeableIngestDocument = new WriteableIngestDocument(new IngestDocument(sourceAndMetadata, ingestMetadata)); + WriteableIngestDocument writeableIngestDocument = + new WriteableIngestDocument(new IngestDocument(sourceAndMetadata, ingestMetadata)); BytesStreamOutput out = new BytesStreamOutput(); writeableIngestDocument.writeTo(out);