diff --git a/server/src/main/java/org/apache/druid/server/compaction/DataSourceCompactibleSegmentIterator.java b/server/src/main/java/org/apache/druid/server/compaction/DataSourceCompactibleSegmentIterator.java index 0abbd00e975..86678e9da9b 100644 --- a/server/src/main/java/org/apache/druid/server/compaction/DataSourceCompactibleSegmentIterator.java +++ b/server/src/main/java/org/apache/druid/server/compaction/DataSourceCompactibleSegmentIterator.java @@ -491,10 +491,9 @@ public class DataSourceCompactibleSegmentIterator implements CompactionSegmentIt remainingStart = skipInterval.getEnd(); } else { // Ignore this skipInterval - log.warn( + log.debug( "skipInterval[%s] is not contained in remainingInterval[%s]", - skipInterval, - new Interval(remainingStart, remainingEnd) + skipInterval, new Interval(remainingStart, remainingEnd) ); } } diff --git a/server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java b/server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java index a72cb22e151..cea693a5675 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeon.java @@ -76,14 +76,10 @@ import java.util.concurrent.atomic.AtomicReference; public class HttpLoadQueuePeon implements LoadQueuePeon { public static final TypeReference> REQUEST_ENTITY_TYPE_REF = - new TypeReference>() - { - }; + new TypeReference<>() {}; public static final TypeReference> RESPONSE_ENTITY_TYPE_REF = - new TypeReference>() - { - }; + new TypeReference<>() {}; private static final EmittingLogger log = new EmittingLogger(HttpLoadQueuePeon.class); @@ -389,9 +385,10 @@ public class HttpLoadQueuePeon implements LoadQueuePeon log.info("Stopping load queue peon for server[%s].", serverId); stopped = true; - // Cancel all queued requests - queuedSegments.forEach(holder -> onRequestCompleted(holder, RequestStatus.CANCELLED)); - log.info("Cancelled [%d] requests queued on server [%s].", queuedSegments.size(), serverId); + if (!queuedSegments.isEmpty()) { + queuedSegments.forEach(holder -> onRequestCompleted(holder, RequestStatus.CANCELLED)); + log.info("Cancelled [%d] requests queued on server[%s].", queuedSegments.size(), serverId); + } segmentsToDrop.clear(); segmentsToLoad.clear(); diff --git a/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java b/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java index 5928f47e0bb..fa4ce7cc45b 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/loading/HttpLoadQueuePeonTest.java @@ -19,7 +19,6 @@ package org.apache.druid.server.coordinator.loading; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; @@ -350,9 +349,8 @@ public class HttpLoadQueuePeonTest httpResponseHandler.handleResponse(httpResponse, null); try { List changeRequests = MAPPER.readValue( - request.getContent().array(), new TypeReference>() - { - } + request.getContent().array(), + HttpLoadQueuePeon.REQUEST_ENTITY_TYPE_REF ); List statuses = new ArrayList<>(changeRequests.size());