Class Tracker
java.lang.Object
org.infinispan.server.resp.logging.Tracker
Tracker for a single command.
One instance tracks one request at a time. One instance can be reused indefinitely for subsequent requests within
the same ChannelHandlerContext but never for interleaving requests.
A request starts with a call to track(RespCommand, List), storing data about time, request size, and
affected keys. The tracker is updated when the ByteBufPool needs to allocate more
bytes for a response. The request stops tracking on the done(Throwable), generating an instance of
AccessData.
-
Constructor Summary
ConstructorsConstructorDescriptionTracker(io.netty.channel.ChannelHandlerContext ctx, TimeService timeService) -
Method Summary
Modifier and TypeMethodDescriptionStops tracking the request.voidincreaseBytesRequested(int bytes) voidtrack(RespCommand req, List<byte[]> arguments) Starts tracking the request.
-
Constructor Details
-
Tracker
-
-
Method Details
-
track
Starts tracking the request.Only one request is tracked at a time. If this method is called while another request is being tracked, an
IllegalStateExceptionis thrown.- Parameters:
req- : The current request to track.arguments- : The request arguments.- Throws:
IllegalStateException- if another request is being tracked.
-
increaseBytesRequested
public void increaseBytesRequested(int bytes) -
done
Stops tracking the request.If this method is called while no request is being tracked,
nullis returned.- Parameters:
throwable- : If the request failed, the exception that caused the failure.- Returns:
- An instance of
AccessDataif a request was being tracked,nullotherwise.
-