public class TunnelStateMachine extends Object
ChannelConnect corresponds to Channel and has four states: WAIT, RUNNING, CLOSING, CLOSED. The relevant descriptions are as follows: 1. WAIT: Waiting state, the initial state when a ChannelConnect is created. 2. RUNNING: Running, this state indicates that the ChannelConnect is working well, continuously fetching data, processing data, and recording consumption checkpoints. 3. CLOSING: Closing, corresponding to the CLOSING state of the Channel, during this state the ChannelConnect will interrupt data processing and transition to the CLOSED state. 4. CLOSED: Closed, when a ChannelConnect is in this state, it can no longer consume data and needs to be removed from active connections. At the same time, its corresponding Channel needs to be updated to the CLOSE or TERMINATED state.
| 构造器和说明 |
|---|
TunnelStateMachine(String tunnelId,
String clientId,
IChannelDialer dialer,
IChannelProcessorFactory processorFactory,
TunnelClientInterface client) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<IChannelConnect> |
batchGetChannelConnects() |
List<com.alicloud.openservices.tablestore.model.tunnel.internal.Channel> |
batchGetChannels() |
void |
batchUpdateChannels(List<com.alicloud.openservices.tablestore.model.tunnel.internal.Channel> batchChannels) |
void |
close() |
ConcurrentHashMap<String,Integer> |
getChannelClosingRounds() |
void |
handleHangedClosingChannels() |
void |
setChannelClosingRoundThreshold(int channelClosingRoundThreshold) |
void |
setEnableClosingChannelDetect(boolean enableClosingChannelDetect) |
void |
updateStatus(com.alicloud.openservices.tablestore.model.tunnel.internal.Channel channel)
Update the active Channel information in the StateMachine and remove the ChannelConnect that is in the Closed state (with the same ChannelId).
|
public TunnelStateMachine(String tunnelId, String clientId, IChannelDialer dialer, IChannelProcessorFactory processorFactory, TunnelClientInterface client)
public void updateStatus(com.alicloud.openservices.tablestore.model.tunnel.internal.Channel channel)
channel - public List<IChannelConnect> batchGetChannelConnects()
public List<com.alicloud.openservices.tablestore.model.tunnel.internal.Channel> batchGetChannels()
public void batchUpdateChannels(List<com.alicloud.openservices.tablestore.model.tunnel.internal.Channel> batchChannels)
public void close()
public void handleHangedClosingChannels()
public void setEnableClosingChannelDetect(boolean enableClosingChannelDetect)
public void setChannelClosingRoundThreshold(int channelClosingRoundThreshold)
public ConcurrentHashMap<String,Integer> getChannelClosingRounds()
Copyright © 2025. All Rights Reserved.