You can call the DescribeTunnel operation to obtain the information of channels in a specified tunnel. A channel corresponds to a shard for the Stream operation of Tablestore.
Request parameters
Parameter | Description |
---|---|
TableName | The name of the table for which you want to query the tunnel information. |
TunnelName | The tunnel name. |
Response parameters
Parameter | Description |
---|---|
TunnelConsumePoint | The last time when the tunnel consumes incremental data. The time equals the point in time when the slowest channel in the tunnel consumes data. Default value: January 1, 1970 (UTC). |
TunnelInfo | The list of the tunnel, including the following information:
|
List<ChannelInfo> | The list of channels in the tunnel, including the following information:
|
ResponseInfo | Some other fields returned in the request. |
RequestId | The ID of the request. |
Examples
// The ConsumePoint and recovery point objective (RPO) attributes are used for incremental data consumption, rather than for full data consumption.
// Stream tunnel: The Stage parameter in TunnelInfo is set to ProcessStream. Stream channel: The ChannelType parameter in ChannelInfo is set to Stream.
private static void describeTunnel(TunnelClient client, String tableName, String tunnelName) {
DescribeTunnelRequest request = new DescribeTunnelRequest(tableName, tunnelName);
DescribeTunnelResponse resp = client.describeTunnel(request);
System.out.println("RequestId: " + resp.getRequestId());
// The last time when the tunnel consumes incremental data. The time equals the point in time when the slowest channel in the tunnel consumes data. Default value: January 1, 1970 (UTC).
System.out.println("TunnelConsumePoint: " + resp.getTunnelConsumePoint());
System.out.println("TunnelInfo: " + resp.getTunnelInfo());
for (ChannelInfo ci : resp.getChannelInfos()) {
System.out.println("ChannelInfo::::::");
System.out.println("\tChannelId: " + ci.getChannelId());
// The type of a channel. Valid values: BaseData and Stream.
System.out.println("\tChannelType: " + ci.getChannelType());
// The ID of the tunnel client. By default, the client ID concatenates the hostname of the client and a random string.
System.out.println("\tClientId: " + ci.getClientId());
// The last time when the channel consumes incremental data.
System.out.println("\tChannelConsumePoint: " + ci.getChannelConsumePoint());
// The number of data entries that the channel synchronizes.
System.out.println("\tChannelCount: " + ci.getChannelCount());
}
}