Learn how to quickly use Tunnel Service features in the Tablestore console.
Procedure
Step 1: Create a tunnel
-
Navigate to the Tunnels page.
-
Log on to the Tablestore console.
-
In the top navigation bar, select a resource group and a region.
-
On the Overview page, click the name of an instance or click Manage Instance in the Actions column of the instance.
-
On the Instance Details tab, click the Tables tab. Click the name of the target data table, and then click the Tunnels tab. Alternatively, click
in the Actions column of the data table and select Tunnels.
-
-
On the Tunnels tab, click Create Tunnel.
-
In the Create Tunnel dialog box, configure the following parameters:
Parameter
Description
Tunnel name
The name of the tunnel.
Tunnel type
The type of the tunnel. Valid values:
-
Full: Consumes all existing data in the data table.
-
Incremental: Consumes only new data written to the data table.
-
Differential: Consumes all existing data in the data table, followed by all new data.
Start time
When you create an Incremental or Full and Incremental tunnel, data written after the tunnel is created is considered incremental data by default. To consume incremental data from a specific point in time, configure the Start Time. You can also configure an End Time as needed.
The value for both Start Time and End Time must be a 64-bit timestamp in milliseconds and fall within the range of
[current system time - Stream expiration time + 5 minutes , current system time]. The End Time must be later than the Start Time.ImportantThe Stream expiration time is the retention period for the change log, with a maximum of 7 days. You set this duration when you enable the Stream feature for a data table. This setting cannot be changed after it is set.
End time
-
-
Click OK.
After the tunnel is created, click Show Channels on the right side of the tunnel. You can view data content, monitor consumption latency, and check the number of consumed rows for each channel partition.
After the tunnel is created, its status is Processing Full Data. The list of channel partitions contains one Full partition with a status of Open and one Incremental partition with a status of Waiting. You can click Simulate Consumption in the Actions column to view the consumed data.
Step 2: (Optional) Preview tunnel data format
After creating the tunnel, you can simulate data consumption to preview the format of the data records.
-
Write data to or Delete data from the table.
-
On the table's Tunnels tab, click Show Channels in the Actions column for the tunnel.
-
In the Actions column of a channel partition, click View Simulated Export Records.
-
In the View Simulated Export Records dialog box, click Start.
The dialog box displays the consumed data records.
Step 3: Start consuming data from the tunnel
-
On the Tunnels tab, copy the tunnel ID from the list.
-
Use the Tablestore SDK for Java or Tablestore SDK for Go to quickly consume data from the tunnel.
After the data is consumed, you can view logs that contain consumption statistics and the latest synchronization timestamp for each incremental channel partition. In the Tablestore console, you can also monitor consumption latency and the number of consumed rows for each channel partition.
Development integration
You can use the Tablestore CLI or Tablestore SDKs to manage tunnels.
|
Feature |
Invocation method |
|
Create a tunnel |
|
|
List tunnels for a table |
|
|
Get tunnel details |
|
|
Simulate tunnel consumption |
|
|
Delete a tunnel |