sandynz commented on code in PR #28889:
URL: https://github.com/apache/shardingsphere/pull/28889#discussion_r1437968099
##########
docs/document/content/user-manual/shardingsphere-proxy/cdc/usage.cn.md:
##########
@@ -207,6 +205,25 @@ public final class Bootstrap {
如果需要更复杂数据消费的实现,例如写入到数据库,可以参考
[DataSourceRecordConsumer](https://github.com/apache/shardingsphere/blob/master/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/cdc/DataSourceRecordConsumer.java)
+#### 写入数据
+
+通过 proxy 写入数据,此时 CDC Client 会收到数据变更的通知。
+
+```
+INSERT INTO t_order (id, user_id, status) VALUES
(1,1,'ok1'),(2,2,'ok2'),(3,3,'ok3');
Review Comment:
UPDATE and DELETE SQL could be added too
##########
docs/document/content/user-manual/shardingsphere-proxy/cdc/usage.cn.md:
##########
@@ -141,20 +141,18 @@ REGISTER STORAGE UNIT ds_0 (
```sql
CREATE SHARDING TABLE RULE t_order(
STORAGE_UNITS(ds_0,ds_1),
-SHARDING_COLUMN=order_id,
+SHARDING_COLUMN=id,
Review Comment:
Could we use the same table structure as before, keep `order_id`
##########
docs/document/content/user-manual/shardingsphere-proxy/cdc/usage.en.md:
##########
@@ -201,12 +201,31 @@ There are mainly 4 steps
1. Construct CDCClient, pass in CDCClientConfiguration
2. Call CDCClient.connect(), this step is to establish a connection with the
CDC Server
3. Call CDCClient.login(), log in with the username and password configured in
server.yaml
-4. Call CDCClient.startStreaming(), start subscribing, you need to ensure that
the subscribed library and table exist in ShardingSphere-Proxy, otherwise an
error will be reported.
+4. Call CDCClient.startStreaming(), start subscribing, you need to ensure that
the subscribed library and table exist in ShardingSphere-Proxy, otherwise an
error will be reported
Review Comment:
`library` is not exact enough
##########
docs/document/content/user-manual/shardingsphere-proxy/cdc/build.en.md:
##########
@@ -211,15 +211,13 @@ If necessary, users can also implement a CDC Client
themselves to consume data a
`org.apache.shardingsphere.data.pipeline.cdc.client.CDCClient` is the entry
class of the CDC Client. Users can interact with the CDC Server through this
class. The main new methods are as follows.
-| Method Name
| Return Value
| Description
|
-|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------|---------------------------------------------------------------------------------------------------------|
-| connect(Consumer<List<Record>> dataConsumer, ExceptionHandler
exceptionHandler, ServerErrorResultHandler errorResultHandler | void
| Connect with the server, when connecting, you need to
specify <br/>1. Data consumption processing logic <br/>2. Exception handling
logic during consumption <br/>3. Server error exception handling logic
|
-| login(CDCLoginParameter parameter)
| void
| CDC login, parameters <br/>username: username <br/>password: password
|
-| startStreaming(StartStreamingParameter parameter)
| String (CDC task unique
identifier, used for subsequent operations) | Start CDC subscription,
StartStreamingParameter parameters <br/> database: logical library name <br/>
schemaTables: subscribed table name <br/> full: whether to subscribe to full
data |
-| restartStreaming(String streamingId)
| void
| Restart subscription
|
-| stopStreaming(String streamingId)
| void
| Stop subscription
|
-| dropStreaming(String streamingId)
| void
| Delete subscription
|
-| await()
| void
| Block the CDC thread and wait for the channel to close
|
-| close()
| void
| Close the channel, the process ends.
|
-
-```
\ No newline at end of file
+| Method Name
| Return Value
| Description
|
+|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| connect(Consumer<List<Record>> dataConsumer, ExceptionHandler
exceptionHandler, ServerErrorResultHandler errorResultHandler | void
| Connect with the server, when connecting, you need to
specify <br/>1. Data consumption processing function <br/>2. Exception handling
logic during consumption <br/>3. Server error exception handling function |
+| login(CDCLoginParameter parameter)
| void
| CDC login, parameters <br/>username: username <br/>password: password
|
+| startStreaming(StartStreamingParameter parameter)
| streamId (CDC task unique
identifier) | Start CDC subscription, StartStreamingParameter parameters <br/>
database: logical library name <br/> schemaTables: subscribed table name <br/>
full: whether to subscribe to full data |
Review Comment:
`library name` is not exact enough
##########
docs/document/content/user-manual/shardingsphere-proxy/cdc/build.en.md:
##########
@@ -211,15 +211,13 @@ If necessary, users can also implement a CDC Client
themselves to consume data a
`org.apache.shardingsphere.data.pipeline.cdc.client.CDCClient` is the entry
class of the CDC Client. Users can interact with the CDC Server through this
class. The main new methods are as follows.
-| Method Name
| Return Value
| Description
|
-|-----------------------------------------------------------------------------------------------------------------------------|------------------------------------|---------------------------------------------------------------------------------------------------------|
-| connect(Consumer<List<Record>> dataConsumer, ExceptionHandler
exceptionHandler, ServerErrorResultHandler errorResultHandler | void
| Connect with the server, when connecting, you need to
specify <br/>1. Data consumption processing logic <br/>2. Exception handling
logic during consumption <br/>3. Server error exception handling logic
|
-| login(CDCLoginParameter parameter)
| void
| CDC login, parameters <br/>username: username <br/>password: password
|
-| startStreaming(StartStreamingParameter parameter)
| String (CDC task unique
identifier, used for subsequent operations) | Start CDC subscription,
StartStreamingParameter parameters <br/> database: logical library name <br/>
schemaTables: subscribed table name <br/> full: whether to subscribe to full
data |
-| restartStreaming(String streamingId)
| void
| Restart subscription
|
-| stopStreaming(String streamingId)
| void
| Stop subscription
|
-| dropStreaming(String streamingId)
| void
| Delete subscription
|
-| await()
| void
| Block the CDC thread and wait for the channel to close
|
-| close()
| void
| Close the channel, the process ends.
|
-
-```
\ No newline at end of file
+| Method Name
| Return Value
| Description
|
+|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| connect(Consumer<List<Record>> dataConsumer, ExceptionHandler
exceptionHandler, ServerErrorResultHandler errorResultHandler | void
| Connect with the server, when connecting, you need to
specify <br/>1. Data consumption processing function <br/>2. Exception handling
logic during consumption <br/>3. Server error exception handling function |
+| login(CDCLoginParameter parameter)
| void
| CDC login, parameters <br/>username: username <br/>password: password
|
+| startStreaming(StartStreamingParameter parameter)
| streamId (CDC task unique
identifier) | Start CDC subscription, StartStreamingParameter parameters <br/>
database: logical library name <br/> schemaTables: subscribed table name <br/>
full: whether to subscribe to full data |
Review Comment:
`streamId` could be `streamingId`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]