Package com.google.api.gax.tracing
Class BaseApiTracer
java.lang.Object
com.google.api.gax.tracing.BaseApiTracer
- All Implemented Interfaces:
ApiTracer
- Direct Known Subclasses:
OpencensusTracer
@InternalApi("For internal use by google-cloud-java clients only")
public class BaseApiTracer
extends Object
implements ApiTracer
A base implementation of
ApiTracer that does nothing. With the deprecation of Java 7
support, all the methods in ApiTracer are now made default, we no longer need a base
class that does nothing. This class should be removed once all the references to it are removed
in Google Cloud Client Libraries.
For internal use only.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.api.gax.tracing.ApiTracer
ApiTracer.Scope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an annotation that the attempt was cancelled by the user.voidattemptFailed(Throwable error, org.threeten.bp.Duration delay) Adds an annotation that the attempt failed, but another attempt will be made after the delay.voidAdds an annotation that the attempt failed and that no further attempts will be made because retry limits have been reached.voidattemptPermanentFailure(Throwable error) Adds an annotation that the attempt failed and that no further attempts will be made because the last error was not retryable.voidattemptStarted(int attemptNumber) Adds an annotation that an attempt is about to start.voidattemptStarted(Object request, int attemptNumber) Adds an annotation that an attempt is about to start with additional information from the request.voidAdds an annotation that the attempt succeeded.voidbatchRequestSent(long elementCount, long requestSize) Adds an annotation that a batch of writes has been flushed.voidAnnotates the operation with selected connection id from theChannelPool.static ApiTracerinScope()Asks the underlying implementation to install itself as a thread local.voidlroStartFailed(Throwable error) Signals that the initial RPC for the long running operation failed.voidSignals that the initial RPC successfully started the long running operation.voidSignals that the operation was cancelled by the user.voidoperationFailed(Throwable error) Signals that the overall operation has failed and no further attempts will be made.voidSignals that the overall operation has finished successfully.voidAdds an annotation that a streaming request has been sent.voidAdds an annotation that a streaming response has been received.
-
Constructor Details
-
BaseApiTracer
protected BaseApiTracer()
-
-
Method Details
-
getInstance
-
inScope
Description copied from interface:ApiTracerAsks the underlying implementation to install itself as a thread local. This allows for interop between clients using gax and external resources to share the same implementation of the tracing. For example OpenCensus will install a thread local that can read by the GRPC. -
operationSucceeded
public void operationSucceeded()Description copied from interface:ApiTracerSignals that the overall operation has finished successfully. The tracer is now considered closed and should no longer be used.- Specified by:
operationSucceededin interfaceApiTracer
-
operationCancelled
public void operationCancelled()Description copied from interface:ApiTracerSignals that the operation was cancelled by the user. The tracer is now considered closed and should no longer be used.- Specified by:
operationCancelledin interfaceApiTracer
-
operationFailed
Description copied from interface:ApiTracerSignals that the overall operation has failed and no further attempts will be made. The tracer is now considered closed and should no longer be used.- Specified by:
operationFailedin interfaceApiTracer- Parameters:
error- the final error that caused the operation to fail.
-
connectionSelected
Description copied from interface:ApiTracerAnnotates the operation with selected connection id from theChannelPool.- Specified by:
connectionSelectedin interfaceApiTracer- Parameters:
id- the local connection identifier of the selected connection.
-
attemptStarted
public void attemptStarted(int attemptNumber) Description copied from interface:ApiTracerAdds an annotation that an attempt is about to start. In general this should occur at the very start of the operation. The attemptNumber is zero based. So the initial attempt will be 0.- Specified by:
attemptStartedin interfaceApiTracer- Parameters:
attemptNumber- the zero based sequential attempt number.
-
attemptStarted
Description copied from interface:ApiTracerAdds an annotation that an attempt is about to start with additional information from the request. In general this should occur at the very start of the operation. The attemptNumber is zero based. So the initial attempt will be 0.- Specified by:
attemptStartedin interfaceApiTracer- Parameters:
request- request of this attempt.attemptNumber- the zero based sequential attempt number.
-
attemptSucceeded
public void attemptSucceeded()Description copied from interface:ApiTracerAdds an annotation that the attempt succeeded.- Specified by:
attemptSucceededin interfaceApiTracer
-
attemptCancelled
public void attemptCancelled()Description copied from interface:ApiTracerAdd an annotation that the attempt was cancelled by the user.- Specified by:
attemptCancelledin interfaceApiTracer
-
attemptFailed
Description copied from interface:ApiTracerAdds an annotation that the attempt failed, but another attempt will be made after the delay.- Specified by:
attemptFailedin interfaceApiTracer- Parameters:
error- the transient error that caused the attempt to fail.delay- the amount of time to wait before the next attempt will start.
-
attemptFailedRetriesExhausted
Description copied from interface:ApiTracerAdds an annotation that the attempt failed and that no further attempts will be made because retry limits have been reached.- Specified by:
attemptFailedRetriesExhaustedin interfaceApiTracer- Parameters:
error- the last error received before retries were exhausted.
-
attemptPermanentFailure
Description copied from interface:ApiTracerAdds an annotation that the attempt failed and that no further attempts will be made because the last error was not retryable.- Specified by:
attemptPermanentFailurein interfaceApiTracer- Parameters:
error- the error that caused the final attempt to fail.
-
lroStartFailed
Description copied from interface:ApiTracerSignals that the initial RPC for the long running operation failed.- Specified by:
lroStartFailedin interfaceApiTracer- Parameters:
error- the error that caused the long running operation fail.
-
lroStartSucceeded
public void lroStartSucceeded()Description copied from interface:ApiTracerSignals that the initial RPC successfully started the long running operation. The long running operation will now be polled for completion.- Specified by:
lroStartSucceededin interfaceApiTracer
-
responseReceived
public void responseReceived()Description copied from interface:ApiTracerAdds an annotation that a streaming response has been received.- Specified by:
responseReceivedin interfaceApiTracer
-
requestSent
public void requestSent()Description copied from interface:ApiTracerAdds an annotation that a streaming request has been sent.- Specified by:
requestSentin interfaceApiTracer
-
batchRequestSent
public void batchRequestSent(long elementCount, long requestSize) Description copied from interface:ApiTracerAdds an annotation that a batch of writes has been flushed.- Specified by:
batchRequestSentin interfaceApiTracer- Parameters:
elementCount- the number of elements in the batch.requestSize- the size of the batch in bytes.
-