You can call this operation to obtain the information of channels in a specified tunnel. Currently, a channel corresponds to a split for the TableStore Stream operation.

Request parameters

  • TableName: the name of the table for the specified tunnel.
  • TunnelName: the name of the specified tunnel.

Response parameters

  • TunnelConsumePoint: the latest time when the tunnel consumes incremental data. The time equals that when the last channel in the tunnel consumes data. Default value: January 1, 1970 (UTC).
  • TunnelInfo: the information of the specified tunnel.
    • TunnelId: the ID of the specified tunnel.
    • TunnelType: the type of the specified tunnel. Valid values: BaseData, Stream, and BaseAndStream.
    • TableName: the name of the table where the specified tunnel is located.
    • InstanceName: the name of the instance where the specified tunnel is located.
    • Stage: the stage where the specified tunnel is located. Valid values: InitBaseDataAndStreamShard, ProcessBaseData, and ProcessStream.
    • Expired: indicates whether data is expired. If a value of true is returned, request technical support.
  • List<ChannelInfo>: the list of channels in the specified tunnel.
    • ChannelId: the ID of a channel.
    • ChannelType: the type of a channel. Valid values: BaseData and Stream.
    • ChannelStatus: the status of a channel. Valid values: WAIT, OPEN, CLOSING, CLOSE, and TERMINATED.

    • ClientId: the ID of the Tunnel client. By default, ClientId includes a client host name that is customized in TunnelWorkerConfig and that is joined with a random string.
    • ChannelConsumePoint: the latest time when a channel consumes incremental data. Default value: January 1, 1970 (UTC). This parameter is not used for full data consumption.
    • ChannelCount: the number of data items that a channel synchronizes.
  • ResponseInfo: some other fields returned in the request.

    RequestId: the GUID generated by Alibaba Cloud for the request.

Example

// 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 latest time when the tunnel consumes incremental data. The time equals that when the last 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 parameter includes a client host name joined with a random string.
        System.out.println("\tClientId: " + ci.getClientId());
        // The latest time when the channel consumes incremental data.
        System.out.println("\tChannelConsumePoint: " + ci.getChannelConsumePoint());
        // The number of data items that the channel synchronizes.
        System.out.println("\tChannelCount: " + ci.getChannelCount());
    }
}