tencent cloud

Data Transfer Service

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Data Migration
Data Sync
Data Subscription (Kafka Edition)
Strengths
Supported Regions
Specification Description
Purchase Guide
Billing Overview
Configuration Change Description
Payment Overdue
Refund
Getting Started
Data Migration Guide
Data Sync Guide
Data Subscription Guide (Kafka Edition)
Preparations
Business Evaluation
Network Preparation
Adding DTS IP Addresses to the Allowlist of the Corresponding Databases
DTS Service Permission Preparation
Database and Permission Preparation
Configuring Binlog in Self-Built MySQL
Data Migration
Databases Supported by Data Migration
Cross-Account TencentDB Instance Migration
Migration to MySQL Series
Migrating to PostgreSQL
Migrating to MongoDB
Migrating to SQL Server
Migrating to Tencent Cloud Distributed Cache
Task Management
Data Sync
Databases Supported by Data Sync
Cross-Account TencentDB Instance Sync
Sync to MySQL series
Synchronize to PostgreSQL
Synchronization to MongoDB
Synchronize to Kafka
Task Management
Data Subscription (Kafka Edition)
Databases Supported by Data Subscription
MySQL series Data Subscription
Data Subscription for TDSQL PostgreSQL
MongoDB Data Subscription
Task Management
Consumption Management
Fix for Verification Failure
Check Item Overview
Cutover Description
Monitoring and Alarms
Supported Monitoring Indicators
Supported Events
Configuring Metric Alarms and Event Alarms via the Console
Configuring Indicator Monitoring and Event Alarm by APIs
Ops Management
Configuring Maintenance Time
Task Status Change Description
Practical Tutorial
Synchronizing Local Database to the Cloud
Creating Two-Way Sync Data Structure
Creating Many-to-One Sync Data Structure
Creating Multi-Site Active-Active IDC Architecture
Selecting Data Sync Conflict Resolution Policy
Using CLB as Proxy for Cross-Account Database Migration
Migrating Self-Built Databases to Tencent Cloud Databases via CCN
Best Practices for DTS Performance Tuning
FAQs
Data Migration
Data Sync
FAQs for Data Subscription Kafka Edition
Regular Expressions for Subscription
Error Handling
Common Errors
Failed Connectivity Test
Failed or Alarmed Check Item
Inability to Select Subnet During CCN Access
Slow or Stuck Migration
Data Sync Delay
High Data Subscription Delay
Data Consumption Exception
API Documentation
History
Introduction
API Category
Making API Requests
(NewDTS) Data Migration APIs
Data Sync APIs
Data Consistency Check APIs
(NewDTS) Data Subscription APIs
Data Types
Error Codes
DTS API 2018-03-30
Service Agreement
Service Level Agreements

JSON Demo Description

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2024-07-08 19:02:56
The demo for each programming language uses JSON for serialization and contains a Record definition file. In the demo for Java, the path of the definition file is consumerDemo-json-java\\src\\main\\java\\json\\FlatRecord.java.

‍Type of Field in Record

Field Name in Record
Description
id
The globally incremental ID.
version
The protocol version, which is v1 currently.
messageType
The message type. Enumerated values: INSERT, UPDATE, DELETE, DDL, BEGIN, COMMIT, HEARTBEAT, CHECKPOINT.
fileName
The name of the binlog file where the current record is located.
position
The end offset of the current record in the binlog in the format of End_log_pos@binlog file number. For example, if the current record is in file mysql-bin.000004 and the end offset is 2196, then the value of this parameter will be 2196@4.
safePosition
The start offset of the current transaction in the binlog, which is in the same format as described above.
timestamp
The time when the data was written to the binlog, which is a UNIX timestamp in seconds.
gtid
The current GTID, such as c7c98333-6006-11ed-bfc9-b8cef6e1a231:9.
transactionId
The transaction ID, which is generated only for COMMIT events.
serverId
The server ID of the source database, which can be viewed by running SHOW VARIABLES LIKE 'server_id'.
threadId
The ID of the session that committed the current transaction, which can be viewed by running SHOW processlist;.
sourceType
The source database type, which currently can only be MySQL.
sourceVersion
The source database version, which can be viewed by running: select version();.
schemaName
Database name.
tableName
Table name.
objectName
Format: Database name.table name.
columns
The definitions of columns in the table.
oldColumns
The data of the row before DML execution. If the message is an INSERT message, the array will be null.
newColumns
The data of the row after DML execution. If the message is a DELETE message, the array will be null.
sql
The DDL SQL statement.
executionTime
The DDL execution duration in seconds.
heartbeatTimestamp
The timestamp of the heartbeat message in seconds. This field is present only for heartbeat messages.
syncedGtid
The collection of GTIDs parsed by DTS in the format of c7c98333-6006-11ed-bfc9-b8cef6e1a231:1-13.
fakeGtid
Whether the current GTID is forged. If gtid_mode is not enabled, DTS will forge a GTID.
pkNames
If the table in the source database has a primary key, this parameter will be carried in the DML message; otherwise, it will not be carried.
readerTimestamp
The time when DTS processed the current data record, which is a UNIX timestamp in milliseconds.
tags
The status_vars in QueryEvent. For more information, see QueryEvent.
total
The total number of message segments if the message is segmented. This field is invalid on the current version (version=1) and is reserved for extension.
index
The index of a message segment if the message is segmented. This field is invalid on the current version (version=1) and is reserved for extension.

MySQL Column Attribute in Record

name: The column name.
dataTypeNumber: The type of the data recorded in the binlog. For values, see MySQL source code documentation.
isKey: Whether the current key is the primary key.
originalType: The type defined in DDL.

MySQL Data Type Conversion Logic

In the JSON protocol, all MySQL data types are converted to strings.
String types such as varchar are all converted to UTF-8 encoding.
Numeric types are all converted to strings equal to the value, such as "3.0".
Time types are output in the format of yyyy-dd-mm hh:MM:ss.milli.
Timestamp types are output as the number of milliseconds.
Binary types such as binary and blob are output as strings equal to their hex values, such as "0xfff".

Ajuda e Suporte

Esta página foi útil?

comentários