This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push:
new eae0d18eb RATIS-2005. Fix URF_UNREAD_FIELD in MetricServerCallListener
(#1018)
eae0d18eb is described below
commit eae0d18eb3a33da5ddf4a20a79cd24c95c8c9e7a
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Thu Jan 18 01:41:37 2024 +0100
RATIS-2005. Fix URF_UNREAD_FIELD in MetricServerCallListener (#1018)
---
ratis-grpc/pom.xml | 7 ----
.../intercept/server/MetricServerCallListener.java | 43 ----------------------
.../intercept/server/MetricServerInterceptor.java | 3 +-
3 files changed, 1 insertion(+), 52 deletions(-)
diff --git a/ratis-grpc/pom.xml b/ratis-grpc/pom.xml
index 3352ce16f..71377b5ef 100644
--- a/ratis-grpc/pom.xml
+++ b/ratis-grpc/pom.xml
@@ -80,12 +80,5 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
-
- <dependency>
- <groupId>com.github.spotbugs</groupId>
- <artifactId>spotbugs-annotations</artifactId>
- <scope>provided</scope>
- <optional>true</optional>
- </dependency>
</dependencies>
</project>
diff --git
a/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerCallListener.java
b/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerCallListener.java
deleted file mode 100644
index 77ae4c8f3..000000000
---
a/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerCallListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 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.ratis.grpc.metrics.intercept.server;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import org.apache.ratis.thirdparty.io.grpc.ForwardingServerCallListener;
-import org.apache.ratis.thirdparty.io.grpc.ServerCall;
-import org.apache.ratis.grpc.metrics.MessageMetrics;
-
-@SuppressFBWarnings("URF_UNREAD_FIELD")
-public class MetricServerCallListener<R> extends
ForwardingServerCallListener<R> {
- private final ServerCall.Listener<R> delegate;
- private MessageMetrics metrics;
-
- MetricServerCallListener(
- ServerCall.Listener<R> delegate,
- MessageMetrics metrics
- ){
- this.delegate = delegate;
- this.metrics = metrics;
- }
-
- @Override
- protected ServerCall.Listener<R> delegate() {
- return delegate;
- }
-}
diff --git
a/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerInterceptor.java
b/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerInterceptor.java
index 7e20946ad..e7c1dd17c 100644
---
a/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerInterceptor.java
+++
b/ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerInterceptor.java
@@ -75,8 +75,7 @@ public class MetricServerInterceptor implements
ServerInterceptor, Closeable {
}
String metricNamePrefix = getMethodMetricPrefix(method);
ServerCall<R,S> monitoringCall = new MetricServerCall<>(call,
metricNamePrefix, metrics);
- return new MetricServerCallListener<>(
- next.startCall(monitoringCall, requestHeaders), metrics);
+ return next.startCall(monitoringCall, requestHeaders);
}
@Override