Spymemcached: Make abstract method in CompletionListener
MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/CompletionListener.java
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/CompletionListener.java
@@ -98,10 +98,8 @@ public abstract class CompletionListener<T> {
scope.close();
}
- protected void processResult(Span span, T future)
- throws ExecutionException, InterruptedException {
- throw new UnsupportedOperationException("processResult was not implemented");
- }
+ protected abstract void processResult(Span span, T future)
+ throws ExecutionException, InterruptedException;
protected void setResultTag(Span span, boolean hit) {
span.setTag(MEMCACHED_RESULT, hit ? HIT : MISS);

MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/SyncCompletionListener.java
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/SyncCompletionListener.java
package datadog.trace.instrumentation.spymemcached;
+import io.opentracing.Span;
import io.opentracing.Tracer;
+import java.util.concurrent.ExecutionException;
+import lombok.extern.slf4j.Slf4j;
+@Slf4j
public class SyncCompletionListener extends CompletionListener<Void> {
public SyncCompletionListener(Tracer tracer, String methodName) {
super(tracer, methodName, false);
}
+ @Override
+ protected void processResult(Span span, Void future)
+ throws ExecutionException, InterruptedException {
+ log.error("processResult was called on SyncCompletionListener. This should never happen. ");
+ }
+
public void done(Throwable thrown) {
closeSyncSpan(thrown);
}

Spymemcached: Make abstract method in CompletionListener