ReqT
- the ReadRequest typepublic class NettyReadHandlerStateMachine<ReqT extends ReadRequest> extends Object
generateStateDiagram(Path)
. After you update the states and triggers, create a diagram
and check if the new state transitions are properly handled.Constructor and Description |
---|
NettyReadHandlerStateMachine(io.netty.channel.Channel channel,
Class<ReqT> requestType,
AbstractReadHandler.PacketReader.Factory<ReqT,? extends AbstractReadHandler.PacketReader<ReqT>> packetReaderFactory)
The state machine for reading packet task in Alluxio Worker.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel an ongoing read request.
|
void |
generateStateDiagram(Path outputFile)
Generates a diagram describing the state transition in a .dot file.
|
void |
notifyChannelClosed()
Notifies the state machine that the channel has been closed.
|
void |
notifyChannelException(Throwable channelException)
Notify the state machine that a channel exception occur.
|
void |
run()
Start the state machine.
|
void |
submitNewRequest(ReqT readRequest)
Submits a new read request for processing in the state machine.
|
public NettyReadHandlerStateMachine(io.netty.channel.Channel channel, Class<ReqT> requestType, AbstractReadHandler.PacketReader.Factory<ReqT,? extends AbstractReadHandler.PacketReader<ReqT>> packetReaderFactory)
channel
- the netty channelrequestType
- the type of the request classpacketReaderFactory
- the packet reader factory for creating packet readerspublic void generateStateDiagram(Path outputFile) throws IOException
outputFile
- path to the output fileIOException
- when writing file failspublic void run()
public void submitNewRequest(ReqT readRequest)
readRequest
- read requestpublic void cancel()
public void notifyChannelException(Throwable channelException)
channelException
- the encountered Error objectpublic void notifyChannelClosed()
Copyright © 2023. All Rights Reserved.