diff --git a/server/src/main/java/org/apache/druid/server/BaseQueryCountResource.java b/server/src/main/java/org/apache/druid/server/BaseQueryCountResource.java index bde2be41c7f..6228318e70c 100644 --- a/server/src/main/java/org/apache/druid/server/BaseQueryCountResource.java +++ b/server/src/main/java/org/apache/druid/server/BaseQueryCountResource.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.druid.server; import org.apache.druid.guice.LazySingleton; diff --git a/server/src/main/java/org/apache/druid/server/BrokerQueryResource.java b/server/src/main/java/org/apache/druid/server/BrokerQueryResource.java index 0250acb765e..9ffadb91b1b 100644 --- a/server/src/main/java/org/apache/druid/server/BrokerQueryResource.java +++ b/server/src/main/java/org/apache/druid/server/BrokerQueryResource.java @@ -77,7 +77,6 @@ public class BrokerQueryResource extends QueryResource responseContextConfig, selfNode, counter - ); this.brokerServerView = brokerServerView; } diff --git a/server/src/main/java/org/apache/druid/server/QueryMetricCounter.java b/server/src/main/java/org/apache/druid/server/QueryMetricCounter.java index 84d2881f790..c62fe18bf6c 100644 --- a/server/src/main/java/org/apache/druid/server/QueryMetricCounter.java +++ b/server/src/main/java/org/apache/druid/server/QueryMetricCounter.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.druid.server; public interface QueryMetricCounter diff --git a/server/src/main/java/org/apache/druid/server/QueryResultPusher.java b/server/src/main/java/org/apache/druid/server/QueryResultPusher.java index bce9ed565e5..ebe5f819a7a 100644 --- a/server/src/main/java/org/apache/druid/server/QueryResultPusher.java +++ b/server/src/main/java/org/apache/druid/server/QueryResultPusher.java @@ -233,6 +233,7 @@ public abstract class QueryResultPusher { if (resultsWriter != null) { resultsWriter.recordFailure(e); + counter.incrementFailed(); if (accumulator != null && accumulator.isInitialized()) { // We already started sending a response when we got the error message. In this case we just give up @@ -242,7 +243,6 @@ public abstract class QueryResultPusher // the future. trailerFields.put(QueryResource.ERROR_MESSAGE_TRAILER_HEADER, e.getMessage()); trailerFields.put(QueryResource.RESPONSE_COMPLETE_TRAILER_HEADER, "false"); - counter.incrementFailed(); return null; } }