From 0e3e57c2d6a83f63e00c6cb6abf94ce1d6963bed Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 21 Oct 2024 13:32:03 -0400 Subject: [PATCH] Fix grammar in log warnings. (#2928) Signed-off-by: dblock --- .../test/java/org/opensearch/sql/ppl/ResourceMonitorIT.java | 2 +- .../opensearch/executor/protector/ResourceMonitorPlan.java | 4 ++-- .../sql/opensearch/monitor/OpenSearchMemoryHealthy.java | 2 +- .../sql/opensearch/executor/ResourceMonitorPlanTest.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/ppl/ResourceMonitorIT.java b/integ-test/src/test/java/org/opensearch/sql/ppl/ResourceMonitorIT.java index eed2369590..2799ab1016 100644 --- a/integ-test/src/test/java/org/opensearch/sql/ppl/ResourceMonitorIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/ppl/ResourceMonitorIT.java @@ -34,7 +34,7 @@ public void queryExceedResourceLimitShouldFail() throws IOException { assertEquals(500, exception.getResponse().getStatusLine().getStatusCode()); assertThat( exception.getMessage(), - Matchers.containsString("resource is not enough to run the" + " query, quit.")); + Matchers.containsString("insufficient resources to run the query, quit.")); // update plugins.ppl.query.memory_limit to default value 85% updateClusterSettings( diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java index e3bc48ba72..150a749358 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/executor/protector/ResourceMonitorPlan.java @@ -44,7 +44,7 @@ public R accept(PhysicalPlanNodeVisitor visitor, C context) { @Override public void open() { if (!this.monitor.isHealthy()) { - throw new IllegalStateException("resource is not enough to run the query, quit."); + throw new IllegalStateException("insufficient resources to run the query, quit."); } delegate.open(); } @@ -68,7 +68,7 @@ public boolean hasNext() { public ExprValue next() { boolean shouldCheck = (++nextCallCount % NUMBER_OF_NEXT_CALL_TO_CHECK == 0); if (shouldCheck && !this.monitor.isHealthy()) { - throw new IllegalStateException("resource is not enough to load next row, quit."); + throw new IllegalStateException("insufficient resources to load next row, quit."); } return delegate.next(); } diff --git a/opensearch/src/main/java/org/opensearch/sql/opensearch/monitor/OpenSearchMemoryHealthy.java b/opensearch/src/main/java/org/opensearch/sql/opensearch/monitor/OpenSearchMemoryHealthy.java index 4b7b6c5dcb..bc038cb42f 100644 --- a/opensearch/src/main/java/org/opensearch/sql/opensearch/monitor/OpenSearchMemoryHealthy.java +++ b/opensearch/src/main/java/org/opensearch/sql/opensearch/monitor/OpenSearchMemoryHealthy.java @@ -36,7 +36,7 @@ public boolean isMemoryHealthy(long limitBytes) { } else { log.warn("Memory usage:{} exceed limit:{}", memoryUsage, limitBytes); if (randomFail.shouldFail()) { - log.warn("Fast failure the current request"); + log.warn("Fast failing the current request"); throw new MemoryUsageExceedFastFailureException(); } else { throw new MemoryUsageExceedException(); diff --git a/opensearch/src/test/java/org/opensearch/sql/opensearch/executor/ResourceMonitorPlanTest.java b/opensearch/src/test/java/org/opensearch/sql/opensearch/executor/ResourceMonitorPlanTest.java index 26bcdf6d89..82062bee76 100644 --- a/opensearch/src/test/java/org/opensearch/sql/opensearch/executor/ResourceMonitorPlanTest.java +++ b/opensearch/src/test/java/org/opensearch/sql/opensearch/executor/ResourceMonitorPlanTest.java @@ -47,7 +47,7 @@ void openExceedResourceLimit() { IllegalStateException exception = assertThrows(IllegalStateException.class, () -> monitorPlan.open()); - assertEquals("resource is not enough to run the query, quit.", exception.getMessage()); + assertEquals("insufficient resources to run the query, quit.", exception.getMessage()); } @Test @@ -79,7 +79,7 @@ void nextExceedResourceLimit() { IllegalStateException exception = assertThrows(IllegalStateException.class, () -> monitorPlan.next()); - assertEquals("resource is not enough to load next row, quit.", exception.getMessage()); + assertEquals("insufficient resources to load next row, quit.", exception.getMessage()); } @Test