Spymemcached: Make abstract method in CompletionListener
This commit is contained in:
parent
30695555f9
commit
940633b388
|
@ -98,10 +98,8 @@ public abstract class CompletionListener<T> {
|
||||||
scope.close();
|
scope.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void processResult(Span span, T future)
|
protected abstract void processResult(Span span, T future)
|
||||||
throws ExecutionException, InterruptedException {
|
throws ExecutionException, InterruptedException;
|
||||||
throw new UnsupportedOperationException("processResult was not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setResultTag(Span span, boolean hit) {
|
protected void setResultTag(Span span, boolean hit) {
|
||||||
span.setTag(MEMCACHED_RESULT, hit ? HIT : MISS);
|
span.setTag(MEMCACHED_RESULT, hit ? HIT : MISS);
|
||||||
|
|
|
@ -1,12 +1,22 @@
|
||||||
package datadog.trace.instrumentation.spymemcached;
|
package datadog.trace.instrumentation.spymemcached;
|
||||||
|
|
||||||
|
import io.opentracing.Span;
|
||||||
import io.opentracing.Tracer;
|
import io.opentracing.Tracer;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class SyncCompletionListener extends CompletionListener<Void> {
|
public class SyncCompletionListener extends CompletionListener<Void> {
|
||||||
public SyncCompletionListener(Tracer tracer, String methodName) {
|
public SyncCompletionListener(Tracer tracer, String methodName) {
|
||||||
super(tracer, methodName, false);
|
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) {
|
public void done(Throwable thrown) {
|
||||||
closeSyncSpan(thrown);
|
closeSyncSpan(thrown);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue