Class ProtostellarRequest<TGrpcRequest>
- java.lang.Object
-
- com.couchbase.client.core.protostellar.ProtostellarRequest<TGrpcRequest>
-
- Direct Known Subclasses:
ProtostellarCollectionManagerRequest
,ProtostellarKeyValueRequest
@Internal public class ProtostellarRequest<TGrpcRequest> extends Object
Holds onto a GRPC request, along with pertaining mutable and immutable state bound to the request's lifetime.
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceType
serviceType
-
Constructor Summary
Constructors Constructor Description ProtostellarRequest(TGrpcRequest request, CoreProtostellar core, ServiceType serviceType, String requestName, RequestSpan span, Duration timeout, boolean readonly, RetryStrategy retryStrategy, Map<String,Object> clientContext, long encodeDurationNanos, Consumer<Map<String,Object>> contextSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
absoluteTimeout()
ProtostellarRequestBehaviour
cancel(CancellationReason reason)
CancellationReason
cancellationReason()
boolean
completed()
GenericErrorContext
context()
long
createdAt()
com.couchbase.client.core.deps.io.grpc.Deadline
deadline()
void
dispatchDuration(long durationNanos)
boolean
failed()
void
incrementRetryAttempts(Duration duration, RetryReason reason)
long
logicalRequestLatency()
void
raisedResponseToUser(Throwable err)
Crucial to always ultimately call this on every request, and just once.boolean
readonly()
TGrpcRequest
request()
int
retryAttempts()
RetryStrategy
retryStrategy()
ServiceType
serviceType()
RequestSpan
span()
boolean
succeeded()
Duration
timeout()
boolean
timeoutElapsed()
-
-
-
Field Detail
-
serviceType
protected final ServiceType serviceType
-
-
Constructor Detail
-
ProtostellarRequest
public ProtostellarRequest(TGrpcRequest request, CoreProtostellar core, ServiceType serviceType, String requestName, RequestSpan span, Duration timeout, boolean readonly, RetryStrategy retryStrategy, Map<String,Object> clientContext, long encodeDurationNanos, @Nullable Consumer<Map<String,Object>> contextSupplier)
-
-
Method Detail
-
request
public TGrpcRequest request()
-
span
public RequestSpan span()
-
raisedResponseToUser
public void raisedResponseToUser(@Nullable Throwable err)
Crucial to always ultimately call this on every request, and just once.
-
timeout
public Duration timeout()
-
deadline
public com.couchbase.client.core.deps.io.grpc.Deadline deadline()
-
absoluteTimeout
public long absoluteTimeout()
-
retryStrategy
public RetryStrategy retryStrategy()
-
timeoutElapsed
public boolean timeoutElapsed()
-
cancel
public ProtostellarRequestBehaviour cancel(CancellationReason reason)
-
readonly
public boolean readonly()
-
logicalRequestLatency
public long logicalRequestLatency()
-
incrementRetryAttempts
public void incrementRetryAttempts(Duration duration, RetryReason reason)
-
context
public GenericErrorContext context()
-
retryAttempts
public int retryAttempts()
-
dispatchDuration
public void dispatchDuration(long durationNanos)
-
completed
public boolean completed()
-
createdAt
public long createdAt()
-
serviceType
public ServiceType serviceType()
-
cancellationReason
@Nullable public CancellationReason cancellationReason()
-
failed
public boolean failed()
-
succeeded
public boolean succeeded()
-
-