├── .github └── workflows │ └── rust.yml ├── Cargo.lock ├── Cargo.toml ├── README.md └── src ├── client.rs ├── cluster.rs ├── examples ├── Cargo.lock ├── Cargo.toml ├── cluster.rs └── subscribe.rs ├── lib.rs └── protobuf ├── CanalProtocol.proto ├── CanalProtocol.rs ├── EntryProtocol.proto ├── EntryProtocol.rs └── mod.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: Build 13 | run: cargo build --verbose 14 | - name: Run tests 15 | run: cargo test --verbose 16 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.16.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.0.1" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 25 | 26 | [[package]] 27 | name = "backtrace" 28 | version = "0.3.61" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" 31 | dependencies = [ 32 | "addr2line", 33 | "cc", 34 | "cfg-if 1.0.0", 35 | "libc", 36 | "miniz_oxide", 37 | "object", 38 | "rustc-demangle", 39 | ] 40 | 41 | [[package]] 42 | name = "bitflags" 43 | version = "1.3.2" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 46 | 47 | [[package]] 48 | name = "byteorder" 49 | version = "1.4.3" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 52 | 53 | [[package]] 54 | name = "bytes" 55 | version = "0.5.6" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 58 | 59 | [[package]] 60 | name = "bytes" 61 | version = "1.1.0" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 64 | dependencies = [ 65 | "serde", 66 | ] 67 | 68 | [[package]] 69 | name = "canal-rs" 70 | version = "0.1.1" 71 | dependencies = [ 72 | "bytes 1.1.0", 73 | "failure", 74 | "futures", 75 | "log", 76 | "protobuf", 77 | "serde", 78 | "serde_derive", 79 | "serde_json", 80 | "tokio", 81 | "tokio-util", 82 | "zookeeper", 83 | ] 84 | 85 | [[package]] 86 | name = "cc" 87 | version = "1.0.71" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" 90 | 91 | [[package]] 92 | name = "cfg-if" 93 | version = "0.1.10" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 96 | 97 | [[package]] 98 | name = "cfg-if" 99 | version = "1.0.0" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 102 | 103 | [[package]] 104 | name = "failure" 105 | version = "0.1.8" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" 108 | dependencies = [ 109 | "backtrace", 110 | "failure_derive", 111 | ] 112 | 113 | [[package]] 114 | name = "failure_derive" 115 | version = "0.1.8" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" 118 | dependencies = [ 119 | "proc-macro2", 120 | "quote", 121 | "syn", 122 | "synstructure", 123 | ] 124 | 125 | [[package]] 126 | name = "fuchsia-zircon" 127 | version = "0.3.3" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 130 | dependencies = [ 131 | "bitflags", 132 | "fuchsia-zircon-sys", 133 | ] 134 | 135 | [[package]] 136 | name = "fuchsia-zircon-sys" 137 | version = "0.3.3" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 140 | 141 | [[package]] 142 | name = "futures" 143 | version = "0.3.17" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" 146 | dependencies = [ 147 | "futures-channel", 148 | "futures-core", 149 | "futures-executor", 150 | "futures-io", 151 | "futures-sink", 152 | "futures-task", 153 | "futures-util", 154 | ] 155 | 156 | [[package]] 157 | name = "futures-channel" 158 | version = "0.3.17" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" 161 | dependencies = [ 162 | "futures-core", 163 | "futures-sink", 164 | ] 165 | 166 | [[package]] 167 | name = "futures-core" 168 | version = "0.3.17" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" 171 | 172 | [[package]] 173 | name = "futures-executor" 174 | version = "0.3.17" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" 177 | dependencies = [ 178 | "futures-core", 179 | "futures-task", 180 | "futures-util", 181 | ] 182 | 183 | [[package]] 184 | name = "futures-io" 185 | version = "0.3.17" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" 188 | 189 | [[package]] 190 | name = "futures-macro" 191 | version = "0.3.17" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" 194 | dependencies = [ 195 | "autocfg", 196 | "proc-macro-hack", 197 | "proc-macro2", 198 | "quote", 199 | "syn", 200 | ] 201 | 202 | [[package]] 203 | name = "futures-sink" 204 | version = "0.3.17" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" 207 | 208 | [[package]] 209 | name = "futures-task" 210 | version = "0.3.17" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" 213 | 214 | [[package]] 215 | name = "futures-util" 216 | version = "0.3.17" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" 219 | dependencies = [ 220 | "autocfg", 221 | "futures-channel", 222 | "futures-core", 223 | "futures-io", 224 | "futures-macro", 225 | "futures-sink", 226 | "futures-task", 227 | "memchr", 228 | "pin-project-lite", 229 | "pin-utils", 230 | "proc-macro-hack", 231 | "proc-macro-nested", 232 | "slab", 233 | ] 234 | 235 | [[package]] 236 | name = "gimli" 237 | version = "0.25.0" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" 240 | 241 | [[package]] 242 | name = "hermit-abi" 243 | version = "0.1.19" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 246 | dependencies = [ 247 | "libc", 248 | ] 249 | 250 | [[package]] 251 | name = "instant" 252 | version = "0.1.11" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" 255 | dependencies = [ 256 | "cfg-if 1.0.0", 257 | ] 258 | 259 | [[package]] 260 | name = "iovec" 261 | version = "0.1.4" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 264 | dependencies = [ 265 | "libc", 266 | ] 267 | 268 | [[package]] 269 | name = "itoa" 270 | version = "0.4.8" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" 273 | 274 | [[package]] 275 | name = "kernel32-sys" 276 | version = "0.2.2" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 279 | dependencies = [ 280 | "winapi 0.2.8", 281 | "winapi-build", 282 | ] 283 | 284 | [[package]] 285 | name = "lazy_static" 286 | version = "1.4.0" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 289 | 290 | [[package]] 291 | name = "lazycell" 292 | version = "1.3.0" 293 | source = "registry+https://github.com/rust-lang/crates.io-index" 294 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 295 | 296 | [[package]] 297 | name = "libc" 298 | version = "0.2.103" 299 | source = "registry+https://github.com/rust-lang/crates.io-index" 300 | checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" 301 | 302 | [[package]] 303 | name = "lock_api" 304 | version = "0.4.5" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" 307 | dependencies = [ 308 | "scopeguard", 309 | ] 310 | 311 | [[package]] 312 | name = "log" 313 | version = "0.4.14" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 316 | dependencies = [ 317 | "cfg-if 1.0.0", 318 | ] 319 | 320 | [[package]] 321 | name = "memchr" 322 | version = "2.4.1" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 325 | 326 | [[package]] 327 | name = "miniz_oxide" 328 | version = "0.4.4" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" 331 | dependencies = [ 332 | "adler", 333 | "autocfg", 334 | ] 335 | 336 | [[package]] 337 | name = "mio" 338 | version = "0.6.23" 339 | source = "registry+https://github.com/rust-lang/crates.io-index" 340 | checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" 341 | dependencies = [ 342 | "cfg-if 0.1.10", 343 | "fuchsia-zircon", 344 | "fuchsia-zircon-sys", 345 | "iovec", 346 | "kernel32-sys", 347 | "libc", 348 | "log", 349 | "miow 0.2.2", 350 | "net2", 351 | "slab", 352 | "winapi 0.2.8", 353 | ] 354 | 355 | [[package]] 356 | name = "mio" 357 | version = "0.7.13" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" 360 | dependencies = [ 361 | "libc", 362 | "log", 363 | "miow 0.3.7", 364 | "ntapi", 365 | "winapi 0.3.9", 366 | ] 367 | 368 | [[package]] 369 | name = "mio-extras" 370 | version = "2.0.6" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" 373 | dependencies = [ 374 | "lazycell", 375 | "log", 376 | "mio 0.6.23", 377 | "slab", 378 | ] 379 | 380 | [[package]] 381 | name = "miow" 382 | version = "0.2.2" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" 385 | dependencies = [ 386 | "kernel32-sys", 387 | "net2", 388 | "winapi 0.2.8", 389 | "ws2_32-sys", 390 | ] 391 | 392 | [[package]] 393 | name = "miow" 394 | version = "0.3.7" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 397 | dependencies = [ 398 | "winapi 0.3.9", 399 | ] 400 | 401 | [[package]] 402 | name = "net2" 403 | version = "0.2.37" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" 406 | dependencies = [ 407 | "cfg-if 0.1.10", 408 | "libc", 409 | "winapi 0.3.9", 410 | ] 411 | 412 | [[package]] 413 | name = "ntapi" 414 | version = "0.3.6" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 417 | dependencies = [ 418 | "winapi 0.3.9", 419 | ] 420 | 421 | [[package]] 422 | name = "num_cpus" 423 | version = "1.13.0" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 426 | dependencies = [ 427 | "hermit-abi", 428 | "libc", 429 | ] 430 | 431 | [[package]] 432 | name = "object" 433 | version = "0.26.2" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" 436 | dependencies = [ 437 | "memchr", 438 | ] 439 | 440 | [[package]] 441 | name = "once_cell" 442 | version = "1.8.0" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 445 | 446 | [[package]] 447 | name = "parking_lot" 448 | version = "0.11.2" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 451 | dependencies = [ 452 | "instant", 453 | "lock_api", 454 | "parking_lot_core", 455 | ] 456 | 457 | [[package]] 458 | name = "parking_lot_core" 459 | version = "0.8.5" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 462 | dependencies = [ 463 | "cfg-if 1.0.0", 464 | "instant", 465 | "libc", 466 | "redox_syscall", 467 | "smallvec", 468 | "winapi 0.3.9", 469 | ] 470 | 471 | [[package]] 472 | name = "pin-project-lite" 473 | version = "0.2.7" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" 476 | 477 | [[package]] 478 | name = "pin-utils" 479 | version = "0.1.0" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 482 | 483 | [[package]] 484 | name = "proc-macro-hack" 485 | version = "0.5.19" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 488 | 489 | [[package]] 490 | name = "proc-macro-nested" 491 | version = "0.1.7" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" 494 | 495 | [[package]] 496 | name = "proc-macro2" 497 | version = "1.0.29" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" 500 | dependencies = [ 501 | "unicode-xid", 502 | ] 503 | 504 | [[package]] 505 | name = "protobuf" 506 | version = "2.25.1" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "23129d50f2c9355ced935fce8a08bd706ee2e7ce2b3b33bf61dace0e379ac63a" 509 | dependencies = [ 510 | "bytes 1.1.0", 511 | ] 512 | 513 | [[package]] 514 | name = "quote" 515 | version = "1.0.10" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" 518 | dependencies = [ 519 | "proc-macro2", 520 | ] 521 | 522 | [[package]] 523 | name = "redox_syscall" 524 | version = "0.2.10" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 527 | dependencies = [ 528 | "bitflags", 529 | ] 530 | 531 | [[package]] 532 | name = "rustc-demangle" 533 | version = "0.1.21" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 536 | 537 | [[package]] 538 | name = "ryu" 539 | version = "1.0.5" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 542 | 543 | [[package]] 544 | name = "scopeguard" 545 | version = "1.1.0" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 548 | 549 | [[package]] 550 | name = "serde" 551 | version = "1.0.130" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" 554 | 555 | [[package]] 556 | name = "serde_derive" 557 | version = "1.0.130" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" 560 | dependencies = [ 561 | "proc-macro2", 562 | "quote", 563 | "syn", 564 | ] 565 | 566 | [[package]] 567 | name = "serde_json" 568 | version = "1.0.68" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" 571 | dependencies = [ 572 | "itoa", 573 | "ryu", 574 | "serde", 575 | ] 576 | 577 | [[package]] 578 | name = "signal-hook-registry" 579 | version = "1.4.0" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 582 | dependencies = [ 583 | "libc", 584 | ] 585 | 586 | [[package]] 587 | name = "slab" 588 | version = "0.4.4" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" 591 | 592 | [[package]] 593 | name = "smallvec" 594 | version = "1.7.0" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" 597 | 598 | [[package]] 599 | name = "snowflake" 600 | version = "1.3.0" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "27207bb65232eda1f588cf46db2fee75c0808d557f6b3cf19a75f5d6d7c94df1" 603 | 604 | [[package]] 605 | name = "syn" 606 | version = "1.0.80" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" 609 | dependencies = [ 610 | "proc-macro2", 611 | "quote", 612 | "unicode-xid", 613 | ] 614 | 615 | [[package]] 616 | name = "synstructure" 617 | version = "0.12.5" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" 620 | dependencies = [ 621 | "proc-macro2", 622 | "quote", 623 | "syn", 624 | "unicode-xid", 625 | ] 626 | 627 | [[package]] 628 | name = "tokio" 629 | version = "1.12.0" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" 632 | dependencies = [ 633 | "autocfg", 634 | "bytes 1.1.0", 635 | "libc", 636 | "memchr", 637 | "mio 0.7.13", 638 | "num_cpus", 639 | "once_cell", 640 | "parking_lot", 641 | "pin-project-lite", 642 | "signal-hook-registry", 643 | "tokio-macros", 644 | "winapi 0.3.9", 645 | ] 646 | 647 | [[package]] 648 | name = "tokio-macros" 649 | version = "1.4.1" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" 652 | dependencies = [ 653 | "proc-macro2", 654 | "quote", 655 | "syn", 656 | ] 657 | 658 | [[package]] 659 | name = "tokio-util" 660 | version = "0.6.8" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" 663 | dependencies = [ 664 | "bytes 1.1.0", 665 | "futures-core", 666 | "futures-io", 667 | "futures-sink", 668 | "log", 669 | "pin-project-lite", 670 | "slab", 671 | "tokio", 672 | ] 673 | 674 | [[package]] 675 | name = "unicode-xid" 676 | version = "0.2.2" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 679 | 680 | [[package]] 681 | name = "winapi" 682 | version = "0.2.8" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 685 | 686 | [[package]] 687 | name = "winapi" 688 | version = "0.3.9" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 691 | dependencies = [ 692 | "winapi-i686-pc-windows-gnu", 693 | "winapi-x86_64-pc-windows-gnu", 694 | ] 695 | 696 | [[package]] 697 | name = "winapi-build" 698 | version = "0.1.1" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 701 | 702 | [[package]] 703 | name = "winapi-i686-pc-windows-gnu" 704 | version = "0.4.0" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 707 | 708 | [[package]] 709 | name = "winapi-x86_64-pc-windows-gnu" 710 | version = "0.4.0" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 713 | 714 | [[package]] 715 | name = "ws2_32-sys" 716 | version = "0.2.1" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 719 | dependencies = [ 720 | "winapi 0.2.8", 721 | "winapi-build", 722 | ] 723 | 724 | [[package]] 725 | name = "zookeeper" 726 | version = "0.5.10" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "98ef3c862b1475a45843c2e5a3f16b1953742ad1be51709fcbc5c6321c3381d2" 729 | dependencies = [ 730 | "byteorder", 731 | "bytes 0.5.6", 732 | "lazy_static", 733 | "log", 734 | "mio 0.6.23", 735 | "mio-extras", 736 | "snowflake", 737 | "zookeeper_derive", 738 | ] 739 | 740 | [[package]] 741 | name = "zookeeper_derive" 742 | version = "0.4.1" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | checksum = "42307291e3c8b2e4082e5647572da863f0470511d0ecb1618a4cd0a361549723" 745 | dependencies = [ 746 | "quote", 747 | "syn", 748 | ] 749 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "canal-rs" 3 | version = "0.1.1" 4 | authors = ["Rg"] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | protobuf = { version = "2.25.1", features = ["with-bytes"] } 11 | tokio-util = { version = "0.6.8", features = ["full"] } 12 | tokio = { version = "1", features = ["full"] } 13 | bytes = { version = "1.1.0", features = ["serde"] } 14 | futures = "0.3.0" 15 | log = "0.4" 16 | failure = "0.1.6" 17 | zookeeper = "0.5" 18 | serde_json = "1.0" 19 | serde = "1.0.104" 20 | serde_derive = "1.0.104" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # canal-rs 2 | 3 | ![example workflow name](https://github.com/laohanlinux/canal-rs/workflows/Rust/badge.svg) 4 | 5 | ```mermaid 6 | 7 | ``` 8 | 9 | -------------------------------------------------------------------------------- /src/client.rs: -------------------------------------------------------------------------------- 1 | use std::net::SocketAddr; 2 | use log::{info, trace, warn}; 3 | use std::error::Error; 4 | use std::time::Duration; 5 | 6 | use tokio::net::TcpStream; 7 | use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; 8 | use tokio_util::codec::{self, LengthDelimitedCodec, Framed}; 9 | use bytes::{Bytes, BytesMut}; 10 | 11 | use futures::{future, Sink, SinkExt, Stream, StreamExt}; 12 | use failure::{Error as FailureError, Fail, err_msg}; 13 | 14 | use crate::protobuf::CanalProtocol::{Packet, 15 | PacketType, 16 | Handshake, 17 | ClientAuth, 18 | Get, 19 | Ack, 20 | Sub, 21 | Unsub, 22 | ClientAck, 23 | Messages, 24 | ClientRollback, 25 | ClientAuth_oneof_net_read_timeout_present, 26 | ClientAuth_oneof_net_write_timeout_present}; 27 | use protobuf::{Message, parse_from_bytes}; 28 | 29 | const VERSION: i32 = 1; 30 | 31 | pub struct Client { 32 | addr: SocketAddr, 33 | conf: Config, 34 | framed: Option>, 35 | connected: bool, 36 | } 37 | 38 | #[derive(Clone)] 39 | pub struct Config { 40 | pub user_name: String, 41 | pub password: String, 42 | pub client_id: String, 43 | pub destinations: String, 44 | pub net_read_timeout_present: ClientAuth_oneof_net_read_timeout_present, 45 | pub net_write_timeout_present: ClientAuth_oneof_net_write_timeout_present, 46 | } 47 | 48 | impl Config { 49 | pub fn new(user_name: String, password: String, client_id: String, destinations: String, 50 | net_read_timeout_present: ClientAuth_oneof_net_read_timeout_present, 51 | net_write_timeout_present: ClientAuth_oneof_net_write_timeout_present) -> Self { 52 | Config { 53 | user_name, 54 | password, 55 | client_id, 56 | destinations, 57 | net_read_timeout_present, 58 | net_write_timeout_present, 59 | } 60 | } 61 | } 62 | 63 | impl Client { 64 | pub fn new(addr: SocketAddr, conf: Config) -> Client { 65 | Client { 66 | addr, 67 | conf, 68 | framed: None, 69 | connected: false, 70 | } 71 | } 72 | 73 | pub async fn connect(&mut self) -> Result<(), FailureError> { 74 | let stream = TcpStream::connect(&self.addr).await?; 75 | let builder = codec::length_delimited::Builder::new().big_endian().length_field_length(4).new_codec(); 76 | self.framed = Some(Framed::new(stream, builder)); 77 | let packet: Packet = self.read_packet().await?; 78 | self.handle_handshake(&packet)?; 79 | self.handle_auth().await 80 | } 81 | 82 | pub fn handle_handshake(&self, handshake: &Packet) -> Result<(), FailureError> { 83 | if handshake.get_version() != VERSION { 84 | bail!("version is not matched:{:?} {:?}", handshake.version_present, handshake.get_version()); 85 | } 86 | if handshake.get_field_type() != PacketType::HANDSHAKE { 87 | bail!("expect handshake but found other type"); 88 | } 89 | Handshake::parse_from_bytes(handshake.get_body()).map(|_| ()).map_err(|err| err.into()) 90 | } 91 | 92 | async fn handle_auth(&mut self) -> Result<(), FailureError> { 93 | let mut auth = ClientAuth::new(); 94 | auth.username = self.conf.user_name.clone(); 95 | auth.password = self.conf.password.clone().into_bytes(); 96 | auth.net_read_timeout_present = Some(self.conf.net_read_timeout_present.clone()); 97 | auth.net_write_timeout_present = Some(self.conf.net_write_timeout_present.clone()); 98 | self.write_message(PacketType::CLIENTAUTHENTICATION, auth).await?; 99 | let packet = self.read_packet().await?; 100 | assert_eq!(packet.get_field_type(), PacketType::ACK); 101 | let ack = Ack::parse_from_bytes(packet.get_body())?; 102 | assert_eq!(ack.get_error_code(), 0); 103 | self.connected = true; 104 | Ok(()) 105 | } 106 | 107 | pub async fn get_without_ack(&mut self, batch_size: i32, timeout: Option, uints: Option) -> Result { 108 | assert!(self.connected); 109 | let timeout = timeout.or_else(|| Some(-1)).unwrap(); 110 | let uints = uints.or_else(|| Some(-1)).unwrap(); 111 | let mut get_proto = Get::new(); 112 | get_proto.set_client_id(self.conf.client_id.clone()); 113 | get_proto.set_destination(self.conf.destinations.clone()); 114 | get_proto.set_fetch_size(batch_size); 115 | get_proto.set_timeout(timeout); 116 | get_proto.set_unit(uints); 117 | get_proto.set_auto_ack(false); 118 | self.write_message(PacketType::GET, get_proto).await?; 119 | self.read_message().await 120 | } 121 | 122 | pub async fn get(&mut self, batch_size: i32, timeout: Option, uints: Option) -> Result { 123 | assert!(self.connected); 124 | let message = self.get_without_ack(batch_size, timeout, uints).await?; 125 | self.ack(message.batch_id).await.map(|_| message) 126 | } 127 | 128 | pub async fn subscribe(&mut self, filter: String) -> Result<(), FailureError> { 129 | assert!(self.connected); 130 | let mut sub = Sub::new(); 131 | sub.set_client_id(self.conf.client_id.clone()); 132 | sub.set_destination(self.conf.destinations.clone()); 133 | sub.set_filter(filter); 134 | self.write_message(PacketType::SUBSCRIPTION, sub).await?; 135 | let packet = self.read_packet().await?; 136 | assert_eq!(packet.get_field_type(), PacketType::ACK); 137 | let ack = Ack::parse_from_bytes(packet.get_body())?; 138 | if ack.get_error_code() != 0 { 139 | bail!("code: {:?}", ack.get_error_code()); 140 | } 141 | Ok(()) 142 | } 143 | 144 | pub async fn unsubscribe(&mut self, filter: String) -> Result<(), FailureError> { 145 | assert!(self.connected); 146 | let mut unsub = Unsub::new(); 147 | unsub.set_client_id(self.conf.client_id.clone()); 148 | unsub.set_destination(self.conf.destinations.clone()); 149 | unsub.set_filter(filter); 150 | self.write_message(PacketType::UNSUBSCRIPTION, unsub).await?; 151 | let packet = self.read_packet().await?; 152 | assert_eq!(packet.get_field_type(), PacketType::ACK); 153 | match Ack::parse_from_bytes(packet.get_body()) { 154 | Ok(ack) => { 155 | if ack.get_error_code() > 0 { 156 | bail!("code: {:?}", ack.get_error_code()); 157 | } 158 | Ok(()) 159 | } 160 | Err(e) => bail!("{:?}", e), 161 | } 162 | } 163 | 164 | pub async fn ack(&mut self, batch_id: i64) -> Result<(), FailureError> { 165 | assert!(self.connected); 166 | let mut ack = ClientAck::new(); 167 | ack.set_client_id(self.conf.client_id.clone()); 168 | ack.set_destination(self.conf.destinations.clone()); 169 | ack.set_batch_id(batch_id); 170 | self.write_message(PacketType::CLIENTACK, ack).await 171 | } 172 | 173 | pub async fn roll_back(&mut self, batch_id: i64) -> Result<(), FailureError> { 174 | assert!(self.connected); 175 | let mut roll_back = ClientRollback::new(); 176 | roll_back.set_client_id(self.conf.client_id.clone()); 177 | roll_back.set_destination(self.conf.destinations.clone()); 178 | roll_back.set_batch_id(batch_id); 179 | self.write_message(PacketType::CLIENTROLLBACK, roll_back).await 180 | } 181 | 182 | pub async fn disconnect(&mut self) -> Result<(), FailureError> { 183 | assert!(self.connected); 184 | self.connected = false; 185 | self.framed.take(); 186 | debug!("Close connection"); 187 | Ok(()) 188 | } 189 | 190 | async fn read_packet(&mut self) -> Result { 191 | let framed = self.framed.as_mut().unwrap(); 192 | match framed.next().await { 193 | Some(Ok(buf)) => { 194 | let packet: Packet = Packet::parse_from_bytes(&buf)?; 195 | Ok(packet) 196 | } 197 | Some(Err(e)) => bail!("{:?}", e), 198 | None => bail!("Connect has close"), 199 | } 200 | } 201 | 202 | async fn read_message(&mut self) -> Result { 203 | let packet = self.read_packet().await?; 204 | M::parse_from_bytes(&*packet.body).map_err(|err| err.into()) 205 | } 206 | 207 | async fn write_packet(&mut self, packet: Packet) -> Result<(), FailureError> { 208 | let framed = self.framed.as_mut().unwrap(); 209 | framed.send(Bytes::from(packet.write_to_bytes()?)).await.map(|_| ()).map_err(|err| err.into()) 210 | } 211 | 212 | async fn write_message(&mut self, packet_type: PacketType, message: M) -> Result<(), FailureError> { 213 | let mut packet = Packet::new(); 214 | packet.set_field_type(packet_type); 215 | packet.set_body(message.write_to_bytes()?); 216 | self.write_packet(packet).await 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /src/cluster.rs: -------------------------------------------------------------------------------- 1 | use zookeeper::{ZkResult, ZooKeeper, Watch, WatchedEvent, Watcher, ZkError}; 2 | use futures::{future, Sink, SinkExt, Stream, StreamExt, TryFutureExt}; 3 | use failure::{Error as FailureError, Fail}; 4 | use tokio::sync::oneshot::{self, Receiver, Sender}; 5 | use tokio::task; 6 | use tokio::runtime::Runtime; 7 | use serde::{Serialize, Deserialize}; 8 | use serde_json::{Serializer, Deserializer}; 9 | 10 | use std::time::Duration; 11 | use std::sync::{Arc, Mutex}; 12 | use std::str::FromStr; 13 | use std::net::SocketAddr; 14 | use crate::{Config, Client}; 15 | use crate::protobuf::CanalProtocol::Messages; 16 | 17 | pub struct Cluster { 18 | config: Config, 19 | node: ClusterNode, 20 | client: Client, 21 | } 22 | 23 | impl Cluster { 24 | pub async fn new(config: Config, zk_addr: String, zk_timeout: Duration) -> Result { 25 | let node = ClusterNode::new(zk_addr.as_str(), config.destinations.clone(), zk_timeout).await?; 26 | let running_node: RunningNode = node.get_active_canal_config()?; 27 | let mut client = crate::Client::new(running_node.address.parse().unwrap(), config.clone()); 28 | client.connect().await?; 29 | Ok(Cluster { 30 | node, 31 | client, 32 | config, 33 | }) 34 | } 35 | 36 | pub async fn get_without_ack(&mut self, batch_size: i32, timeout: Option, uints: Option) -> Result { 37 | let ret = self.client.get_without_ack(batch_size, timeout, uints).await?; 38 | self.fix_connect().await?; 39 | Ok(ret) 40 | } 41 | 42 | pub async fn get(&mut self, batch_size: i32, timeout: Option, uints: Option) -> Result { 43 | let ret = self.client.get(batch_size, timeout, uints).await?; 44 | self.fix_connect().await?; 45 | Ok(ret) 46 | } 47 | pub async fn subscribe(&mut self, filter: String) -> Result<(), FailureError> { 48 | let ret = self.client.subscribe(filter).await?; 49 | self.fix_connect().await?; 50 | Ok(ret) 51 | } 52 | 53 | pub async fn unsubscribe(&mut self, filter: String) -> Result<(), FailureError> { 54 | let ret = self.client.unsubscribe(filter).await?; 55 | self.fix_connect().await?; 56 | Ok(ret) 57 | } 58 | 59 | pub async fn ack(&mut self, batch_id: i64) -> Result<(), FailureError> { 60 | let ret = self.client.ack(batch_id).await?; 61 | self.fix_connect().await?; 62 | Ok(ret) 63 | } 64 | 65 | pub async fn disconnect(&mut self) -> Result<(), FailureError> { 66 | self.client.disconnect().await 67 | } 68 | 69 | async fn fix_connect(&mut self) -> Result<(), FailureError> { 70 | let running_node = self.node.get_active_canal_config()?; 71 | let socket = running_node.address.parse()?; 72 | let mut client = crate::Client::new(socket, self.config.clone()); 73 | client.connect().await?; 74 | self.client = client; 75 | Ok(()) 76 | } 77 | } 78 | 79 | #[derive(Clone)] 80 | pub struct ClusterNode { 81 | destinations: String, 82 | zk: Arc>, 83 | } 84 | 85 | #[derive(Serialize, Deserialize, Debug)] 86 | pub struct RunningNode { 87 | #[serde(alias = "active")] 88 | active: bool, 89 | #[serde(alias = "address")] 90 | address: String, 91 | } 92 | 93 | struct IgnoreLogWatch; 94 | 95 | impl Watcher for IgnoreLogWatch { 96 | fn handle(&self, _: WatchedEvent) {} 97 | } 98 | 99 | impl Watcher for ClusterNode { 100 | fn handle(&self, e: WatchedEvent) { 101 | debug!("receive a event: {:?}", e); 102 | } 103 | } 104 | 105 | impl ClusterNode { 106 | pub async fn new(addr: &str, destinations: String, timeout: Duration) -> Result { 107 | match ZooKeeper::connect(addr, timeout, IgnoreLogWatch) { 108 | Ok(zk) => { 109 | let zk = Arc::new(Mutex::new(zk)); 110 | let active_path = format!("/otter/canal/destinations/{}/running", destinations.clone()); 111 | let cluster = ClusterNode { 112 | destinations: destinations.clone(), 113 | zk: zk.clone(), 114 | }; 115 | ClusterNode::get_active_canal_config_watch(zk.clone(), &destinations, cluster.clone()).await?; 116 | Ok(cluster) 117 | } 118 | Err(e) => { 119 | bail!("{:?}", e) 120 | } 121 | } 122 | } 123 | 124 | pub(crate) fn get_active_canal_config(&self) -> Result { 125 | let zk = self.zk.lock().unwrap(); 126 | let cluster_path = format!("/otter/canal/destinations/{}/cluster", self.destinations); 127 | let active_path = format!("/otter/canal/destinations/{}/running", self.destinations); 128 | zk.get_children(cluster_path.as_str(), false)?.iter().for_each(|node| { debug!("canal node: {:?}", node) }); 129 | let (data, _) = zk.get_data(active_path.as_str(), false)?; 130 | serde_json::from_slice(&data).map_err(|err| err.into()) 131 | } 132 | 133 | async fn get_active_canal_config_watch(zk: Arc>, destinations: &String, watcher: W) -> Result { 134 | let zk = zk.lock().unwrap(); 135 | let cluster_path = format!("/otter/canal/destinations/{}/cluster", destinations); 136 | let active_path = format!("/otter/canal/destinations/{}/running", destinations); 137 | zk.get_children(cluster_path.as_str(), false)?.iter().for_each(|node| { debug!("canal node: {:?}", node); }); 138 | let (data, _) = zk.get_data_w(active_path.as_str(), watcher)?; 139 | serde_json::from_slice(&data).map_err(|err| err.into()) 140 | } 141 | } -------------------------------------------------------------------------------- /src/examples/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "0.7.6" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "arc-swap" 16 | version = "0.4.4" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" 19 | 20 | [[package]] 21 | name = "atty" 22 | version = "0.2.13" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" 25 | dependencies = [ 26 | "libc", 27 | "winapi 0.3.8", 28 | ] 29 | 30 | [[package]] 31 | name = "autocfg" 32 | version = "0.1.7" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 35 | 36 | [[package]] 37 | name = "autocfg" 38 | version = "1.0.1" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 41 | 42 | [[package]] 43 | name = "backtrace" 44 | version = "0.3.40" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" 47 | dependencies = [ 48 | "backtrace-sys", 49 | "cfg-if 0.1.10", 50 | "libc", 51 | "rustc-demangle", 52 | ] 53 | 54 | [[package]] 55 | name = "backtrace-sys" 56 | version = "0.1.32" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" 59 | dependencies = [ 60 | "cc", 61 | "libc", 62 | ] 63 | 64 | [[package]] 65 | name = "bitflags" 66 | version = "1.2.1" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 69 | 70 | [[package]] 71 | name = "byteorder" 72 | version = "1.3.2" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" 75 | 76 | [[package]] 77 | name = "bytes" 78 | version = "0.4.12" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" 81 | dependencies = [ 82 | "byteorder", 83 | "iovec", 84 | ] 85 | 86 | [[package]] 87 | name = "bytes" 88 | version = "1.1.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 91 | dependencies = [ 92 | "serde", 93 | ] 94 | 95 | [[package]] 96 | name = "canal-rs" 97 | version = "0.1.1" 98 | dependencies = [ 99 | "bytes 1.1.0", 100 | "failure", 101 | "futures", 102 | "log", 103 | "protobuf", 104 | "serde", 105 | "serde_derive", 106 | "serde_json", 107 | "tokio", 108 | "tokio-util", 109 | "zookeeper", 110 | ] 111 | 112 | [[package]] 113 | name = "cc" 114 | version = "1.0.48" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76" 117 | 118 | [[package]] 119 | name = "cfg-if" 120 | version = "0.1.10" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 123 | 124 | [[package]] 125 | name = "cfg-if" 126 | version = "1.0.0" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 129 | 130 | [[package]] 131 | name = "chrono" 132 | version = "0.4.10" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" 135 | dependencies = [ 136 | "num-integer", 137 | "num-traits", 138 | "time", 139 | ] 140 | 141 | [[package]] 142 | name = "env_logger" 143 | version = "0.6.2" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" 146 | dependencies = [ 147 | "atty", 148 | "humantime", 149 | "log", 150 | "regex", 151 | "termcolor", 152 | ] 153 | 154 | [[package]] 155 | name = "examples" 156 | version = "0.0.0" 157 | dependencies = [ 158 | "bytes 1.1.0", 159 | "canal-rs", 160 | "failure", 161 | "futures", 162 | "log", 163 | "pretty_env_logger", 164 | "protobuf", 165 | "tokio", 166 | "tokio-util", 167 | "zookeeper", 168 | ] 169 | 170 | [[package]] 171 | name = "failure" 172 | version = "0.1.6" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" 175 | dependencies = [ 176 | "backtrace", 177 | "failure_derive", 178 | ] 179 | 180 | [[package]] 181 | name = "failure_derive" 182 | version = "0.1.6" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" 185 | dependencies = [ 186 | "proc-macro2 1.0.29", 187 | "quote 1.0.2", 188 | "syn 1.0.80", 189 | "synstructure", 190 | ] 191 | 192 | [[package]] 193 | name = "fuchsia-zircon" 194 | version = "0.3.3" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 197 | dependencies = [ 198 | "bitflags", 199 | "fuchsia-zircon-sys", 200 | ] 201 | 202 | [[package]] 203 | name = "fuchsia-zircon-sys" 204 | version = "0.3.3" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 207 | 208 | [[package]] 209 | name = "futures" 210 | version = "0.3.1" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" 213 | dependencies = [ 214 | "futures-channel", 215 | "futures-core", 216 | "futures-executor", 217 | "futures-io", 218 | "futures-sink", 219 | "futures-task", 220 | "futures-util", 221 | ] 222 | 223 | [[package]] 224 | name = "futures-channel" 225 | version = "0.3.1" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" 228 | dependencies = [ 229 | "futures-core", 230 | "futures-sink", 231 | ] 232 | 233 | [[package]] 234 | name = "futures-core" 235 | version = "0.3.1" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" 238 | 239 | [[package]] 240 | name = "futures-executor" 241 | version = "0.3.1" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" 244 | dependencies = [ 245 | "futures-core", 246 | "futures-task", 247 | "futures-util", 248 | ] 249 | 250 | [[package]] 251 | name = "futures-io" 252 | version = "0.3.1" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" 255 | 256 | [[package]] 257 | name = "futures-macro" 258 | version = "0.3.1" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" 261 | dependencies = [ 262 | "proc-macro-hack", 263 | "proc-macro2 1.0.29", 264 | "quote 1.0.2", 265 | "syn 1.0.80", 266 | ] 267 | 268 | [[package]] 269 | name = "futures-sink" 270 | version = "0.3.1" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" 273 | 274 | [[package]] 275 | name = "futures-task" 276 | version = "0.3.1" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" 279 | 280 | [[package]] 281 | name = "futures-util" 282 | version = "0.3.1" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" 285 | dependencies = [ 286 | "futures-channel", 287 | "futures-core", 288 | "futures-io", 289 | "futures-macro", 290 | "futures-sink", 291 | "futures-task", 292 | "memchr", 293 | "pin-utils", 294 | "proc-macro-hack", 295 | "proc-macro-nested", 296 | "slab", 297 | ] 298 | 299 | [[package]] 300 | name = "hermit-abi" 301 | version = "0.1.5" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" 304 | dependencies = [ 305 | "libc", 306 | ] 307 | 308 | [[package]] 309 | name = "humantime" 310 | version = "1.3.0" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" 313 | dependencies = [ 314 | "quick-error", 315 | ] 316 | 317 | [[package]] 318 | name = "instant" 319 | version = "0.1.11" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" 322 | dependencies = [ 323 | "cfg-if 1.0.0", 324 | ] 325 | 326 | [[package]] 327 | name = "iovec" 328 | version = "0.1.4" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 331 | dependencies = [ 332 | "libc", 333 | ] 334 | 335 | [[package]] 336 | name = "itoa" 337 | version = "0.4.4" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" 340 | 341 | [[package]] 342 | name = "kernel32-sys" 343 | version = "0.2.2" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 346 | dependencies = [ 347 | "winapi 0.2.8", 348 | "winapi-build", 349 | ] 350 | 351 | [[package]] 352 | name = "lazy_static" 353 | version = "1.4.0" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 356 | 357 | [[package]] 358 | name = "lazycell" 359 | version = "1.2.1" 360 | source = "registry+https://github.com/rust-lang/crates.io-index" 361 | checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" 362 | 363 | [[package]] 364 | name = "libc" 365 | version = "0.2.103" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" 368 | 369 | [[package]] 370 | name = "lock_api" 371 | version = "0.4.5" 372 | source = "registry+https://github.com/rust-lang/crates.io-index" 373 | checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" 374 | dependencies = [ 375 | "scopeguard", 376 | ] 377 | 378 | [[package]] 379 | name = "log" 380 | version = "0.4.8" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 383 | dependencies = [ 384 | "cfg-if 0.1.10", 385 | ] 386 | 387 | [[package]] 388 | name = "memchr" 389 | version = "2.2.1" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" 392 | 393 | [[package]] 394 | name = "mio" 395 | version = "0.6.21" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" 398 | dependencies = [ 399 | "cfg-if 0.1.10", 400 | "fuchsia-zircon", 401 | "fuchsia-zircon-sys", 402 | "iovec", 403 | "kernel32-sys", 404 | "libc", 405 | "log", 406 | "miow 0.2.1", 407 | "net2", 408 | "slab", 409 | "winapi 0.2.8", 410 | ] 411 | 412 | [[package]] 413 | name = "mio" 414 | version = "0.7.13" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" 417 | dependencies = [ 418 | "libc", 419 | "log", 420 | "miow 0.3.7", 421 | "ntapi", 422 | "winapi 0.3.8", 423 | ] 424 | 425 | [[package]] 426 | name = "mio-extras" 427 | version = "2.0.6" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" 430 | dependencies = [ 431 | "lazycell", 432 | "log", 433 | "mio 0.6.21", 434 | "slab", 435 | ] 436 | 437 | [[package]] 438 | name = "miow" 439 | version = "0.2.1" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 442 | dependencies = [ 443 | "kernel32-sys", 444 | "net2", 445 | "winapi 0.2.8", 446 | "ws2_32-sys", 447 | ] 448 | 449 | [[package]] 450 | name = "miow" 451 | version = "0.3.7" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 454 | dependencies = [ 455 | "winapi 0.3.8", 456 | ] 457 | 458 | [[package]] 459 | name = "net2" 460 | version = "0.2.33" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" 463 | dependencies = [ 464 | "cfg-if 0.1.10", 465 | "libc", 466 | "winapi 0.3.8", 467 | ] 468 | 469 | [[package]] 470 | name = "ntapi" 471 | version = "0.3.4" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" 474 | dependencies = [ 475 | "winapi 0.3.8", 476 | ] 477 | 478 | [[package]] 479 | name = "num-integer" 480 | version = "0.1.41" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" 483 | dependencies = [ 484 | "autocfg 0.1.7", 485 | "num-traits", 486 | ] 487 | 488 | [[package]] 489 | name = "num-traits" 490 | version = "0.2.10" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" 493 | dependencies = [ 494 | "autocfg 0.1.7", 495 | ] 496 | 497 | [[package]] 498 | name = "num_cpus" 499 | version = "1.11.1" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" 502 | dependencies = [ 503 | "hermit-abi", 504 | "libc", 505 | ] 506 | 507 | [[package]] 508 | name = "once_cell" 509 | version = "1.8.0" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 512 | 513 | [[package]] 514 | name = "parking_lot" 515 | version = "0.11.1" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 518 | dependencies = [ 519 | "instant", 520 | "lock_api", 521 | "parking_lot_core", 522 | ] 523 | 524 | [[package]] 525 | name = "parking_lot_core" 526 | version = "0.8.3" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" 529 | dependencies = [ 530 | "cfg-if 1.0.0", 531 | "instant", 532 | "libc", 533 | "redox_syscall 0.2.10", 534 | "smallvec", 535 | "winapi 0.3.8", 536 | ] 537 | 538 | [[package]] 539 | name = "pin-project-lite" 540 | version = "0.2.7" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" 543 | 544 | [[package]] 545 | name = "pin-utils" 546 | version = "0.1.0-alpha.4" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" 549 | 550 | [[package]] 551 | name = "pretty_env_logger" 552 | version = "0.3.1" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" 555 | dependencies = [ 556 | "chrono", 557 | "env_logger", 558 | "log", 559 | ] 560 | 561 | [[package]] 562 | name = "proc-macro-hack" 563 | version = "0.5.11" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" 566 | dependencies = [ 567 | "proc-macro2 1.0.29", 568 | "quote 1.0.2", 569 | "syn 1.0.80", 570 | ] 571 | 572 | [[package]] 573 | name = "proc-macro-nested" 574 | version = "0.1.3" 575 | source = "registry+https://github.com/rust-lang/crates.io-index" 576 | checksum = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" 577 | 578 | [[package]] 579 | name = "proc-macro2" 580 | version = "0.4.30" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 583 | dependencies = [ 584 | "unicode-xid 0.1.0", 585 | ] 586 | 587 | [[package]] 588 | name = "proc-macro2" 589 | version = "1.0.29" 590 | source = "registry+https://github.com/rust-lang/crates.io-index" 591 | checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" 592 | dependencies = [ 593 | "unicode-xid 0.2.0", 594 | ] 595 | 596 | [[package]] 597 | name = "protobuf" 598 | version = "2.25.1" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | checksum = "23129d50f2c9355ced935fce8a08bd706ee2e7ce2b3b33bf61dace0e379ac63a" 601 | dependencies = [ 602 | "bytes 1.1.0", 603 | ] 604 | 605 | [[package]] 606 | name = "quick-error" 607 | version = "1.2.2" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" 610 | 611 | [[package]] 612 | name = "quote" 613 | version = "0.6.13" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 616 | dependencies = [ 617 | "proc-macro2 0.4.30", 618 | ] 619 | 620 | [[package]] 621 | name = "quote" 622 | version = "1.0.2" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" 625 | dependencies = [ 626 | "proc-macro2 1.0.29", 627 | ] 628 | 629 | [[package]] 630 | name = "redox_syscall" 631 | version = "0.1.56" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 634 | 635 | [[package]] 636 | name = "redox_syscall" 637 | version = "0.2.10" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 640 | dependencies = [ 641 | "bitflags", 642 | ] 643 | 644 | [[package]] 645 | name = "regex" 646 | version = "1.3.1" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" 649 | dependencies = [ 650 | "aho-corasick", 651 | "memchr", 652 | "regex-syntax", 653 | "thread_local", 654 | ] 655 | 656 | [[package]] 657 | name = "regex-syntax" 658 | version = "0.6.12" 659 | source = "registry+https://github.com/rust-lang/crates.io-index" 660 | checksum = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" 661 | 662 | [[package]] 663 | name = "rustc-demangle" 664 | version = "0.1.16" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" 667 | 668 | [[package]] 669 | name = "ryu" 670 | version = "1.0.2" 671 | source = "registry+https://github.com/rust-lang/crates.io-index" 672 | checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" 673 | 674 | [[package]] 675 | name = "scopeguard" 676 | version = "1.1.0" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 679 | 680 | [[package]] 681 | name = "serde" 682 | version = "1.0.104" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" 685 | 686 | [[package]] 687 | name = "serde_derive" 688 | version = "1.0.104" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" 691 | dependencies = [ 692 | "proc-macro2 1.0.29", 693 | "quote 1.0.2", 694 | "syn 1.0.80", 695 | ] 696 | 697 | [[package]] 698 | name = "serde_json" 699 | version = "1.0.44" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" 702 | dependencies = [ 703 | "itoa", 704 | "ryu", 705 | "serde", 706 | ] 707 | 708 | [[package]] 709 | name = "signal-hook-registry" 710 | version = "1.2.0" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" 713 | dependencies = [ 714 | "arc-swap", 715 | "libc", 716 | ] 717 | 718 | [[package]] 719 | name = "slab" 720 | version = "0.4.2" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 723 | 724 | [[package]] 725 | name = "smallvec" 726 | version = "1.7.0" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" 729 | 730 | [[package]] 731 | name = "snowflake" 732 | version = "1.3.0" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "27207bb65232eda1f588cf46db2fee75c0808d557f6b3cf19a75f5d6d7c94df1" 735 | 736 | [[package]] 737 | name = "syn" 738 | version = "0.14.9" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" 741 | dependencies = [ 742 | "proc-macro2 0.4.30", 743 | "quote 0.6.13", 744 | "unicode-xid 0.1.0", 745 | ] 746 | 747 | [[package]] 748 | name = "syn" 749 | version = "1.0.80" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" 752 | dependencies = [ 753 | "proc-macro2 1.0.29", 754 | "quote 1.0.2", 755 | "unicode-xid 0.2.0", 756 | ] 757 | 758 | [[package]] 759 | name = "synstructure" 760 | version = "0.12.3" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" 763 | dependencies = [ 764 | "proc-macro2 1.0.29", 765 | "quote 1.0.2", 766 | "syn 1.0.80", 767 | "unicode-xid 0.2.0", 768 | ] 769 | 770 | [[package]] 771 | name = "termcolor" 772 | version = "1.0.5" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" 775 | dependencies = [ 776 | "wincolor", 777 | ] 778 | 779 | [[package]] 780 | name = "thread_local" 781 | version = "0.3.6" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" 784 | dependencies = [ 785 | "lazy_static", 786 | ] 787 | 788 | [[package]] 789 | name = "time" 790 | version = "0.1.42" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" 793 | dependencies = [ 794 | "libc", 795 | "redox_syscall 0.1.56", 796 | "winapi 0.3.8", 797 | ] 798 | 799 | [[package]] 800 | name = "tokio" 801 | version = "1.12.0" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" 804 | dependencies = [ 805 | "autocfg 1.0.1", 806 | "bytes 1.1.0", 807 | "libc", 808 | "memchr", 809 | "mio 0.7.13", 810 | "num_cpus", 811 | "once_cell", 812 | "parking_lot", 813 | "pin-project-lite", 814 | "signal-hook-registry", 815 | "tokio-macros", 816 | "winapi 0.3.8", 817 | ] 818 | 819 | [[package]] 820 | name = "tokio-macros" 821 | version = "1.4.1" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" 824 | dependencies = [ 825 | "proc-macro2 1.0.29", 826 | "quote 1.0.2", 827 | "syn 1.0.80", 828 | ] 829 | 830 | [[package]] 831 | name = "tokio-util" 832 | version = "0.6.8" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" 835 | dependencies = [ 836 | "bytes 1.1.0", 837 | "futures-core", 838 | "futures-io", 839 | "futures-sink", 840 | "log", 841 | "pin-project-lite", 842 | "slab", 843 | "tokio", 844 | ] 845 | 846 | [[package]] 847 | name = "unicode-xid" 848 | version = "0.1.0" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 851 | 852 | [[package]] 853 | name = "unicode-xid" 854 | version = "0.2.0" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 857 | 858 | [[package]] 859 | name = "winapi" 860 | version = "0.2.8" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 863 | 864 | [[package]] 865 | name = "winapi" 866 | version = "0.3.8" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 869 | dependencies = [ 870 | "winapi-i686-pc-windows-gnu", 871 | "winapi-x86_64-pc-windows-gnu", 872 | ] 873 | 874 | [[package]] 875 | name = "winapi-build" 876 | version = "0.1.1" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 879 | 880 | [[package]] 881 | name = "winapi-i686-pc-windows-gnu" 882 | version = "0.4.0" 883 | source = "registry+https://github.com/rust-lang/crates.io-index" 884 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 885 | 886 | [[package]] 887 | name = "winapi-util" 888 | version = "0.1.2" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" 891 | dependencies = [ 892 | "winapi 0.3.8", 893 | ] 894 | 895 | [[package]] 896 | name = "winapi-x86_64-pc-windows-gnu" 897 | version = "0.4.0" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 900 | 901 | [[package]] 902 | name = "wincolor" 903 | version = "1.0.2" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" 906 | dependencies = [ 907 | "winapi 0.3.8", 908 | "winapi-util", 909 | ] 910 | 911 | [[package]] 912 | name = "ws2_32-sys" 913 | version = "0.2.1" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 916 | dependencies = [ 917 | "winapi 0.2.8", 918 | "winapi-build", 919 | ] 920 | 921 | [[package]] 922 | name = "zookeeper" 923 | version = "0.5.7" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "7e41688007b678f13173f6f96a05987a390f120742bbfd2da0bb845355a20e20" 926 | dependencies = [ 927 | "byteorder", 928 | "bytes 0.4.12", 929 | "lazy_static", 930 | "log", 931 | "mio 0.6.21", 932 | "mio-extras", 933 | "snowflake", 934 | "zookeeper_derive", 935 | ] 936 | 937 | [[package]] 938 | name = "zookeeper_derive" 939 | version = "0.4.0" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "deb033fa1544f8923fbda1e3ff7410671de3a9fa001e4820a9b5fbade395b9da" 942 | dependencies = [ 943 | "quote 0.6.13", 944 | "syn 0.14.9", 945 | ] 946 | -------------------------------------------------------------------------------- /src/examples/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "examples" 3 | version = "0.0.0" 4 | publish = false 5 | edition = "2018" 6 | 7 | [dependencies] 8 | canal-rs = { path = "../../" } 9 | protobuf = { version = "2.25.1", features = ["with-bytes"] } 10 | tokio-util = { version = "0.6.8", features = ["full"] } 11 | tokio = { version = "1", features = ["full"] } 12 | bytes = { version = "1.1.0", features = ["serde"] } 13 | futures = "0.3.0" 14 | log = "0.4" 15 | pretty_env_logger = "0.3" 16 | failure = "0.1.6" 17 | zookeeper = "0.5" 18 | 19 | [[example]] 20 | name = "cluster" 21 | path = "cluster.rs" 22 | 23 | [[example]] 24 | name = "subscribe" 25 | path = "subscribe.rs" -------------------------------------------------------------------------------- /src/examples/cluster.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate log; 3 | 4 | use canal_rs::Client; 5 | use canal_rs::Config; 6 | use canal_rs::Cluster; 7 | use canal_rs::protobuf::EntryProtocol::{Entry, RowChange}; 8 | use canal_rs::protobuf::CanalProtocol::ClientAuth_oneof_net_read_timeout_present; 9 | use canal_rs::protobuf::CanalProtocol::ClientAuth_oneof_net_write_timeout_present; 10 | use canal_rs::protobuf::CanalProtocol::Messages; 11 | use protobuf::parse_from_bytes; 12 | 13 | use tokio::task; 14 | use tokio::time::{self, sleep}; 15 | use std::time::Duration; 16 | use std::io; 17 | 18 | use failure::Error as FailureError; 19 | use zookeeper::ZkError; 20 | 21 | #[tokio::main] 22 | async fn main() -> Result<(), FailureError> { 23 | pretty_env_logger::init(); 24 | 25 | let conf = Config::new("".to_string(), "".to_string(), "128".to_string(), "example".to_string(), ClientAuth_oneof_net_read_timeout_present::net_read_timeout(0), ClientAuth_oneof_net_write_timeout_present::net_write_timeout(0)); 26 | let zk_addr = "remote.dev.com:2181".to_string(); 27 | let timeout = Duration::from_secs(10); 28 | match Cluster::new(conf.clone(), zk_addr.clone(), timeout.clone()).await { 29 | Ok(_) => {} 30 | Err(e) => { 31 | debug!("{:?}", e.downcast::().unwrap()); 32 | } 33 | } 34 | let mut cluster = Cluster::new(conf, zk_addr, timeout).await?; 35 | cluster.subscribe(".*".to_string()).await.unwrap(); 36 | let join = task::spawn(async move { 37 | while let message = cluster.get(100, Some(10), Some(10)).await { 38 | match message { 39 | Ok(message) => { 40 | output(message); 41 | sleep(Duration::from_secs(3)); 42 | } 43 | Err(err) => { 44 | if err.downcast_ref::().is_some() { 45 | debug!("not found available node"); 46 | sleep(Duration::from_secs(3)); 47 | continue; 48 | } else if err.downcast_ref::().is_some() { 49 | debug!("not found available node"); 50 | sleep(Duration::from_secs(3)); 51 | continue; 52 | } 53 | break; 54 | } 55 | } 56 | } 57 | }); 58 | 59 | let ret = join.await; 60 | Ok(()) 61 | } 62 | 63 | fn output(message: Messages) { 64 | if message.batch_id == -1 { 65 | debug!("Empty data"); 66 | return; 67 | } 68 | debug!("batch_id: {:?}", message.batch_id); 69 | for buf in &message.messages { 70 | let entry: Entry = parse_from_bytes(&buf).unwrap(); 71 | match parse_from_bytes::(entry.get_storeValue()) { 72 | Ok(row_change) => { 73 | debug!("row_change: {:?}", row_change); 74 | } 75 | _ => {} 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /src/examples/subscribe.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate log; 3 | 4 | use canal_rs::Client; 5 | use canal_rs::Config; 6 | use canal_rs::protobuf::EntryProtocol::{Entry, RowChange}; 7 | use canal_rs::protobuf::CanalProtocol::ClientAuth_oneof_net_read_timeout_present; 8 | use canal_rs::protobuf::CanalProtocol::ClientAuth_oneof_net_write_timeout_present; 9 | use protobuf::parse_from_bytes; 10 | 11 | use tokio::task; 12 | use tokio::time::{self, sleep}; 13 | use std::time::Duration; 14 | 15 | #[tokio::main] 16 | async fn main() -> Result<(), String> { 17 | pretty_env_logger::init(); 18 | 19 | let conf = Config::new("".to_string(), "".to_string(), "128".to_string(), "example".to_string(), ClientAuth_oneof_net_read_timeout_present::net_read_timeout(0), ClientAuth_oneof_net_write_timeout_present::net_write_timeout(0)); 20 | 21 | let mut client: Client = Client::new("111.229.233.174:11111".parse().unwrap(), conf); 22 | client.connect().await.unwrap(); 23 | client.subscribe(".*".to_string()).await.unwrap(); 24 | let join = task::spawn(async move { 25 | while let message = client.get(100, Some(10), Some(10)).await.unwrap() { 26 | if message.batch_id == -1 { 27 | debug!("Empty data"); 28 | sleep(Duration::from_secs(3)).await; 29 | continue; 30 | } 31 | debug!("batch_id: {:?}", message.batch_id); 32 | for buf in &message.messages { 33 | let entry: Entry = parse_from_bytes(&buf).unwrap(); 34 | match parse_from_bytes::(entry.get_storeValue()) { 35 | Ok(row_change) => { 36 | debug!("row_change: {:?}", row_change); 37 | } 38 | _ => {} 39 | } 40 | } 41 | sleep(Duration::from_secs(1)).await; 42 | } 43 | }); 44 | 45 | let ret = join.await; 46 | Ok(()) 47 | } 48 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] extern crate log; 2 | #[macro_use] extern crate failure; 3 | #[macro_use] extern crate serde_derive; 4 | 5 | pub mod client; 6 | pub mod cluster; 7 | pub mod protobuf; 8 | 9 | pub use client::{Client, Config}; 10 | pub use cluster::Cluster; 11 | 12 | #[cfg(test)] 13 | mod tests { 14 | #[test] 15 | fn it_works() { 16 | assert_eq!(2 + 2, 4); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/protobuf/CanalProtocol.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package com.alibaba.otter.canal.protocol; 3 | 4 | option java_package = "com.alibaba.otter.canal.protocol"; 5 | option java_outer_classname = "CanalPacket"; 6 | option optimize_for = SPEED; 7 | 8 | enum Compression { 9 | COMPRESSIONCOMPATIBLEPROTO2 = 0; 10 | NONE = 1; 11 | ZLIB = 2; 12 | GZIP = 3; 13 | LZF = 4; 14 | } 15 | 16 | enum PacketType { 17 | //compatible 18 | PACKAGETYPECOMPATIBLEPROTO2 = 0; 19 | HANDSHAKE = 1; 20 | CLIENTAUTHENTICATION = 2; 21 | ACK = 3; 22 | SUBSCRIPTION = 4; 23 | UNSUBSCRIPTION = 5; 24 | GET = 6; 25 | MESSAGES = 7; 26 | CLIENTACK = 8; 27 | // management part 28 | SHUTDOWN = 9; 29 | // integration 30 | DUMP = 10; 31 | HEARTBEAT = 11; 32 | CLIENTROLLBACK = 12; 33 | } 34 | 35 | message Packet { 36 | //[default = 17]; 37 | oneof magic_number_present { 38 | int32 magic_number = 1; 39 | } 40 | //[default = 1]; 41 | oneof version_present { 42 | int32 version = 2; 43 | }; 44 | PacketType type = 3; 45 | //[default = NONE]; 46 | oneof compression_present { 47 | Compression compression = 4; 48 | } 49 | 50 | bytes body = 5; 51 | } 52 | 53 | message HeartBeat { 54 | int64 send_timestamp = 1; 55 | int64 start_timestamp = 2; 56 | } 57 | 58 | message Handshake { 59 | // [default = "utf8"]; 60 | oneof communication_encoding_present { 61 | string communication_encoding = 1; 62 | } 63 | bytes seeds = 2; 64 | Compression supported_compressions = 3; 65 | } 66 | 67 | // client authentication 68 | message ClientAuth { 69 | string username = 1; 70 | bytes password = 2; // hashed password with seeds from Handshake message 71 | // [default = 0] 72 | oneof net_read_timeout_present { 73 | int32 net_read_timeout = 3; // in seconds 74 | } 75 | // [default = 0]; 76 | oneof net_write_timeout_present { 77 | int32 net_write_timeout = 4; // in seconds 78 | } 79 | string destination = 5; 80 | string client_id = 6; 81 | string filter = 7; 82 | int64 start_timestamp = 8; 83 | } 84 | 85 | message Ack { 86 | //[default = 0] 87 | oneof error_code_present { 88 | int32 error_code = 1; 89 | } 90 | string error_message = 2; // if something like compression is not supported, erorr_message will tell about it. 91 | } 92 | 93 | message ClientAck { 94 | string destination = 1; 95 | string client_id = 2; 96 | int64 batch_id = 3; 97 | } 98 | 99 | // subscription 100 | message Sub { 101 | string destination = 1; 102 | string client_id = 2; 103 | string filter = 7; 104 | } 105 | 106 | // Unsubscription 107 | message Unsub { 108 | string destination = 1; 109 | string client_id = 2; 110 | string filter = 7; 111 | } 112 | 113 | // PullRequest 114 | message Get { 115 | string destination = 1; 116 | string client_id = 2; 117 | int32 fetch_size = 3; 118 | //[default = -1] 119 | oneof timeout_present { 120 | int64 timeout = 4; // 默认-1时代表不控制 121 | } 122 | //[default = 2] 123 | oneof unit_present { 124 | int32 unit = 5; // 数字类型,0:纳秒,1:毫秒,2:微秒,3:秒,4:分钟,5:小时,6:天 125 | } 126 | //[default = false] 127 | oneof auto_ack_present { 128 | bool auto_ack = 6; // 是否自动ack 129 | } 130 | } 131 | 132 | // 133 | message Messages { 134 | int64 batch_id = 1; 135 | repeated bytes messages = 2; 136 | } 137 | 138 | // TBD when new packets are required 139 | message Dump { 140 | string journal = 1; 141 | int64 position = 2; 142 | // [default = 0] 143 | oneof timestamp_present { 144 | int64 timestamp = 3; 145 | } 146 | } 147 | 148 | message ClientRollback { 149 | string destination = 1; 150 | string client_id = 2; 151 | int64 batch_id = 3; 152 | } -------------------------------------------------------------------------------- /src/protobuf/EntryProtocol.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package com.alibaba.otter.canal.protocol; 3 | 4 | option java_package = "com.alibaba.otter.canal.protocol"; 5 | option java_outer_classname = "CanalEntry"; 6 | option optimize_for = SPEED; 7 | 8 | /**************************************************************** 9 | * message model 10 | *如果要在Enum中新增类型,确保以前的类型的下标值不变. 11 | ****************************************************************/ 12 | message Entry { 13 | /**协议头部信息**/ 14 | Header header = 1; 15 | ///**打散后的事件类型**/ [default = ROWDATA] 16 | oneof entryType_present{ 17 | EntryType entryType = 2; 18 | } 19 | 20 | /**传输的二进制数组**/ 21 | bytes storeValue = 3; 22 | } 23 | 24 | /**message Header**/ 25 | message Header { 26 | /**协议的版本号**/ //[default = 1] 27 | oneof version_present { 28 | int32 version = 1; 29 | } 30 | 31 | 32 | /**binlog/redolog 文件名**/ 33 | string logfileName = 2; 34 | 35 | /**binlog/redolog 文件的偏移位置**/ 36 | int64 logfileOffset = 3; 37 | 38 | /**服务端serverId**/ 39 | int64 serverId = 4; 40 | 41 | /** 变更数据的编码 **/ 42 | string serverenCode = 5; 43 | 44 | /**变更数据的执行时间 **/ 45 | int64 executeTime = 6; 46 | 47 | /** 变更数据的来源**/ //[default = MYSQL] 48 | oneof sourceType_present { 49 | Type sourceType = 7; 50 | } 51 | 52 | 53 | /** 变更数据的schemaname**/ 54 | string schemaName = 8; 55 | 56 | /**变更数据的tablename**/ 57 | string tableName = 9; 58 | 59 | /**每个event的长度**/ 60 | int64 eventLength = 10; 61 | 62 | /**数据变更类型**/ // [default = UPDATE] 63 | oneof eventType_present { 64 | EventType eventType = 11; 65 | } 66 | 67 | 68 | /**预留扩展**/ 69 | repeated Pair props = 12; 70 | 71 | /**当前事务的gitd**/ 72 | string gtid = 13; 73 | } 74 | 75 | /**每个字段的数据结构**/ 76 | message Column { 77 | /**字段下标**/ 78 | int32 index = 1; 79 | 80 | /**字段java中类型**/ 81 | int32 sqlType = 2; 82 | 83 | /**字段名称(忽略大小写),在mysql中是没有的**/ 84 | string name = 3; 85 | 86 | /**是否是主键**/ 87 | bool isKey = 4; 88 | 89 | /**如果EventType=UPDATE,用于标识这个字段值是否有修改**/ 90 | bool updated = 5; 91 | 92 | /** 标识是否为空 **/ //[default = false] 93 | oneof isNull_present { 94 | bool isNull = 6; 95 | } 96 | 97 | 98 | /**预留扩展**/ 99 | repeated Pair props = 7; 100 | 101 | /** 字段值,timestamp,Datetime是一个时间格式的文本 **/ 102 | string value = 8; 103 | 104 | /** 对应数据对象原始长度 **/ 105 | int32 length = 9; 106 | 107 | /**字段mysql类型**/ 108 | string mysqlType = 10; 109 | } 110 | 111 | message RowData { 112 | 113 | /** 字段信息,增量数据(修改前,删除前) **/ 114 | repeated Column beforeColumns = 1; 115 | 116 | /** 字段信息,增量数据(修改后,新增后) **/ 117 | repeated Column afterColumns = 2; 118 | 119 | /**预留扩展**/ 120 | repeated Pair props = 3; 121 | } 122 | 123 | /**message row 每行变更数据的数据结构**/ 124 | message RowChange { 125 | 126 | /**tableId,由数据库产生**/ 127 | int64 tableId = 1; 128 | 129 | 130 | /**数据变更类型**/ //[default = UPDATE] 131 | oneof eventType_present { 132 | EventType eventType = 2; 133 | } 134 | 135 | 136 | /** 标识是否是ddl语句 **/ // [default = false] 137 | oneof isDdl_present { 138 | bool isDdl = 10; 139 | } 140 | 141 | 142 | /** ddl/query的sql语句 **/ 143 | string sql = 11; 144 | 145 | /** 一次数据库变更可能存在多行 **/ 146 | repeated RowData rowDatas = 12; 147 | 148 | /**预留扩展**/ 149 | repeated Pair props = 13; 150 | 151 | /** ddl/query的schemaName,会存在跨库ddl,需要保留执行ddl的当前schemaName **/ 152 | string ddlSchemaName = 14; 153 | } 154 | 155 | /**开始事务的一些信息**/ 156 | message TransactionBegin{ 157 | 158 | /**已废弃,请使用header里的executeTime**/ 159 | int64 executeTime = 1; 160 | 161 | /**已废弃,Begin里不提供事务id**/ 162 | string transactionId = 2; 163 | 164 | /**预留扩展**/ 165 | repeated Pair props = 3; 166 | 167 | /**执行的thread Id**/ 168 | int64 threadId = 4; 169 | } 170 | 171 | /**结束事务的一些信息**/ 172 | message TransactionEnd{ 173 | 174 | /**已废弃,请使用header里的executeTime**/ 175 | int64 executeTime = 1; 176 | 177 | /**事务号**/ 178 | string transactionId = 2; 179 | 180 | /**预留扩展**/ 181 | repeated Pair props = 3; 182 | } 183 | 184 | /**预留扩展**/ 185 | message Pair{ 186 | string key = 1; 187 | string value = 2; 188 | } 189 | 190 | /**打散后的事件类型,主要用于标识事务的开始,变更数据,结束**/ 191 | enum EntryType{ 192 | ENTRYTYPECOMPATIBLEPROTO2 = 0; 193 | TRANSACTIONBEGIN = 1; 194 | ROWDATA = 2; 195 | TRANSACTIONEND = 3; 196 | /** 心跳类型,内部使用,外部暂不可见,可忽略 **/ 197 | HEARTBEAT = 4; 198 | GTIDLOG = 5; 199 | } 200 | 201 | /** 事件类型 **/ 202 | enum EventType { 203 | EVENTTYPECOMPATIBLEPROTO2 = 0; 204 | INSERT = 1; 205 | UPDATE = 2; 206 | DELETE = 3; 207 | CREATE = 4; 208 | ALTER = 5; 209 | ERASE = 6; 210 | QUERY = 7; 211 | TRUNCATE = 8; 212 | RENAME = 9; 213 | /**CREATE INDEX**/ 214 | CINDEX = 10; 215 | DINDEX = 11; 216 | GTID = 12; 217 | /** XA **/ 218 | XACOMMIT = 13; 219 | XAROLLBACK = 14; 220 | /** MASTER HEARTBEAT **/ 221 | MHEARTBEAT = 15; 222 | } 223 | 224 | /**数据库类型**/ 225 | enum Type { 226 | TYPECOMPATIBLEPROTO2 = 0; 227 | ORACLE = 1; 228 | MYSQL = 2; 229 | PGSQL = 3; 230 | } -------------------------------------------------------------------------------- /src/protobuf/EntryProtocol.rs: -------------------------------------------------------------------------------- 1 | // This file is generated by rust-protobuf 2.25.1. Do not edit 2 | // @generated 3 | 4 | // https://github.com/rust-lang/rust-clippy/issues/702 5 | #![allow(unknown_lints)] 6 | #![allow(clippy::all)] 7 | 8 | #![allow(unused_attributes)] 9 | #![cfg_attr(rustfmt, rustfmt::skip)] 10 | 11 | #![allow(box_pointers)] 12 | #![allow(dead_code)] 13 | #![allow(missing_docs)] 14 | #![allow(non_camel_case_types)] 15 | #![allow(non_snake_case)] 16 | #![allow(non_upper_case_globals)] 17 | #![allow(trivial_casts)] 18 | #![allow(unused_imports)] 19 | #![allow(unused_results)] 20 | //! Generated file from `EntryProtocol.proto` 21 | 22 | /// Generated files are compatible only with the same version 23 | /// of protobuf runtime. 24 | // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_1; 25 | 26 | #[derive(PartialEq,Clone,Default)] 27 | pub struct Entry { 28 | // message fields 29 | pub header: ::protobuf::SingularPtrField
, 30 | pub storeValue: ::std::vec::Vec, 31 | // message oneof groups 32 | pub entryType_present: ::std::option::Option, 33 | // special fields 34 | pub unknown_fields: ::protobuf::UnknownFields, 35 | pub cached_size: ::protobuf::CachedSize, 36 | } 37 | 38 | impl<'a> ::std::default::Default for &'a Entry { 39 | fn default() -> &'a Entry { 40 | ::default_instance() 41 | } 42 | } 43 | 44 | #[derive(Clone,PartialEq,Debug)] 45 | pub enum Entry_oneof_entryType_present { 46 | entryType(EntryType), 47 | } 48 | 49 | impl Entry { 50 | pub fn new() -> Entry { 51 | ::std::default::Default::default() 52 | } 53 | 54 | // .com.alibaba.otter.canal.protocol.Header header = 1; 55 | 56 | 57 | pub fn get_header(&self) -> &Header { 58 | self.header.as_ref().unwrap_or_else(||
::default_instance()) 59 | } 60 | pub fn clear_header(&mut self) { 61 | self.header.clear(); 62 | } 63 | 64 | pub fn has_header(&self) -> bool { 65 | self.header.is_some() 66 | } 67 | 68 | // Param is passed by value, moved 69 | pub fn set_header(&mut self, v: Header) { 70 | self.header = ::protobuf::SingularPtrField::some(v); 71 | } 72 | 73 | // Mutable pointer to the field. 74 | // If field is not initialized, it is initialized with default value first. 75 | pub fn mut_header(&mut self) -> &mut Header { 76 | if self.header.is_none() { 77 | self.header.set_default(); 78 | } 79 | self.header.as_mut().unwrap() 80 | } 81 | 82 | // Take field 83 | pub fn take_header(&mut self) -> Header { 84 | self.header.take().unwrap_or_else(|| Header::new()) 85 | } 86 | 87 | // .com.alibaba.otter.canal.protocol.EntryType entryType = 2; 88 | 89 | 90 | pub fn get_entryType(&self) -> EntryType { 91 | match self.entryType_present { 92 | ::std::option::Option::Some(Entry_oneof_entryType_present::entryType(v)) => v, 93 | _ => EntryType::ENTRYTYPECOMPATIBLEPROTO2, 94 | } 95 | } 96 | pub fn clear_entryType(&mut self) { 97 | self.entryType_present = ::std::option::Option::None; 98 | } 99 | 100 | pub fn has_entryType(&self) -> bool { 101 | match self.entryType_present { 102 | ::std::option::Option::Some(Entry_oneof_entryType_present::entryType(..)) => true, 103 | _ => false, 104 | } 105 | } 106 | 107 | // Param is passed by value, moved 108 | pub fn set_entryType(&mut self, v: EntryType) { 109 | self.entryType_present = ::std::option::Option::Some(Entry_oneof_entryType_present::entryType(v)) 110 | } 111 | 112 | // bytes storeValue = 3; 113 | 114 | 115 | pub fn get_storeValue(&self) -> &[u8] { 116 | &self.storeValue 117 | } 118 | pub fn clear_storeValue(&mut self) { 119 | self.storeValue.clear(); 120 | } 121 | 122 | // Param is passed by value, moved 123 | pub fn set_storeValue(&mut self, v: ::std::vec::Vec) { 124 | self.storeValue = v; 125 | } 126 | 127 | // Mutable pointer to the field. 128 | // If field is not initialized, it is initialized with default value first. 129 | pub fn mut_storeValue(&mut self) -> &mut ::std::vec::Vec { 130 | &mut self.storeValue 131 | } 132 | 133 | // Take field 134 | pub fn take_storeValue(&mut self) -> ::std::vec::Vec { 135 | ::std::mem::replace(&mut self.storeValue, ::std::vec::Vec::new()) 136 | } 137 | } 138 | 139 | impl ::protobuf::Message for Entry { 140 | fn is_initialized(&self) -> bool { 141 | for v in &self.header { 142 | if !v.is_initialized() { 143 | return false; 144 | } 145 | }; 146 | true 147 | } 148 | 149 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 150 | while !is.eof()? { 151 | let (field_number, wire_type) = is.read_tag_unpack()?; 152 | match field_number { 153 | 1 => { 154 | ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.header)?; 155 | }, 156 | 2 => { 157 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 158 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 159 | } 160 | self.entryType_present = ::std::option::Option::Some(Entry_oneof_entryType_present::entryType(is.read_enum()?)); 161 | }, 162 | 3 => { 163 | ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.storeValue)?; 164 | }, 165 | _ => { 166 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 167 | }, 168 | }; 169 | } 170 | ::std::result::Result::Ok(()) 171 | } 172 | 173 | // Compute sizes of nested messages 174 | #[allow(unused_variables)] 175 | fn compute_size(&self) -> u32 { 176 | let mut my_size = 0; 177 | if let Some(ref v) = self.header.as_ref() { 178 | let len = v.compute_size(); 179 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 180 | } 181 | if !self.storeValue.is_empty() { 182 | my_size += ::protobuf::rt::bytes_size(3, &self.storeValue); 183 | } 184 | if let ::std::option::Option::Some(ref v) = self.entryType_present { 185 | match v { 186 | &Entry_oneof_entryType_present::entryType(v) => { 187 | my_size += ::protobuf::rt::enum_size(2, v); 188 | }, 189 | }; 190 | } 191 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 192 | self.cached_size.set(my_size); 193 | my_size 194 | } 195 | 196 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 197 | if let Some(ref v) = self.header.as_ref() { 198 | os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; 199 | os.write_raw_varint32(v.get_cached_size())?; 200 | v.write_to_with_cached_sizes(os)?; 201 | } 202 | if !self.storeValue.is_empty() { 203 | os.write_bytes(3, &self.storeValue)?; 204 | } 205 | if let ::std::option::Option::Some(ref v) = self.entryType_present { 206 | match v { 207 | &Entry_oneof_entryType_present::entryType(v) => { 208 | os.write_enum(2, ::protobuf::ProtobufEnum::value(&v))?; 209 | }, 210 | }; 211 | } 212 | os.write_unknown_fields(self.get_unknown_fields())?; 213 | ::std::result::Result::Ok(()) 214 | } 215 | 216 | fn get_cached_size(&self) -> u32 { 217 | self.cached_size.get() 218 | } 219 | 220 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 221 | &self.unknown_fields 222 | } 223 | 224 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 225 | &mut self.unknown_fields 226 | } 227 | 228 | fn as_any(&self) -> &dyn (::std::any::Any) { 229 | self as &dyn (::std::any::Any) 230 | } 231 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 232 | self as &mut dyn (::std::any::Any) 233 | } 234 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 235 | self 236 | } 237 | 238 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 239 | Self::descriptor_static() 240 | } 241 | 242 | fn new() -> Entry { 243 | Entry::new() 244 | } 245 | 246 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 247 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 248 | descriptor.get(|| { 249 | let mut fields = ::std::vec::Vec::new(); 250 | fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage
>( 251 | "header", 252 | |m: &Entry| { &m.header }, 253 | |m: &mut Entry| { &mut m.header }, 254 | )); 255 | fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor::<_, EntryType>( 256 | "entryType", 257 | Entry::has_entryType, 258 | Entry::get_entryType, 259 | )); 260 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( 261 | "storeValue", 262 | |m: &Entry| { &m.storeValue }, 263 | |m: &mut Entry| { &mut m.storeValue }, 264 | )); 265 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 266 | "Entry", 267 | fields, 268 | file_descriptor_proto() 269 | ) 270 | }) 271 | } 272 | 273 | fn default_instance() -> &'static Entry { 274 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 275 | instance.get(Entry::new) 276 | } 277 | } 278 | 279 | impl ::protobuf::Clear for Entry { 280 | fn clear(&mut self) { 281 | self.header.clear(); 282 | self.entryType_present = ::std::option::Option::None; 283 | self.storeValue.clear(); 284 | self.unknown_fields.clear(); 285 | } 286 | } 287 | 288 | impl ::std::fmt::Debug for Entry { 289 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 290 | ::protobuf::text_format::fmt(self, f) 291 | } 292 | } 293 | 294 | impl ::protobuf::reflect::ProtobufValue for Entry { 295 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 296 | ::protobuf::reflect::ReflectValueRef::Message(self) 297 | } 298 | } 299 | 300 | #[derive(PartialEq,Clone,Default)] 301 | pub struct Header { 302 | // message fields 303 | pub logfileName: ::std::string::String, 304 | pub logfileOffset: i64, 305 | pub serverId: i64, 306 | pub serverenCode: ::std::string::String, 307 | pub executeTime: i64, 308 | pub schemaName: ::std::string::String, 309 | pub tableName: ::std::string::String, 310 | pub eventLength: i64, 311 | pub props: ::protobuf::RepeatedField, 312 | pub gtid: ::std::string::String, 313 | // message oneof groups 314 | pub version_present: ::std::option::Option, 315 | pub sourceType_present: ::std::option::Option, 316 | pub eventType_present: ::std::option::Option, 317 | // special fields 318 | pub unknown_fields: ::protobuf::UnknownFields, 319 | pub cached_size: ::protobuf::CachedSize, 320 | } 321 | 322 | impl<'a> ::std::default::Default for &'a Header { 323 | fn default() -> &'a Header { 324 |
::default_instance() 325 | } 326 | } 327 | 328 | #[derive(Clone,PartialEq,Debug)] 329 | pub enum Header_oneof_version_present { 330 | version(i32), 331 | } 332 | 333 | #[derive(Clone,PartialEq,Debug)] 334 | pub enum Header_oneof_sourceType_present { 335 | sourceType(Type), 336 | } 337 | 338 | #[derive(Clone,PartialEq,Debug)] 339 | pub enum Header_oneof_eventType_present { 340 | eventType(EventType), 341 | } 342 | 343 | impl Header { 344 | pub fn new() -> Header { 345 | ::std::default::Default::default() 346 | } 347 | 348 | // int32 version = 1; 349 | 350 | 351 | pub fn get_version(&self) -> i32 { 352 | match self.version_present { 353 | ::std::option::Option::Some(Header_oneof_version_present::version(v)) => v, 354 | _ => 0, 355 | } 356 | } 357 | pub fn clear_version(&mut self) { 358 | self.version_present = ::std::option::Option::None; 359 | } 360 | 361 | pub fn has_version(&self) -> bool { 362 | match self.version_present { 363 | ::std::option::Option::Some(Header_oneof_version_present::version(..)) => true, 364 | _ => false, 365 | } 366 | } 367 | 368 | // Param is passed by value, moved 369 | pub fn set_version(&mut self, v: i32) { 370 | self.version_present = ::std::option::Option::Some(Header_oneof_version_present::version(v)) 371 | } 372 | 373 | // string logfileName = 2; 374 | 375 | 376 | pub fn get_logfileName(&self) -> &str { 377 | &self.logfileName 378 | } 379 | pub fn clear_logfileName(&mut self) { 380 | self.logfileName.clear(); 381 | } 382 | 383 | // Param is passed by value, moved 384 | pub fn set_logfileName(&mut self, v: ::std::string::String) { 385 | self.logfileName = v; 386 | } 387 | 388 | // Mutable pointer to the field. 389 | // If field is not initialized, it is initialized with default value first. 390 | pub fn mut_logfileName(&mut self) -> &mut ::std::string::String { 391 | &mut self.logfileName 392 | } 393 | 394 | // Take field 395 | pub fn take_logfileName(&mut self) -> ::std::string::String { 396 | ::std::mem::replace(&mut self.logfileName, ::std::string::String::new()) 397 | } 398 | 399 | // int64 logfileOffset = 3; 400 | 401 | 402 | pub fn get_logfileOffset(&self) -> i64 { 403 | self.logfileOffset 404 | } 405 | pub fn clear_logfileOffset(&mut self) { 406 | self.logfileOffset = 0; 407 | } 408 | 409 | // Param is passed by value, moved 410 | pub fn set_logfileOffset(&mut self, v: i64) { 411 | self.logfileOffset = v; 412 | } 413 | 414 | // int64 serverId = 4; 415 | 416 | 417 | pub fn get_serverId(&self) -> i64 { 418 | self.serverId 419 | } 420 | pub fn clear_serverId(&mut self) { 421 | self.serverId = 0; 422 | } 423 | 424 | // Param is passed by value, moved 425 | pub fn set_serverId(&mut self, v: i64) { 426 | self.serverId = v; 427 | } 428 | 429 | // string serverenCode = 5; 430 | 431 | 432 | pub fn get_serverenCode(&self) -> &str { 433 | &self.serverenCode 434 | } 435 | pub fn clear_serverenCode(&mut self) { 436 | self.serverenCode.clear(); 437 | } 438 | 439 | // Param is passed by value, moved 440 | pub fn set_serverenCode(&mut self, v: ::std::string::String) { 441 | self.serverenCode = v; 442 | } 443 | 444 | // Mutable pointer to the field. 445 | // If field is not initialized, it is initialized with default value first. 446 | pub fn mut_serverenCode(&mut self) -> &mut ::std::string::String { 447 | &mut self.serverenCode 448 | } 449 | 450 | // Take field 451 | pub fn take_serverenCode(&mut self) -> ::std::string::String { 452 | ::std::mem::replace(&mut self.serverenCode, ::std::string::String::new()) 453 | } 454 | 455 | // int64 executeTime = 6; 456 | 457 | 458 | pub fn get_executeTime(&self) -> i64 { 459 | self.executeTime 460 | } 461 | pub fn clear_executeTime(&mut self) { 462 | self.executeTime = 0; 463 | } 464 | 465 | // Param is passed by value, moved 466 | pub fn set_executeTime(&mut self, v: i64) { 467 | self.executeTime = v; 468 | } 469 | 470 | // .com.alibaba.otter.canal.protocol.Type sourceType = 7; 471 | 472 | 473 | pub fn get_sourceType(&self) -> Type { 474 | match self.sourceType_present { 475 | ::std::option::Option::Some(Header_oneof_sourceType_present::sourceType(v)) => v, 476 | _ => Type::TYPECOMPATIBLEPROTO2, 477 | } 478 | } 479 | pub fn clear_sourceType(&mut self) { 480 | self.sourceType_present = ::std::option::Option::None; 481 | } 482 | 483 | pub fn has_sourceType(&self) -> bool { 484 | match self.sourceType_present { 485 | ::std::option::Option::Some(Header_oneof_sourceType_present::sourceType(..)) => true, 486 | _ => false, 487 | } 488 | } 489 | 490 | // Param is passed by value, moved 491 | pub fn set_sourceType(&mut self, v: Type) { 492 | self.sourceType_present = ::std::option::Option::Some(Header_oneof_sourceType_present::sourceType(v)) 493 | } 494 | 495 | // string schemaName = 8; 496 | 497 | 498 | pub fn get_schemaName(&self) -> &str { 499 | &self.schemaName 500 | } 501 | pub fn clear_schemaName(&mut self) { 502 | self.schemaName.clear(); 503 | } 504 | 505 | // Param is passed by value, moved 506 | pub fn set_schemaName(&mut self, v: ::std::string::String) { 507 | self.schemaName = v; 508 | } 509 | 510 | // Mutable pointer to the field. 511 | // If field is not initialized, it is initialized with default value first. 512 | pub fn mut_schemaName(&mut self) -> &mut ::std::string::String { 513 | &mut self.schemaName 514 | } 515 | 516 | // Take field 517 | pub fn take_schemaName(&mut self) -> ::std::string::String { 518 | ::std::mem::replace(&mut self.schemaName, ::std::string::String::new()) 519 | } 520 | 521 | // string tableName = 9; 522 | 523 | 524 | pub fn get_tableName(&self) -> &str { 525 | &self.tableName 526 | } 527 | pub fn clear_tableName(&mut self) { 528 | self.tableName.clear(); 529 | } 530 | 531 | // Param is passed by value, moved 532 | pub fn set_tableName(&mut self, v: ::std::string::String) { 533 | self.tableName = v; 534 | } 535 | 536 | // Mutable pointer to the field. 537 | // If field is not initialized, it is initialized with default value first. 538 | pub fn mut_tableName(&mut self) -> &mut ::std::string::String { 539 | &mut self.tableName 540 | } 541 | 542 | // Take field 543 | pub fn take_tableName(&mut self) -> ::std::string::String { 544 | ::std::mem::replace(&mut self.tableName, ::std::string::String::new()) 545 | } 546 | 547 | // int64 eventLength = 10; 548 | 549 | 550 | pub fn get_eventLength(&self) -> i64 { 551 | self.eventLength 552 | } 553 | pub fn clear_eventLength(&mut self) { 554 | self.eventLength = 0; 555 | } 556 | 557 | // Param is passed by value, moved 558 | pub fn set_eventLength(&mut self, v: i64) { 559 | self.eventLength = v; 560 | } 561 | 562 | // .com.alibaba.otter.canal.protocol.EventType eventType = 11; 563 | 564 | 565 | pub fn get_eventType(&self) -> EventType { 566 | match self.eventType_present { 567 | ::std::option::Option::Some(Header_oneof_eventType_present::eventType(v)) => v, 568 | _ => EventType::EVENTTYPECOMPATIBLEPROTO2, 569 | } 570 | } 571 | pub fn clear_eventType(&mut self) { 572 | self.eventType_present = ::std::option::Option::None; 573 | } 574 | 575 | pub fn has_eventType(&self) -> bool { 576 | match self.eventType_present { 577 | ::std::option::Option::Some(Header_oneof_eventType_present::eventType(..)) => true, 578 | _ => false, 579 | } 580 | } 581 | 582 | // Param is passed by value, moved 583 | pub fn set_eventType(&mut self, v: EventType) { 584 | self.eventType_present = ::std::option::Option::Some(Header_oneof_eventType_present::eventType(v)) 585 | } 586 | 587 | // repeated .com.alibaba.otter.canal.protocol.Pair props = 12; 588 | 589 | 590 | pub fn get_props(&self) -> &[Pair] { 591 | &self.props 592 | } 593 | pub fn clear_props(&mut self) { 594 | self.props.clear(); 595 | } 596 | 597 | // Param is passed by value, moved 598 | pub fn set_props(&mut self, v: ::protobuf::RepeatedField) { 599 | self.props = v; 600 | } 601 | 602 | // Mutable pointer to the field. 603 | pub fn mut_props(&mut self) -> &mut ::protobuf::RepeatedField { 604 | &mut self.props 605 | } 606 | 607 | // Take field 608 | pub fn take_props(&mut self) -> ::protobuf::RepeatedField { 609 | ::std::mem::replace(&mut self.props, ::protobuf::RepeatedField::new()) 610 | } 611 | 612 | // string gtid = 13; 613 | 614 | 615 | pub fn get_gtid(&self) -> &str { 616 | &self.gtid 617 | } 618 | pub fn clear_gtid(&mut self) { 619 | self.gtid.clear(); 620 | } 621 | 622 | // Param is passed by value, moved 623 | pub fn set_gtid(&mut self, v: ::std::string::String) { 624 | self.gtid = v; 625 | } 626 | 627 | // Mutable pointer to the field. 628 | // If field is not initialized, it is initialized with default value first. 629 | pub fn mut_gtid(&mut self) -> &mut ::std::string::String { 630 | &mut self.gtid 631 | } 632 | 633 | // Take field 634 | pub fn take_gtid(&mut self) -> ::std::string::String { 635 | ::std::mem::replace(&mut self.gtid, ::std::string::String::new()) 636 | } 637 | } 638 | 639 | impl ::protobuf::Message for Header { 640 | fn is_initialized(&self) -> bool { 641 | for v in &self.props { 642 | if !v.is_initialized() { 643 | return false; 644 | } 645 | }; 646 | true 647 | } 648 | 649 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 650 | while !is.eof()? { 651 | let (field_number, wire_type) = is.read_tag_unpack()?; 652 | match field_number { 653 | 1 => { 654 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 655 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 656 | } 657 | self.version_present = ::std::option::Option::Some(Header_oneof_version_present::version(is.read_int32()?)); 658 | }, 659 | 2 => { 660 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.logfileName)?; 661 | }, 662 | 3 => { 663 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 664 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 665 | } 666 | let tmp = is.read_int64()?; 667 | self.logfileOffset = tmp; 668 | }, 669 | 4 => { 670 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 671 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 672 | } 673 | let tmp = is.read_int64()?; 674 | self.serverId = tmp; 675 | }, 676 | 5 => { 677 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.serverenCode)?; 678 | }, 679 | 6 => { 680 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 681 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 682 | } 683 | let tmp = is.read_int64()?; 684 | self.executeTime = tmp; 685 | }, 686 | 7 => { 687 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 688 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 689 | } 690 | self.sourceType_present = ::std::option::Option::Some(Header_oneof_sourceType_present::sourceType(is.read_enum()?)); 691 | }, 692 | 8 => { 693 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.schemaName)?; 694 | }, 695 | 9 => { 696 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.tableName)?; 697 | }, 698 | 10 => { 699 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 700 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 701 | } 702 | let tmp = is.read_int64()?; 703 | self.eventLength = tmp; 704 | }, 705 | 11 => { 706 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 707 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 708 | } 709 | self.eventType_present = ::std::option::Option::Some(Header_oneof_eventType_present::eventType(is.read_enum()?)); 710 | }, 711 | 12 => { 712 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.props)?; 713 | }, 714 | 13 => { 715 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.gtid)?; 716 | }, 717 | _ => { 718 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 719 | }, 720 | }; 721 | } 722 | ::std::result::Result::Ok(()) 723 | } 724 | 725 | // Compute sizes of nested messages 726 | #[allow(unused_variables)] 727 | fn compute_size(&self) -> u32 { 728 | let mut my_size = 0; 729 | if !self.logfileName.is_empty() { 730 | my_size += ::protobuf::rt::string_size(2, &self.logfileName); 731 | } 732 | if self.logfileOffset != 0 { 733 | my_size += ::protobuf::rt::value_size(3, self.logfileOffset, ::protobuf::wire_format::WireTypeVarint); 734 | } 735 | if self.serverId != 0 { 736 | my_size += ::protobuf::rt::value_size(4, self.serverId, ::protobuf::wire_format::WireTypeVarint); 737 | } 738 | if !self.serverenCode.is_empty() { 739 | my_size += ::protobuf::rt::string_size(5, &self.serverenCode); 740 | } 741 | if self.executeTime != 0 { 742 | my_size += ::protobuf::rt::value_size(6, self.executeTime, ::protobuf::wire_format::WireTypeVarint); 743 | } 744 | if !self.schemaName.is_empty() { 745 | my_size += ::protobuf::rt::string_size(8, &self.schemaName); 746 | } 747 | if !self.tableName.is_empty() { 748 | my_size += ::protobuf::rt::string_size(9, &self.tableName); 749 | } 750 | if self.eventLength != 0 { 751 | my_size += ::protobuf::rt::value_size(10, self.eventLength, ::protobuf::wire_format::WireTypeVarint); 752 | } 753 | for value in &self.props { 754 | let len = value.compute_size(); 755 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 756 | }; 757 | if !self.gtid.is_empty() { 758 | my_size += ::protobuf::rt::string_size(13, &self.gtid); 759 | } 760 | if let ::std::option::Option::Some(ref v) = self.version_present { 761 | match v { 762 | &Header_oneof_version_present::version(v) => { 763 | my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); 764 | }, 765 | }; 766 | } 767 | if let ::std::option::Option::Some(ref v) = self.sourceType_present { 768 | match v { 769 | &Header_oneof_sourceType_present::sourceType(v) => { 770 | my_size += ::protobuf::rt::enum_size(7, v); 771 | }, 772 | }; 773 | } 774 | if let ::std::option::Option::Some(ref v) = self.eventType_present { 775 | match v { 776 | &Header_oneof_eventType_present::eventType(v) => { 777 | my_size += ::protobuf::rt::enum_size(11, v); 778 | }, 779 | }; 780 | } 781 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 782 | self.cached_size.set(my_size); 783 | my_size 784 | } 785 | 786 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 787 | if !self.logfileName.is_empty() { 788 | os.write_string(2, &self.logfileName)?; 789 | } 790 | if self.logfileOffset != 0 { 791 | os.write_int64(3, self.logfileOffset)?; 792 | } 793 | if self.serverId != 0 { 794 | os.write_int64(4, self.serverId)?; 795 | } 796 | if !self.serverenCode.is_empty() { 797 | os.write_string(5, &self.serverenCode)?; 798 | } 799 | if self.executeTime != 0 { 800 | os.write_int64(6, self.executeTime)?; 801 | } 802 | if !self.schemaName.is_empty() { 803 | os.write_string(8, &self.schemaName)?; 804 | } 805 | if !self.tableName.is_empty() { 806 | os.write_string(9, &self.tableName)?; 807 | } 808 | if self.eventLength != 0 { 809 | os.write_int64(10, self.eventLength)?; 810 | } 811 | for v in &self.props { 812 | os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; 813 | os.write_raw_varint32(v.get_cached_size())?; 814 | v.write_to_with_cached_sizes(os)?; 815 | }; 816 | if !self.gtid.is_empty() { 817 | os.write_string(13, &self.gtid)?; 818 | } 819 | if let ::std::option::Option::Some(ref v) = self.version_present { 820 | match v { 821 | &Header_oneof_version_present::version(v) => { 822 | os.write_int32(1, v)?; 823 | }, 824 | }; 825 | } 826 | if let ::std::option::Option::Some(ref v) = self.sourceType_present { 827 | match v { 828 | &Header_oneof_sourceType_present::sourceType(v) => { 829 | os.write_enum(7, ::protobuf::ProtobufEnum::value(&v))?; 830 | }, 831 | }; 832 | } 833 | if let ::std::option::Option::Some(ref v) = self.eventType_present { 834 | match v { 835 | &Header_oneof_eventType_present::eventType(v) => { 836 | os.write_enum(11, ::protobuf::ProtobufEnum::value(&v))?; 837 | }, 838 | }; 839 | } 840 | os.write_unknown_fields(self.get_unknown_fields())?; 841 | ::std::result::Result::Ok(()) 842 | } 843 | 844 | fn get_cached_size(&self) -> u32 { 845 | self.cached_size.get() 846 | } 847 | 848 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 849 | &self.unknown_fields 850 | } 851 | 852 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 853 | &mut self.unknown_fields 854 | } 855 | 856 | fn as_any(&self) -> &dyn (::std::any::Any) { 857 | self as &dyn (::std::any::Any) 858 | } 859 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 860 | self as &mut dyn (::std::any::Any) 861 | } 862 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 863 | self 864 | } 865 | 866 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 867 | Self::descriptor_static() 868 | } 869 | 870 | fn new() -> Header { 871 | Header::new() 872 | } 873 | 874 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 875 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 876 | descriptor.get(|| { 877 | let mut fields = ::std::vec::Vec::new(); 878 | fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor::<_>( 879 | "version", 880 | Header::has_version, 881 | Header::get_version, 882 | )); 883 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 884 | "logfileName", 885 | |m: &Header| { &m.logfileName }, 886 | |m: &mut Header| { &mut m.logfileName }, 887 | )); 888 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 889 | "logfileOffset", 890 | |m: &Header| { &m.logfileOffset }, 891 | |m: &mut Header| { &mut m.logfileOffset }, 892 | )); 893 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 894 | "serverId", 895 | |m: &Header| { &m.serverId }, 896 | |m: &mut Header| { &mut m.serverId }, 897 | )); 898 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 899 | "serverenCode", 900 | |m: &Header| { &m.serverenCode }, 901 | |m: &mut Header| { &mut m.serverenCode }, 902 | )); 903 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 904 | "executeTime", 905 | |m: &Header| { &m.executeTime }, 906 | |m: &mut Header| { &mut m.executeTime }, 907 | )); 908 | fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor::<_, Type>( 909 | "sourceType", 910 | Header::has_sourceType, 911 | Header::get_sourceType, 912 | )); 913 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 914 | "schemaName", 915 | |m: &Header| { &m.schemaName }, 916 | |m: &mut Header| { &mut m.schemaName }, 917 | )); 918 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 919 | "tableName", 920 | |m: &Header| { &m.tableName }, 921 | |m: &mut Header| { &mut m.tableName }, 922 | )); 923 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 924 | "eventLength", 925 | |m: &Header| { &m.eventLength }, 926 | |m: &mut Header| { &mut m.eventLength }, 927 | )); 928 | fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor::<_, EventType>( 929 | "eventType", 930 | Header::has_eventType, 931 | Header::get_eventType, 932 | )); 933 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 934 | "props", 935 | |m: &Header| { &m.props }, 936 | |m: &mut Header| { &mut m.props }, 937 | )); 938 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 939 | "gtid", 940 | |m: &Header| { &m.gtid }, 941 | |m: &mut Header| { &mut m.gtid }, 942 | )); 943 | ::protobuf::reflect::MessageDescriptor::new_pb_name::
( 944 | "Header", 945 | fields, 946 | file_descriptor_proto() 947 | ) 948 | }) 949 | } 950 | 951 | fn default_instance() -> &'static Header { 952 | static instance: ::protobuf::rt::LazyV2
= ::protobuf::rt::LazyV2::INIT; 953 | instance.get(Header::new) 954 | } 955 | } 956 | 957 | impl ::protobuf::Clear for Header { 958 | fn clear(&mut self) { 959 | self.version_present = ::std::option::Option::None; 960 | self.logfileName.clear(); 961 | self.logfileOffset = 0; 962 | self.serverId = 0; 963 | self.serverenCode.clear(); 964 | self.executeTime = 0; 965 | self.sourceType_present = ::std::option::Option::None; 966 | self.schemaName.clear(); 967 | self.tableName.clear(); 968 | self.eventLength = 0; 969 | self.eventType_present = ::std::option::Option::None; 970 | self.props.clear(); 971 | self.gtid.clear(); 972 | self.unknown_fields.clear(); 973 | } 974 | } 975 | 976 | impl ::std::fmt::Debug for Header { 977 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 978 | ::protobuf::text_format::fmt(self, f) 979 | } 980 | } 981 | 982 | impl ::protobuf::reflect::ProtobufValue for Header { 983 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 984 | ::protobuf::reflect::ReflectValueRef::Message(self) 985 | } 986 | } 987 | 988 | #[derive(PartialEq,Clone,Default)] 989 | pub struct Column { 990 | // message fields 991 | pub index: i32, 992 | pub sqlType: i32, 993 | pub name: ::std::string::String, 994 | pub isKey: bool, 995 | pub updated: bool, 996 | pub props: ::protobuf::RepeatedField, 997 | pub value: ::std::string::String, 998 | pub length: i32, 999 | pub mysqlType: ::std::string::String, 1000 | // message oneof groups 1001 | pub isNull_present: ::std::option::Option, 1002 | // special fields 1003 | pub unknown_fields: ::protobuf::UnknownFields, 1004 | pub cached_size: ::protobuf::CachedSize, 1005 | } 1006 | 1007 | impl<'a> ::std::default::Default for &'a Column { 1008 | fn default() -> &'a Column { 1009 | ::default_instance() 1010 | } 1011 | } 1012 | 1013 | #[derive(Clone,PartialEq,Debug)] 1014 | pub enum Column_oneof_isNull_present { 1015 | isNull(bool), 1016 | } 1017 | 1018 | impl Column { 1019 | pub fn new() -> Column { 1020 | ::std::default::Default::default() 1021 | } 1022 | 1023 | // int32 index = 1; 1024 | 1025 | 1026 | pub fn get_index(&self) -> i32 { 1027 | self.index 1028 | } 1029 | pub fn clear_index(&mut self) { 1030 | self.index = 0; 1031 | } 1032 | 1033 | // Param is passed by value, moved 1034 | pub fn set_index(&mut self, v: i32) { 1035 | self.index = v; 1036 | } 1037 | 1038 | // int32 sqlType = 2; 1039 | 1040 | 1041 | pub fn get_sqlType(&self) -> i32 { 1042 | self.sqlType 1043 | } 1044 | pub fn clear_sqlType(&mut self) { 1045 | self.sqlType = 0; 1046 | } 1047 | 1048 | // Param is passed by value, moved 1049 | pub fn set_sqlType(&mut self, v: i32) { 1050 | self.sqlType = v; 1051 | } 1052 | 1053 | // string name = 3; 1054 | 1055 | 1056 | pub fn get_name(&self) -> &str { 1057 | &self.name 1058 | } 1059 | pub fn clear_name(&mut self) { 1060 | self.name.clear(); 1061 | } 1062 | 1063 | // Param is passed by value, moved 1064 | pub fn set_name(&mut self, v: ::std::string::String) { 1065 | self.name = v; 1066 | } 1067 | 1068 | // Mutable pointer to the field. 1069 | // If field is not initialized, it is initialized with default value first. 1070 | pub fn mut_name(&mut self) -> &mut ::std::string::String { 1071 | &mut self.name 1072 | } 1073 | 1074 | // Take field 1075 | pub fn take_name(&mut self) -> ::std::string::String { 1076 | ::std::mem::replace(&mut self.name, ::std::string::String::new()) 1077 | } 1078 | 1079 | // bool isKey = 4; 1080 | 1081 | 1082 | pub fn get_isKey(&self) -> bool { 1083 | self.isKey 1084 | } 1085 | pub fn clear_isKey(&mut self) { 1086 | self.isKey = false; 1087 | } 1088 | 1089 | // Param is passed by value, moved 1090 | pub fn set_isKey(&mut self, v: bool) { 1091 | self.isKey = v; 1092 | } 1093 | 1094 | // bool updated = 5; 1095 | 1096 | 1097 | pub fn get_updated(&self) -> bool { 1098 | self.updated 1099 | } 1100 | pub fn clear_updated(&mut self) { 1101 | self.updated = false; 1102 | } 1103 | 1104 | // Param is passed by value, moved 1105 | pub fn set_updated(&mut self, v: bool) { 1106 | self.updated = v; 1107 | } 1108 | 1109 | // bool isNull = 6; 1110 | 1111 | 1112 | pub fn get_isNull(&self) -> bool { 1113 | match self.isNull_present { 1114 | ::std::option::Option::Some(Column_oneof_isNull_present::isNull(v)) => v, 1115 | _ => false, 1116 | } 1117 | } 1118 | pub fn clear_isNull(&mut self) { 1119 | self.isNull_present = ::std::option::Option::None; 1120 | } 1121 | 1122 | pub fn has_isNull(&self) -> bool { 1123 | match self.isNull_present { 1124 | ::std::option::Option::Some(Column_oneof_isNull_present::isNull(..)) => true, 1125 | _ => false, 1126 | } 1127 | } 1128 | 1129 | // Param is passed by value, moved 1130 | pub fn set_isNull(&mut self, v: bool) { 1131 | self.isNull_present = ::std::option::Option::Some(Column_oneof_isNull_present::isNull(v)) 1132 | } 1133 | 1134 | // repeated .com.alibaba.otter.canal.protocol.Pair props = 7; 1135 | 1136 | 1137 | pub fn get_props(&self) -> &[Pair] { 1138 | &self.props 1139 | } 1140 | pub fn clear_props(&mut self) { 1141 | self.props.clear(); 1142 | } 1143 | 1144 | // Param is passed by value, moved 1145 | pub fn set_props(&mut self, v: ::protobuf::RepeatedField) { 1146 | self.props = v; 1147 | } 1148 | 1149 | // Mutable pointer to the field. 1150 | pub fn mut_props(&mut self) -> &mut ::protobuf::RepeatedField { 1151 | &mut self.props 1152 | } 1153 | 1154 | // Take field 1155 | pub fn take_props(&mut self) -> ::protobuf::RepeatedField { 1156 | ::std::mem::replace(&mut self.props, ::protobuf::RepeatedField::new()) 1157 | } 1158 | 1159 | // string value = 8; 1160 | 1161 | 1162 | pub fn get_value(&self) -> &str { 1163 | &self.value 1164 | } 1165 | pub fn clear_value(&mut self) { 1166 | self.value.clear(); 1167 | } 1168 | 1169 | // Param is passed by value, moved 1170 | pub fn set_value(&mut self, v: ::std::string::String) { 1171 | self.value = v; 1172 | } 1173 | 1174 | // Mutable pointer to the field. 1175 | // If field is not initialized, it is initialized with default value first. 1176 | pub fn mut_value(&mut self) -> &mut ::std::string::String { 1177 | &mut self.value 1178 | } 1179 | 1180 | // Take field 1181 | pub fn take_value(&mut self) -> ::std::string::String { 1182 | ::std::mem::replace(&mut self.value, ::std::string::String::new()) 1183 | } 1184 | 1185 | // int32 length = 9; 1186 | 1187 | 1188 | pub fn get_length(&self) -> i32 { 1189 | self.length 1190 | } 1191 | pub fn clear_length(&mut self) { 1192 | self.length = 0; 1193 | } 1194 | 1195 | // Param is passed by value, moved 1196 | pub fn set_length(&mut self, v: i32) { 1197 | self.length = v; 1198 | } 1199 | 1200 | // string mysqlType = 10; 1201 | 1202 | 1203 | pub fn get_mysqlType(&self) -> &str { 1204 | &self.mysqlType 1205 | } 1206 | pub fn clear_mysqlType(&mut self) { 1207 | self.mysqlType.clear(); 1208 | } 1209 | 1210 | // Param is passed by value, moved 1211 | pub fn set_mysqlType(&mut self, v: ::std::string::String) { 1212 | self.mysqlType = v; 1213 | } 1214 | 1215 | // Mutable pointer to the field. 1216 | // If field is not initialized, it is initialized with default value first. 1217 | pub fn mut_mysqlType(&mut self) -> &mut ::std::string::String { 1218 | &mut self.mysqlType 1219 | } 1220 | 1221 | // Take field 1222 | pub fn take_mysqlType(&mut self) -> ::std::string::String { 1223 | ::std::mem::replace(&mut self.mysqlType, ::std::string::String::new()) 1224 | } 1225 | } 1226 | 1227 | impl ::protobuf::Message for Column { 1228 | fn is_initialized(&self) -> bool { 1229 | for v in &self.props { 1230 | if !v.is_initialized() { 1231 | return false; 1232 | } 1233 | }; 1234 | true 1235 | } 1236 | 1237 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1238 | while !is.eof()? { 1239 | let (field_number, wire_type) = is.read_tag_unpack()?; 1240 | match field_number { 1241 | 1 => { 1242 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 1243 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1244 | } 1245 | let tmp = is.read_int32()?; 1246 | self.index = tmp; 1247 | }, 1248 | 2 => { 1249 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 1250 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1251 | } 1252 | let tmp = is.read_int32()?; 1253 | self.sqlType = tmp; 1254 | }, 1255 | 3 => { 1256 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?; 1257 | }, 1258 | 4 => { 1259 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 1260 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1261 | } 1262 | let tmp = is.read_bool()?; 1263 | self.isKey = tmp; 1264 | }, 1265 | 5 => { 1266 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 1267 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1268 | } 1269 | let tmp = is.read_bool()?; 1270 | self.updated = tmp; 1271 | }, 1272 | 6 => { 1273 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 1274 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1275 | } 1276 | self.isNull_present = ::std::option::Option::Some(Column_oneof_isNull_present::isNull(is.read_bool()?)); 1277 | }, 1278 | 7 => { 1279 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.props)?; 1280 | }, 1281 | 8 => { 1282 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?; 1283 | }, 1284 | 9 => { 1285 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 1286 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1287 | } 1288 | let tmp = is.read_int32()?; 1289 | self.length = tmp; 1290 | }, 1291 | 10 => { 1292 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.mysqlType)?; 1293 | }, 1294 | _ => { 1295 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 1296 | }, 1297 | }; 1298 | } 1299 | ::std::result::Result::Ok(()) 1300 | } 1301 | 1302 | // Compute sizes of nested messages 1303 | #[allow(unused_variables)] 1304 | fn compute_size(&self) -> u32 { 1305 | let mut my_size = 0; 1306 | if self.index != 0 { 1307 | my_size += ::protobuf::rt::value_size(1, self.index, ::protobuf::wire_format::WireTypeVarint); 1308 | } 1309 | if self.sqlType != 0 { 1310 | my_size += ::protobuf::rt::value_size(2, self.sqlType, ::protobuf::wire_format::WireTypeVarint); 1311 | } 1312 | if !self.name.is_empty() { 1313 | my_size += ::protobuf::rt::string_size(3, &self.name); 1314 | } 1315 | if self.isKey != false { 1316 | my_size += 2; 1317 | } 1318 | if self.updated != false { 1319 | my_size += 2; 1320 | } 1321 | for value in &self.props { 1322 | let len = value.compute_size(); 1323 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 1324 | }; 1325 | if !self.value.is_empty() { 1326 | my_size += ::protobuf::rt::string_size(8, &self.value); 1327 | } 1328 | if self.length != 0 { 1329 | my_size += ::protobuf::rt::value_size(9, self.length, ::protobuf::wire_format::WireTypeVarint); 1330 | } 1331 | if !self.mysqlType.is_empty() { 1332 | my_size += ::protobuf::rt::string_size(10, &self.mysqlType); 1333 | } 1334 | if let ::std::option::Option::Some(ref v) = self.isNull_present { 1335 | match v { 1336 | &Column_oneof_isNull_present::isNull(v) => { 1337 | my_size += 2; 1338 | }, 1339 | }; 1340 | } 1341 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 1342 | self.cached_size.set(my_size); 1343 | my_size 1344 | } 1345 | 1346 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1347 | if self.index != 0 { 1348 | os.write_int32(1, self.index)?; 1349 | } 1350 | if self.sqlType != 0 { 1351 | os.write_int32(2, self.sqlType)?; 1352 | } 1353 | if !self.name.is_empty() { 1354 | os.write_string(3, &self.name)?; 1355 | } 1356 | if self.isKey != false { 1357 | os.write_bool(4, self.isKey)?; 1358 | } 1359 | if self.updated != false { 1360 | os.write_bool(5, self.updated)?; 1361 | } 1362 | for v in &self.props { 1363 | os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; 1364 | os.write_raw_varint32(v.get_cached_size())?; 1365 | v.write_to_with_cached_sizes(os)?; 1366 | }; 1367 | if !self.value.is_empty() { 1368 | os.write_string(8, &self.value)?; 1369 | } 1370 | if self.length != 0 { 1371 | os.write_int32(9, self.length)?; 1372 | } 1373 | if !self.mysqlType.is_empty() { 1374 | os.write_string(10, &self.mysqlType)?; 1375 | } 1376 | if let ::std::option::Option::Some(ref v) = self.isNull_present { 1377 | match v { 1378 | &Column_oneof_isNull_present::isNull(v) => { 1379 | os.write_bool(6, v)?; 1380 | }, 1381 | }; 1382 | } 1383 | os.write_unknown_fields(self.get_unknown_fields())?; 1384 | ::std::result::Result::Ok(()) 1385 | } 1386 | 1387 | fn get_cached_size(&self) -> u32 { 1388 | self.cached_size.get() 1389 | } 1390 | 1391 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 1392 | &self.unknown_fields 1393 | } 1394 | 1395 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 1396 | &mut self.unknown_fields 1397 | } 1398 | 1399 | fn as_any(&self) -> &dyn (::std::any::Any) { 1400 | self as &dyn (::std::any::Any) 1401 | } 1402 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 1403 | self as &mut dyn (::std::any::Any) 1404 | } 1405 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 1406 | self 1407 | } 1408 | 1409 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 1410 | Self::descriptor_static() 1411 | } 1412 | 1413 | fn new() -> Column { 1414 | Column::new() 1415 | } 1416 | 1417 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 1418 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 1419 | descriptor.get(|| { 1420 | let mut fields = ::std::vec::Vec::new(); 1421 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( 1422 | "index", 1423 | |m: &Column| { &m.index }, 1424 | |m: &mut Column| { &mut m.index }, 1425 | )); 1426 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( 1427 | "sqlType", 1428 | |m: &Column| { &m.sqlType }, 1429 | |m: &mut Column| { &mut m.sqlType }, 1430 | )); 1431 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 1432 | "name", 1433 | |m: &Column| { &m.name }, 1434 | |m: &mut Column| { &mut m.name }, 1435 | )); 1436 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( 1437 | "isKey", 1438 | |m: &Column| { &m.isKey }, 1439 | |m: &mut Column| { &mut m.isKey }, 1440 | )); 1441 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( 1442 | "updated", 1443 | |m: &Column| { &m.updated }, 1444 | |m: &mut Column| { &mut m.updated }, 1445 | )); 1446 | fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( 1447 | "isNull", 1448 | Column::has_isNull, 1449 | Column::get_isNull, 1450 | )); 1451 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 1452 | "props", 1453 | |m: &Column| { &m.props }, 1454 | |m: &mut Column| { &mut m.props }, 1455 | )); 1456 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 1457 | "value", 1458 | |m: &Column| { &m.value }, 1459 | |m: &mut Column| { &mut m.value }, 1460 | )); 1461 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( 1462 | "length", 1463 | |m: &Column| { &m.length }, 1464 | |m: &mut Column| { &mut m.length }, 1465 | )); 1466 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 1467 | "mysqlType", 1468 | |m: &Column| { &m.mysqlType }, 1469 | |m: &mut Column| { &mut m.mysqlType }, 1470 | )); 1471 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 1472 | "Column", 1473 | fields, 1474 | file_descriptor_proto() 1475 | ) 1476 | }) 1477 | } 1478 | 1479 | fn default_instance() -> &'static Column { 1480 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 1481 | instance.get(Column::new) 1482 | } 1483 | } 1484 | 1485 | impl ::protobuf::Clear for Column { 1486 | fn clear(&mut self) { 1487 | self.index = 0; 1488 | self.sqlType = 0; 1489 | self.name.clear(); 1490 | self.isKey = false; 1491 | self.updated = false; 1492 | self.isNull_present = ::std::option::Option::None; 1493 | self.props.clear(); 1494 | self.value.clear(); 1495 | self.length = 0; 1496 | self.mysqlType.clear(); 1497 | self.unknown_fields.clear(); 1498 | } 1499 | } 1500 | 1501 | impl ::std::fmt::Debug for Column { 1502 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 1503 | ::protobuf::text_format::fmt(self, f) 1504 | } 1505 | } 1506 | 1507 | impl ::protobuf::reflect::ProtobufValue for Column { 1508 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 1509 | ::protobuf::reflect::ReflectValueRef::Message(self) 1510 | } 1511 | } 1512 | 1513 | #[derive(PartialEq,Clone,Default)] 1514 | pub struct RowData { 1515 | // message fields 1516 | pub beforeColumns: ::protobuf::RepeatedField, 1517 | pub afterColumns: ::protobuf::RepeatedField, 1518 | pub props: ::protobuf::RepeatedField, 1519 | // special fields 1520 | pub unknown_fields: ::protobuf::UnknownFields, 1521 | pub cached_size: ::protobuf::CachedSize, 1522 | } 1523 | 1524 | impl<'a> ::std::default::Default for &'a RowData { 1525 | fn default() -> &'a RowData { 1526 | ::default_instance() 1527 | } 1528 | } 1529 | 1530 | impl RowData { 1531 | pub fn new() -> RowData { 1532 | ::std::default::Default::default() 1533 | } 1534 | 1535 | // repeated .com.alibaba.otter.canal.protocol.Column beforeColumns = 1; 1536 | 1537 | 1538 | pub fn get_beforeColumns(&self) -> &[Column] { 1539 | &self.beforeColumns 1540 | } 1541 | pub fn clear_beforeColumns(&mut self) { 1542 | self.beforeColumns.clear(); 1543 | } 1544 | 1545 | // Param is passed by value, moved 1546 | pub fn set_beforeColumns(&mut self, v: ::protobuf::RepeatedField) { 1547 | self.beforeColumns = v; 1548 | } 1549 | 1550 | // Mutable pointer to the field. 1551 | pub fn mut_beforeColumns(&mut self) -> &mut ::protobuf::RepeatedField { 1552 | &mut self.beforeColumns 1553 | } 1554 | 1555 | // Take field 1556 | pub fn take_beforeColumns(&mut self) -> ::protobuf::RepeatedField { 1557 | ::std::mem::replace(&mut self.beforeColumns, ::protobuf::RepeatedField::new()) 1558 | } 1559 | 1560 | // repeated .com.alibaba.otter.canal.protocol.Column afterColumns = 2; 1561 | 1562 | 1563 | pub fn get_afterColumns(&self) -> &[Column] { 1564 | &self.afterColumns 1565 | } 1566 | pub fn clear_afterColumns(&mut self) { 1567 | self.afterColumns.clear(); 1568 | } 1569 | 1570 | // Param is passed by value, moved 1571 | pub fn set_afterColumns(&mut self, v: ::protobuf::RepeatedField) { 1572 | self.afterColumns = v; 1573 | } 1574 | 1575 | // Mutable pointer to the field. 1576 | pub fn mut_afterColumns(&mut self) -> &mut ::protobuf::RepeatedField { 1577 | &mut self.afterColumns 1578 | } 1579 | 1580 | // Take field 1581 | pub fn take_afterColumns(&mut self) -> ::protobuf::RepeatedField { 1582 | ::std::mem::replace(&mut self.afterColumns, ::protobuf::RepeatedField::new()) 1583 | } 1584 | 1585 | // repeated .com.alibaba.otter.canal.protocol.Pair props = 3; 1586 | 1587 | 1588 | pub fn get_props(&self) -> &[Pair] { 1589 | &self.props 1590 | } 1591 | pub fn clear_props(&mut self) { 1592 | self.props.clear(); 1593 | } 1594 | 1595 | // Param is passed by value, moved 1596 | pub fn set_props(&mut self, v: ::protobuf::RepeatedField) { 1597 | self.props = v; 1598 | } 1599 | 1600 | // Mutable pointer to the field. 1601 | pub fn mut_props(&mut self) -> &mut ::protobuf::RepeatedField { 1602 | &mut self.props 1603 | } 1604 | 1605 | // Take field 1606 | pub fn take_props(&mut self) -> ::protobuf::RepeatedField { 1607 | ::std::mem::replace(&mut self.props, ::protobuf::RepeatedField::new()) 1608 | } 1609 | } 1610 | 1611 | impl ::protobuf::Message for RowData { 1612 | fn is_initialized(&self) -> bool { 1613 | for v in &self.beforeColumns { 1614 | if !v.is_initialized() { 1615 | return false; 1616 | } 1617 | }; 1618 | for v in &self.afterColumns { 1619 | if !v.is_initialized() { 1620 | return false; 1621 | } 1622 | }; 1623 | for v in &self.props { 1624 | if !v.is_initialized() { 1625 | return false; 1626 | } 1627 | }; 1628 | true 1629 | } 1630 | 1631 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1632 | while !is.eof()? { 1633 | let (field_number, wire_type) = is.read_tag_unpack()?; 1634 | match field_number { 1635 | 1 => { 1636 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.beforeColumns)?; 1637 | }, 1638 | 2 => { 1639 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.afterColumns)?; 1640 | }, 1641 | 3 => { 1642 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.props)?; 1643 | }, 1644 | _ => { 1645 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 1646 | }, 1647 | }; 1648 | } 1649 | ::std::result::Result::Ok(()) 1650 | } 1651 | 1652 | // Compute sizes of nested messages 1653 | #[allow(unused_variables)] 1654 | fn compute_size(&self) -> u32 { 1655 | let mut my_size = 0; 1656 | for value in &self.beforeColumns { 1657 | let len = value.compute_size(); 1658 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 1659 | }; 1660 | for value in &self.afterColumns { 1661 | let len = value.compute_size(); 1662 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 1663 | }; 1664 | for value in &self.props { 1665 | let len = value.compute_size(); 1666 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 1667 | }; 1668 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 1669 | self.cached_size.set(my_size); 1670 | my_size 1671 | } 1672 | 1673 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1674 | for v in &self.beforeColumns { 1675 | os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; 1676 | os.write_raw_varint32(v.get_cached_size())?; 1677 | v.write_to_with_cached_sizes(os)?; 1678 | }; 1679 | for v in &self.afterColumns { 1680 | os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; 1681 | os.write_raw_varint32(v.get_cached_size())?; 1682 | v.write_to_with_cached_sizes(os)?; 1683 | }; 1684 | for v in &self.props { 1685 | os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; 1686 | os.write_raw_varint32(v.get_cached_size())?; 1687 | v.write_to_with_cached_sizes(os)?; 1688 | }; 1689 | os.write_unknown_fields(self.get_unknown_fields())?; 1690 | ::std::result::Result::Ok(()) 1691 | } 1692 | 1693 | fn get_cached_size(&self) -> u32 { 1694 | self.cached_size.get() 1695 | } 1696 | 1697 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 1698 | &self.unknown_fields 1699 | } 1700 | 1701 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 1702 | &mut self.unknown_fields 1703 | } 1704 | 1705 | fn as_any(&self) -> &dyn (::std::any::Any) { 1706 | self as &dyn (::std::any::Any) 1707 | } 1708 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 1709 | self as &mut dyn (::std::any::Any) 1710 | } 1711 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 1712 | self 1713 | } 1714 | 1715 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 1716 | Self::descriptor_static() 1717 | } 1718 | 1719 | fn new() -> RowData { 1720 | RowData::new() 1721 | } 1722 | 1723 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 1724 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 1725 | descriptor.get(|| { 1726 | let mut fields = ::std::vec::Vec::new(); 1727 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 1728 | "beforeColumns", 1729 | |m: &RowData| { &m.beforeColumns }, 1730 | |m: &mut RowData| { &mut m.beforeColumns }, 1731 | )); 1732 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 1733 | "afterColumns", 1734 | |m: &RowData| { &m.afterColumns }, 1735 | |m: &mut RowData| { &mut m.afterColumns }, 1736 | )); 1737 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 1738 | "props", 1739 | |m: &RowData| { &m.props }, 1740 | |m: &mut RowData| { &mut m.props }, 1741 | )); 1742 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 1743 | "RowData", 1744 | fields, 1745 | file_descriptor_proto() 1746 | ) 1747 | }) 1748 | } 1749 | 1750 | fn default_instance() -> &'static RowData { 1751 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 1752 | instance.get(RowData::new) 1753 | } 1754 | } 1755 | 1756 | impl ::protobuf::Clear for RowData { 1757 | fn clear(&mut self) { 1758 | self.beforeColumns.clear(); 1759 | self.afterColumns.clear(); 1760 | self.props.clear(); 1761 | self.unknown_fields.clear(); 1762 | } 1763 | } 1764 | 1765 | impl ::std::fmt::Debug for RowData { 1766 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 1767 | ::protobuf::text_format::fmt(self, f) 1768 | } 1769 | } 1770 | 1771 | impl ::protobuf::reflect::ProtobufValue for RowData { 1772 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 1773 | ::protobuf::reflect::ReflectValueRef::Message(self) 1774 | } 1775 | } 1776 | 1777 | #[derive(PartialEq,Clone,Default)] 1778 | pub struct RowChange { 1779 | // message fields 1780 | pub tableId: i64, 1781 | pub sql: ::std::string::String, 1782 | pub rowDatas: ::protobuf::RepeatedField, 1783 | pub props: ::protobuf::RepeatedField, 1784 | pub ddlSchemaName: ::std::string::String, 1785 | // message oneof groups 1786 | pub eventType_present: ::std::option::Option, 1787 | pub isDdl_present: ::std::option::Option, 1788 | // special fields 1789 | pub unknown_fields: ::protobuf::UnknownFields, 1790 | pub cached_size: ::protobuf::CachedSize, 1791 | } 1792 | 1793 | impl<'a> ::std::default::Default for &'a RowChange { 1794 | fn default() -> &'a RowChange { 1795 | ::default_instance() 1796 | } 1797 | } 1798 | 1799 | #[derive(Clone,PartialEq,Debug)] 1800 | pub enum RowChange_oneof_eventType_present { 1801 | eventType(EventType), 1802 | } 1803 | 1804 | #[derive(Clone,PartialEq,Debug)] 1805 | pub enum RowChange_oneof_isDdl_present { 1806 | isDdl(bool), 1807 | } 1808 | 1809 | impl RowChange { 1810 | pub fn new() -> RowChange { 1811 | ::std::default::Default::default() 1812 | } 1813 | 1814 | // int64 tableId = 1; 1815 | 1816 | 1817 | pub fn get_tableId(&self) -> i64 { 1818 | self.tableId 1819 | } 1820 | pub fn clear_tableId(&mut self) { 1821 | self.tableId = 0; 1822 | } 1823 | 1824 | // Param is passed by value, moved 1825 | pub fn set_tableId(&mut self, v: i64) { 1826 | self.tableId = v; 1827 | } 1828 | 1829 | // .com.alibaba.otter.canal.protocol.EventType eventType = 2; 1830 | 1831 | 1832 | pub fn get_eventType(&self) -> EventType { 1833 | match self.eventType_present { 1834 | ::std::option::Option::Some(RowChange_oneof_eventType_present::eventType(v)) => v, 1835 | _ => EventType::EVENTTYPECOMPATIBLEPROTO2, 1836 | } 1837 | } 1838 | pub fn clear_eventType(&mut self) { 1839 | self.eventType_present = ::std::option::Option::None; 1840 | } 1841 | 1842 | pub fn has_eventType(&self) -> bool { 1843 | match self.eventType_present { 1844 | ::std::option::Option::Some(RowChange_oneof_eventType_present::eventType(..)) => true, 1845 | _ => false, 1846 | } 1847 | } 1848 | 1849 | // Param is passed by value, moved 1850 | pub fn set_eventType(&mut self, v: EventType) { 1851 | self.eventType_present = ::std::option::Option::Some(RowChange_oneof_eventType_present::eventType(v)) 1852 | } 1853 | 1854 | // bool isDdl = 10; 1855 | 1856 | 1857 | pub fn get_isDdl(&self) -> bool { 1858 | match self.isDdl_present { 1859 | ::std::option::Option::Some(RowChange_oneof_isDdl_present::isDdl(v)) => v, 1860 | _ => false, 1861 | } 1862 | } 1863 | pub fn clear_isDdl(&mut self) { 1864 | self.isDdl_present = ::std::option::Option::None; 1865 | } 1866 | 1867 | pub fn has_isDdl(&self) -> bool { 1868 | match self.isDdl_present { 1869 | ::std::option::Option::Some(RowChange_oneof_isDdl_present::isDdl(..)) => true, 1870 | _ => false, 1871 | } 1872 | } 1873 | 1874 | // Param is passed by value, moved 1875 | pub fn set_isDdl(&mut self, v: bool) { 1876 | self.isDdl_present = ::std::option::Option::Some(RowChange_oneof_isDdl_present::isDdl(v)) 1877 | } 1878 | 1879 | // string sql = 11; 1880 | 1881 | 1882 | pub fn get_sql(&self) -> &str { 1883 | &self.sql 1884 | } 1885 | pub fn clear_sql(&mut self) { 1886 | self.sql.clear(); 1887 | } 1888 | 1889 | // Param is passed by value, moved 1890 | pub fn set_sql(&mut self, v: ::std::string::String) { 1891 | self.sql = v; 1892 | } 1893 | 1894 | // Mutable pointer to the field. 1895 | // If field is not initialized, it is initialized with default value first. 1896 | pub fn mut_sql(&mut self) -> &mut ::std::string::String { 1897 | &mut self.sql 1898 | } 1899 | 1900 | // Take field 1901 | pub fn take_sql(&mut self) -> ::std::string::String { 1902 | ::std::mem::replace(&mut self.sql, ::std::string::String::new()) 1903 | } 1904 | 1905 | // repeated .com.alibaba.otter.canal.protocol.RowData rowDatas = 12; 1906 | 1907 | 1908 | pub fn get_rowDatas(&self) -> &[RowData] { 1909 | &self.rowDatas 1910 | } 1911 | pub fn clear_rowDatas(&mut self) { 1912 | self.rowDatas.clear(); 1913 | } 1914 | 1915 | // Param is passed by value, moved 1916 | pub fn set_rowDatas(&mut self, v: ::protobuf::RepeatedField) { 1917 | self.rowDatas = v; 1918 | } 1919 | 1920 | // Mutable pointer to the field. 1921 | pub fn mut_rowDatas(&mut self) -> &mut ::protobuf::RepeatedField { 1922 | &mut self.rowDatas 1923 | } 1924 | 1925 | // Take field 1926 | pub fn take_rowDatas(&mut self) -> ::protobuf::RepeatedField { 1927 | ::std::mem::replace(&mut self.rowDatas, ::protobuf::RepeatedField::new()) 1928 | } 1929 | 1930 | // repeated .com.alibaba.otter.canal.protocol.Pair props = 13; 1931 | 1932 | 1933 | pub fn get_props(&self) -> &[Pair] { 1934 | &self.props 1935 | } 1936 | pub fn clear_props(&mut self) { 1937 | self.props.clear(); 1938 | } 1939 | 1940 | // Param is passed by value, moved 1941 | pub fn set_props(&mut self, v: ::protobuf::RepeatedField) { 1942 | self.props = v; 1943 | } 1944 | 1945 | // Mutable pointer to the field. 1946 | pub fn mut_props(&mut self) -> &mut ::protobuf::RepeatedField { 1947 | &mut self.props 1948 | } 1949 | 1950 | // Take field 1951 | pub fn take_props(&mut self) -> ::protobuf::RepeatedField { 1952 | ::std::mem::replace(&mut self.props, ::protobuf::RepeatedField::new()) 1953 | } 1954 | 1955 | // string ddlSchemaName = 14; 1956 | 1957 | 1958 | pub fn get_ddlSchemaName(&self) -> &str { 1959 | &self.ddlSchemaName 1960 | } 1961 | pub fn clear_ddlSchemaName(&mut self) { 1962 | self.ddlSchemaName.clear(); 1963 | } 1964 | 1965 | // Param is passed by value, moved 1966 | pub fn set_ddlSchemaName(&mut self, v: ::std::string::String) { 1967 | self.ddlSchemaName = v; 1968 | } 1969 | 1970 | // Mutable pointer to the field. 1971 | // If field is not initialized, it is initialized with default value first. 1972 | pub fn mut_ddlSchemaName(&mut self) -> &mut ::std::string::String { 1973 | &mut self.ddlSchemaName 1974 | } 1975 | 1976 | // Take field 1977 | pub fn take_ddlSchemaName(&mut self) -> ::std::string::String { 1978 | ::std::mem::replace(&mut self.ddlSchemaName, ::std::string::String::new()) 1979 | } 1980 | } 1981 | 1982 | impl ::protobuf::Message for RowChange { 1983 | fn is_initialized(&self) -> bool { 1984 | for v in &self.rowDatas { 1985 | if !v.is_initialized() { 1986 | return false; 1987 | } 1988 | }; 1989 | for v in &self.props { 1990 | if !v.is_initialized() { 1991 | return false; 1992 | } 1993 | }; 1994 | true 1995 | } 1996 | 1997 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1998 | while !is.eof()? { 1999 | let (field_number, wire_type) = is.read_tag_unpack()?; 2000 | match field_number { 2001 | 1 => { 2002 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 2003 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 2004 | } 2005 | let tmp = is.read_int64()?; 2006 | self.tableId = tmp; 2007 | }, 2008 | 2 => { 2009 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 2010 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 2011 | } 2012 | self.eventType_present = ::std::option::Option::Some(RowChange_oneof_eventType_present::eventType(is.read_enum()?)); 2013 | }, 2014 | 10 => { 2015 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 2016 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 2017 | } 2018 | self.isDdl_present = ::std::option::Option::Some(RowChange_oneof_isDdl_present::isDdl(is.read_bool()?)); 2019 | }, 2020 | 11 => { 2021 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.sql)?; 2022 | }, 2023 | 12 => { 2024 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.rowDatas)?; 2025 | }, 2026 | 13 => { 2027 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.props)?; 2028 | }, 2029 | 14 => { 2030 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.ddlSchemaName)?; 2031 | }, 2032 | _ => { 2033 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 2034 | }, 2035 | }; 2036 | } 2037 | ::std::result::Result::Ok(()) 2038 | } 2039 | 2040 | // Compute sizes of nested messages 2041 | #[allow(unused_variables)] 2042 | fn compute_size(&self) -> u32 { 2043 | let mut my_size = 0; 2044 | if self.tableId != 0 { 2045 | my_size += ::protobuf::rt::value_size(1, self.tableId, ::protobuf::wire_format::WireTypeVarint); 2046 | } 2047 | if !self.sql.is_empty() { 2048 | my_size += ::protobuf::rt::string_size(11, &self.sql); 2049 | } 2050 | for value in &self.rowDatas { 2051 | let len = value.compute_size(); 2052 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 2053 | }; 2054 | for value in &self.props { 2055 | let len = value.compute_size(); 2056 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 2057 | }; 2058 | if !self.ddlSchemaName.is_empty() { 2059 | my_size += ::protobuf::rt::string_size(14, &self.ddlSchemaName); 2060 | } 2061 | if let ::std::option::Option::Some(ref v) = self.eventType_present { 2062 | match v { 2063 | &RowChange_oneof_eventType_present::eventType(v) => { 2064 | my_size += ::protobuf::rt::enum_size(2, v); 2065 | }, 2066 | }; 2067 | } 2068 | if let ::std::option::Option::Some(ref v) = self.isDdl_present { 2069 | match v { 2070 | &RowChange_oneof_isDdl_present::isDdl(v) => { 2071 | my_size += 2; 2072 | }, 2073 | }; 2074 | } 2075 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 2076 | self.cached_size.set(my_size); 2077 | my_size 2078 | } 2079 | 2080 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2081 | if self.tableId != 0 { 2082 | os.write_int64(1, self.tableId)?; 2083 | } 2084 | if !self.sql.is_empty() { 2085 | os.write_string(11, &self.sql)?; 2086 | } 2087 | for v in &self.rowDatas { 2088 | os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; 2089 | os.write_raw_varint32(v.get_cached_size())?; 2090 | v.write_to_with_cached_sizes(os)?; 2091 | }; 2092 | for v in &self.props { 2093 | os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?; 2094 | os.write_raw_varint32(v.get_cached_size())?; 2095 | v.write_to_with_cached_sizes(os)?; 2096 | }; 2097 | if !self.ddlSchemaName.is_empty() { 2098 | os.write_string(14, &self.ddlSchemaName)?; 2099 | } 2100 | if let ::std::option::Option::Some(ref v) = self.eventType_present { 2101 | match v { 2102 | &RowChange_oneof_eventType_present::eventType(v) => { 2103 | os.write_enum(2, ::protobuf::ProtobufEnum::value(&v))?; 2104 | }, 2105 | }; 2106 | } 2107 | if let ::std::option::Option::Some(ref v) = self.isDdl_present { 2108 | match v { 2109 | &RowChange_oneof_isDdl_present::isDdl(v) => { 2110 | os.write_bool(10, v)?; 2111 | }, 2112 | }; 2113 | } 2114 | os.write_unknown_fields(self.get_unknown_fields())?; 2115 | ::std::result::Result::Ok(()) 2116 | } 2117 | 2118 | fn get_cached_size(&self) -> u32 { 2119 | self.cached_size.get() 2120 | } 2121 | 2122 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 2123 | &self.unknown_fields 2124 | } 2125 | 2126 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 2127 | &mut self.unknown_fields 2128 | } 2129 | 2130 | fn as_any(&self) -> &dyn (::std::any::Any) { 2131 | self as &dyn (::std::any::Any) 2132 | } 2133 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 2134 | self as &mut dyn (::std::any::Any) 2135 | } 2136 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 2137 | self 2138 | } 2139 | 2140 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 2141 | Self::descriptor_static() 2142 | } 2143 | 2144 | fn new() -> RowChange { 2145 | RowChange::new() 2146 | } 2147 | 2148 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 2149 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 2150 | descriptor.get(|| { 2151 | let mut fields = ::std::vec::Vec::new(); 2152 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 2153 | "tableId", 2154 | |m: &RowChange| { &m.tableId }, 2155 | |m: &mut RowChange| { &mut m.tableId }, 2156 | )); 2157 | fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor::<_, EventType>( 2158 | "eventType", 2159 | RowChange::has_eventType, 2160 | RowChange::get_eventType, 2161 | )); 2162 | fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>( 2163 | "isDdl", 2164 | RowChange::has_isDdl, 2165 | RowChange::get_isDdl, 2166 | )); 2167 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 2168 | "sql", 2169 | |m: &RowChange| { &m.sql }, 2170 | |m: &mut RowChange| { &mut m.sql }, 2171 | )); 2172 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 2173 | "rowDatas", 2174 | |m: &RowChange| { &m.rowDatas }, 2175 | |m: &mut RowChange| { &mut m.rowDatas }, 2176 | )); 2177 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 2178 | "props", 2179 | |m: &RowChange| { &m.props }, 2180 | |m: &mut RowChange| { &mut m.props }, 2181 | )); 2182 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 2183 | "ddlSchemaName", 2184 | |m: &RowChange| { &m.ddlSchemaName }, 2185 | |m: &mut RowChange| { &mut m.ddlSchemaName }, 2186 | )); 2187 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 2188 | "RowChange", 2189 | fields, 2190 | file_descriptor_proto() 2191 | ) 2192 | }) 2193 | } 2194 | 2195 | fn default_instance() -> &'static RowChange { 2196 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 2197 | instance.get(RowChange::new) 2198 | } 2199 | } 2200 | 2201 | impl ::protobuf::Clear for RowChange { 2202 | fn clear(&mut self) { 2203 | self.tableId = 0; 2204 | self.eventType_present = ::std::option::Option::None; 2205 | self.isDdl_present = ::std::option::Option::None; 2206 | self.sql.clear(); 2207 | self.rowDatas.clear(); 2208 | self.props.clear(); 2209 | self.ddlSchemaName.clear(); 2210 | self.unknown_fields.clear(); 2211 | } 2212 | } 2213 | 2214 | impl ::std::fmt::Debug for RowChange { 2215 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2216 | ::protobuf::text_format::fmt(self, f) 2217 | } 2218 | } 2219 | 2220 | impl ::protobuf::reflect::ProtobufValue for RowChange { 2221 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 2222 | ::protobuf::reflect::ReflectValueRef::Message(self) 2223 | } 2224 | } 2225 | 2226 | #[derive(PartialEq,Clone,Default)] 2227 | pub struct TransactionBegin { 2228 | // message fields 2229 | pub executeTime: i64, 2230 | pub transactionId: ::std::string::String, 2231 | pub props: ::protobuf::RepeatedField, 2232 | pub threadId: i64, 2233 | // special fields 2234 | pub unknown_fields: ::protobuf::UnknownFields, 2235 | pub cached_size: ::protobuf::CachedSize, 2236 | } 2237 | 2238 | impl<'a> ::std::default::Default for &'a TransactionBegin { 2239 | fn default() -> &'a TransactionBegin { 2240 | ::default_instance() 2241 | } 2242 | } 2243 | 2244 | impl TransactionBegin { 2245 | pub fn new() -> TransactionBegin { 2246 | ::std::default::Default::default() 2247 | } 2248 | 2249 | // int64 executeTime = 1; 2250 | 2251 | 2252 | pub fn get_executeTime(&self) -> i64 { 2253 | self.executeTime 2254 | } 2255 | pub fn clear_executeTime(&mut self) { 2256 | self.executeTime = 0; 2257 | } 2258 | 2259 | // Param is passed by value, moved 2260 | pub fn set_executeTime(&mut self, v: i64) { 2261 | self.executeTime = v; 2262 | } 2263 | 2264 | // string transactionId = 2; 2265 | 2266 | 2267 | pub fn get_transactionId(&self) -> &str { 2268 | &self.transactionId 2269 | } 2270 | pub fn clear_transactionId(&mut self) { 2271 | self.transactionId.clear(); 2272 | } 2273 | 2274 | // Param is passed by value, moved 2275 | pub fn set_transactionId(&mut self, v: ::std::string::String) { 2276 | self.transactionId = v; 2277 | } 2278 | 2279 | // Mutable pointer to the field. 2280 | // If field is not initialized, it is initialized with default value first. 2281 | pub fn mut_transactionId(&mut self) -> &mut ::std::string::String { 2282 | &mut self.transactionId 2283 | } 2284 | 2285 | // Take field 2286 | pub fn take_transactionId(&mut self) -> ::std::string::String { 2287 | ::std::mem::replace(&mut self.transactionId, ::std::string::String::new()) 2288 | } 2289 | 2290 | // repeated .com.alibaba.otter.canal.protocol.Pair props = 3; 2291 | 2292 | 2293 | pub fn get_props(&self) -> &[Pair] { 2294 | &self.props 2295 | } 2296 | pub fn clear_props(&mut self) { 2297 | self.props.clear(); 2298 | } 2299 | 2300 | // Param is passed by value, moved 2301 | pub fn set_props(&mut self, v: ::protobuf::RepeatedField) { 2302 | self.props = v; 2303 | } 2304 | 2305 | // Mutable pointer to the field. 2306 | pub fn mut_props(&mut self) -> &mut ::protobuf::RepeatedField { 2307 | &mut self.props 2308 | } 2309 | 2310 | // Take field 2311 | pub fn take_props(&mut self) -> ::protobuf::RepeatedField { 2312 | ::std::mem::replace(&mut self.props, ::protobuf::RepeatedField::new()) 2313 | } 2314 | 2315 | // int64 threadId = 4; 2316 | 2317 | 2318 | pub fn get_threadId(&self) -> i64 { 2319 | self.threadId 2320 | } 2321 | pub fn clear_threadId(&mut self) { 2322 | self.threadId = 0; 2323 | } 2324 | 2325 | // Param is passed by value, moved 2326 | pub fn set_threadId(&mut self, v: i64) { 2327 | self.threadId = v; 2328 | } 2329 | } 2330 | 2331 | impl ::protobuf::Message for TransactionBegin { 2332 | fn is_initialized(&self) -> bool { 2333 | for v in &self.props { 2334 | if !v.is_initialized() { 2335 | return false; 2336 | } 2337 | }; 2338 | true 2339 | } 2340 | 2341 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2342 | while !is.eof()? { 2343 | let (field_number, wire_type) = is.read_tag_unpack()?; 2344 | match field_number { 2345 | 1 => { 2346 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 2347 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 2348 | } 2349 | let tmp = is.read_int64()?; 2350 | self.executeTime = tmp; 2351 | }, 2352 | 2 => { 2353 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.transactionId)?; 2354 | }, 2355 | 3 => { 2356 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.props)?; 2357 | }, 2358 | 4 => { 2359 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 2360 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 2361 | } 2362 | let tmp = is.read_int64()?; 2363 | self.threadId = tmp; 2364 | }, 2365 | _ => { 2366 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 2367 | }, 2368 | }; 2369 | } 2370 | ::std::result::Result::Ok(()) 2371 | } 2372 | 2373 | // Compute sizes of nested messages 2374 | #[allow(unused_variables)] 2375 | fn compute_size(&self) -> u32 { 2376 | let mut my_size = 0; 2377 | if self.executeTime != 0 { 2378 | my_size += ::protobuf::rt::value_size(1, self.executeTime, ::protobuf::wire_format::WireTypeVarint); 2379 | } 2380 | if !self.transactionId.is_empty() { 2381 | my_size += ::protobuf::rt::string_size(2, &self.transactionId); 2382 | } 2383 | for value in &self.props { 2384 | let len = value.compute_size(); 2385 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 2386 | }; 2387 | if self.threadId != 0 { 2388 | my_size += ::protobuf::rt::value_size(4, self.threadId, ::protobuf::wire_format::WireTypeVarint); 2389 | } 2390 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 2391 | self.cached_size.set(my_size); 2392 | my_size 2393 | } 2394 | 2395 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2396 | if self.executeTime != 0 { 2397 | os.write_int64(1, self.executeTime)?; 2398 | } 2399 | if !self.transactionId.is_empty() { 2400 | os.write_string(2, &self.transactionId)?; 2401 | } 2402 | for v in &self.props { 2403 | os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; 2404 | os.write_raw_varint32(v.get_cached_size())?; 2405 | v.write_to_with_cached_sizes(os)?; 2406 | }; 2407 | if self.threadId != 0 { 2408 | os.write_int64(4, self.threadId)?; 2409 | } 2410 | os.write_unknown_fields(self.get_unknown_fields())?; 2411 | ::std::result::Result::Ok(()) 2412 | } 2413 | 2414 | fn get_cached_size(&self) -> u32 { 2415 | self.cached_size.get() 2416 | } 2417 | 2418 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 2419 | &self.unknown_fields 2420 | } 2421 | 2422 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 2423 | &mut self.unknown_fields 2424 | } 2425 | 2426 | fn as_any(&self) -> &dyn (::std::any::Any) { 2427 | self as &dyn (::std::any::Any) 2428 | } 2429 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 2430 | self as &mut dyn (::std::any::Any) 2431 | } 2432 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 2433 | self 2434 | } 2435 | 2436 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 2437 | Self::descriptor_static() 2438 | } 2439 | 2440 | fn new() -> TransactionBegin { 2441 | TransactionBegin::new() 2442 | } 2443 | 2444 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 2445 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 2446 | descriptor.get(|| { 2447 | let mut fields = ::std::vec::Vec::new(); 2448 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 2449 | "executeTime", 2450 | |m: &TransactionBegin| { &m.executeTime }, 2451 | |m: &mut TransactionBegin| { &mut m.executeTime }, 2452 | )); 2453 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 2454 | "transactionId", 2455 | |m: &TransactionBegin| { &m.transactionId }, 2456 | |m: &mut TransactionBegin| { &mut m.transactionId }, 2457 | )); 2458 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 2459 | "props", 2460 | |m: &TransactionBegin| { &m.props }, 2461 | |m: &mut TransactionBegin| { &mut m.props }, 2462 | )); 2463 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 2464 | "threadId", 2465 | |m: &TransactionBegin| { &m.threadId }, 2466 | |m: &mut TransactionBegin| { &mut m.threadId }, 2467 | )); 2468 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 2469 | "TransactionBegin", 2470 | fields, 2471 | file_descriptor_proto() 2472 | ) 2473 | }) 2474 | } 2475 | 2476 | fn default_instance() -> &'static TransactionBegin { 2477 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 2478 | instance.get(TransactionBegin::new) 2479 | } 2480 | } 2481 | 2482 | impl ::protobuf::Clear for TransactionBegin { 2483 | fn clear(&mut self) { 2484 | self.executeTime = 0; 2485 | self.transactionId.clear(); 2486 | self.props.clear(); 2487 | self.threadId = 0; 2488 | self.unknown_fields.clear(); 2489 | } 2490 | } 2491 | 2492 | impl ::std::fmt::Debug for TransactionBegin { 2493 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2494 | ::protobuf::text_format::fmt(self, f) 2495 | } 2496 | } 2497 | 2498 | impl ::protobuf::reflect::ProtobufValue for TransactionBegin { 2499 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 2500 | ::protobuf::reflect::ReflectValueRef::Message(self) 2501 | } 2502 | } 2503 | 2504 | #[derive(PartialEq,Clone,Default)] 2505 | pub struct TransactionEnd { 2506 | // message fields 2507 | pub executeTime: i64, 2508 | pub transactionId: ::std::string::String, 2509 | pub props: ::protobuf::RepeatedField, 2510 | // special fields 2511 | pub unknown_fields: ::protobuf::UnknownFields, 2512 | pub cached_size: ::protobuf::CachedSize, 2513 | } 2514 | 2515 | impl<'a> ::std::default::Default for &'a TransactionEnd { 2516 | fn default() -> &'a TransactionEnd { 2517 | ::default_instance() 2518 | } 2519 | } 2520 | 2521 | impl TransactionEnd { 2522 | pub fn new() -> TransactionEnd { 2523 | ::std::default::Default::default() 2524 | } 2525 | 2526 | // int64 executeTime = 1; 2527 | 2528 | 2529 | pub fn get_executeTime(&self) -> i64 { 2530 | self.executeTime 2531 | } 2532 | pub fn clear_executeTime(&mut self) { 2533 | self.executeTime = 0; 2534 | } 2535 | 2536 | // Param is passed by value, moved 2537 | pub fn set_executeTime(&mut self, v: i64) { 2538 | self.executeTime = v; 2539 | } 2540 | 2541 | // string transactionId = 2; 2542 | 2543 | 2544 | pub fn get_transactionId(&self) -> &str { 2545 | &self.transactionId 2546 | } 2547 | pub fn clear_transactionId(&mut self) { 2548 | self.transactionId.clear(); 2549 | } 2550 | 2551 | // Param is passed by value, moved 2552 | pub fn set_transactionId(&mut self, v: ::std::string::String) { 2553 | self.transactionId = v; 2554 | } 2555 | 2556 | // Mutable pointer to the field. 2557 | // If field is not initialized, it is initialized with default value first. 2558 | pub fn mut_transactionId(&mut self) -> &mut ::std::string::String { 2559 | &mut self.transactionId 2560 | } 2561 | 2562 | // Take field 2563 | pub fn take_transactionId(&mut self) -> ::std::string::String { 2564 | ::std::mem::replace(&mut self.transactionId, ::std::string::String::new()) 2565 | } 2566 | 2567 | // repeated .com.alibaba.otter.canal.protocol.Pair props = 3; 2568 | 2569 | 2570 | pub fn get_props(&self) -> &[Pair] { 2571 | &self.props 2572 | } 2573 | pub fn clear_props(&mut self) { 2574 | self.props.clear(); 2575 | } 2576 | 2577 | // Param is passed by value, moved 2578 | pub fn set_props(&mut self, v: ::protobuf::RepeatedField) { 2579 | self.props = v; 2580 | } 2581 | 2582 | // Mutable pointer to the field. 2583 | pub fn mut_props(&mut self) -> &mut ::protobuf::RepeatedField { 2584 | &mut self.props 2585 | } 2586 | 2587 | // Take field 2588 | pub fn take_props(&mut self) -> ::protobuf::RepeatedField { 2589 | ::std::mem::replace(&mut self.props, ::protobuf::RepeatedField::new()) 2590 | } 2591 | } 2592 | 2593 | impl ::protobuf::Message for TransactionEnd { 2594 | fn is_initialized(&self) -> bool { 2595 | for v in &self.props { 2596 | if !v.is_initialized() { 2597 | return false; 2598 | } 2599 | }; 2600 | true 2601 | } 2602 | 2603 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2604 | while !is.eof()? { 2605 | let (field_number, wire_type) = is.read_tag_unpack()?; 2606 | match field_number { 2607 | 1 => { 2608 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 2609 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 2610 | } 2611 | let tmp = is.read_int64()?; 2612 | self.executeTime = tmp; 2613 | }, 2614 | 2 => { 2615 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.transactionId)?; 2616 | }, 2617 | 3 => { 2618 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.props)?; 2619 | }, 2620 | _ => { 2621 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 2622 | }, 2623 | }; 2624 | } 2625 | ::std::result::Result::Ok(()) 2626 | } 2627 | 2628 | // Compute sizes of nested messages 2629 | #[allow(unused_variables)] 2630 | fn compute_size(&self) -> u32 { 2631 | let mut my_size = 0; 2632 | if self.executeTime != 0 { 2633 | my_size += ::protobuf::rt::value_size(1, self.executeTime, ::protobuf::wire_format::WireTypeVarint); 2634 | } 2635 | if !self.transactionId.is_empty() { 2636 | my_size += ::protobuf::rt::string_size(2, &self.transactionId); 2637 | } 2638 | for value in &self.props { 2639 | let len = value.compute_size(); 2640 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 2641 | }; 2642 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 2643 | self.cached_size.set(my_size); 2644 | my_size 2645 | } 2646 | 2647 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2648 | if self.executeTime != 0 { 2649 | os.write_int64(1, self.executeTime)?; 2650 | } 2651 | if !self.transactionId.is_empty() { 2652 | os.write_string(2, &self.transactionId)?; 2653 | } 2654 | for v in &self.props { 2655 | os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; 2656 | os.write_raw_varint32(v.get_cached_size())?; 2657 | v.write_to_with_cached_sizes(os)?; 2658 | }; 2659 | os.write_unknown_fields(self.get_unknown_fields())?; 2660 | ::std::result::Result::Ok(()) 2661 | } 2662 | 2663 | fn get_cached_size(&self) -> u32 { 2664 | self.cached_size.get() 2665 | } 2666 | 2667 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 2668 | &self.unknown_fields 2669 | } 2670 | 2671 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 2672 | &mut self.unknown_fields 2673 | } 2674 | 2675 | fn as_any(&self) -> &dyn (::std::any::Any) { 2676 | self as &dyn (::std::any::Any) 2677 | } 2678 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 2679 | self as &mut dyn (::std::any::Any) 2680 | } 2681 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 2682 | self 2683 | } 2684 | 2685 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 2686 | Self::descriptor_static() 2687 | } 2688 | 2689 | fn new() -> TransactionEnd { 2690 | TransactionEnd::new() 2691 | } 2692 | 2693 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 2694 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 2695 | descriptor.get(|| { 2696 | let mut fields = ::std::vec::Vec::new(); 2697 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( 2698 | "executeTime", 2699 | |m: &TransactionEnd| { &m.executeTime }, 2700 | |m: &mut TransactionEnd| { &mut m.executeTime }, 2701 | )); 2702 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 2703 | "transactionId", 2704 | |m: &TransactionEnd| { &m.transactionId }, 2705 | |m: &mut TransactionEnd| { &mut m.transactionId }, 2706 | )); 2707 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 2708 | "props", 2709 | |m: &TransactionEnd| { &m.props }, 2710 | |m: &mut TransactionEnd| { &mut m.props }, 2711 | )); 2712 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 2713 | "TransactionEnd", 2714 | fields, 2715 | file_descriptor_proto() 2716 | ) 2717 | }) 2718 | } 2719 | 2720 | fn default_instance() -> &'static TransactionEnd { 2721 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 2722 | instance.get(TransactionEnd::new) 2723 | } 2724 | } 2725 | 2726 | impl ::protobuf::Clear for TransactionEnd { 2727 | fn clear(&mut self) { 2728 | self.executeTime = 0; 2729 | self.transactionId.clear(); 2730 | self.props.clear(); 2731 | self.unknown_fields.clear(); 2732 | } 2733 | } 2734 | 2735 | impl ::std::fmt::Debug for TransactionEnd { 2736 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2737 | ::protobuf::text_format::fmt(self, f) 2738 | } 2739 | } 2740 | 2741 | impl ::protobuf::reflect::ProtobufValue for TransactionEnd { 2742 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 2743 | ::protobuf::reflect::ReflectValueRef::Message(self) 2744 | } 2745 | } 2746 | 2747 | #[derive(PartialEq,Clone,Default)] 2748 | pub struct Pair { 2749 | // message fields 2750 | pub key: ::std::string::String, 2751 | pub value: ::std::string::String, 2752 | // special fields 2753 | pub unknown_fields: ::protobuf::UnknownFields, 2754 | pub cached_size: ::protobuf::CachedSize, 2755 | } 2756 | 2757 | impl<'a> ::std::default::Default for &'a Pair { 2758 | fn default() -> &'a Pair { 2759 | ::default_instance() 2760 | } 2761 | } 2762 | 2763 | impl Pair { 2764 | pub fn new() -> Pair { 2765 | ::std::default::Default::default() 2766 | } 2767 | 2768 | // string key = 1; 2769 | 2770 | 2771 | pub fn get_key(&self) -> &str { 2772 | &self.key 2773 | } 2774 | pub fn clear_key(&mut self) { 2775 | self.key.clear(); 2776 | } 2777 | 2778 | // Param is passed by value, moved 2779 | pub fn set_key(&mut self, v: ::std::string::String) { 2780 | self.key = v; 2781 | } 2782 | 2783 | // Mutable pointer to the field. 2784 | // If field is not initialized, it is initialized with default value first. 2785 | pub fn mut_key(&mut self) -> &mut ::std::string::String { 2786 | &mut self.key 2787 | } 2788 | 2789 | // Take field 2790 | pub fn take_key(&mut self) -> ::std::string::String { 2791 | ::std::mem::replace(&mut self.key, ::std::string::String::new()) 2792 | } 2793 | 2794 | // string value = 2; 2795 | 2796 | 2797 | pub fn get_value(&self) -> &str { 2798 | &self.value 2799 | } 2800 | pub fn clear_value(&mut self) { 2801 | self.value.clear(); 2802 | } 2803 | 2804 | // Param is passed by value, moved 2805 | pub fn set_value(&mut self, v: ::std::string::String) { 2806 | self.value = v; 2807 | } 2808 | 2809 | // Mutable pointer to the field. 2810 | // If field is not initialized, it is initialized with default value first. 2811 | pub fn mut_value(&mut self) -> &mut ::std::string::String { 2812 | &mut self.value 2813 | } 2814 | 2815 | // Take field 2816 | pub fn take_value(&mut self) -> ::std::string::String { 2817 | ::std::mem::replace(&mut self.value, ::std::string::String::new()) 2818 | } 2819 | } 2820 | 2821 | impl ::protobuf::Message for Pair { 2822 | fn is_initialized(&self) -> bool { 2823 | true 2824 | } 2825 | 2826 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2827 | while !is.eof()? { 2828 | let (field_number, wire_type) = is.read_tag_unpack()?; 2829 | match field_number { 2830 | 1 => { 2831 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.key)?; 2832 | }, 2833 | 2 => { 2834 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?; 2835 | }, 2836 | _ => { 2837 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 2838 | }, 2839 | }; 2840 | } 2841 | ::std::result::Result::Ok(()) 2842 | } 2843 | 2844 | // Compute sizes of nested messages 2845 | #[allow(unused_variables)] 2846 | fn compute_size(&self) -> u32 { 2847 | let mut my_size = 0; 2848 | if !self.key.is_empty() { 2849 | my_size += ::protobuf::rt::string_size(1, &self.key); 2850 | } 2851 | if !self.value.is_empty() { 2852 | my_size += ::protobuf::rt::string_size(2, &self.value); 2853 | } 2854 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 2855 | self.cached_size.set(my_size); 2856 | my_size 2857 | } 2858 | 2859 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 2860 | if !self.key.is_empty() { 2861 | os.write_string(1, &self.key)?; 2862 | } 2863 | if !self.value.is_empty() { 2864 | os.write_string(2, &self.value)?; 2865 | } 2866 | os.write_unknown_fields(self.get_unknown_fields())?; 2867 | ::std::result::Result::Ok(()) 2868 | } 2869 | 2870 | fn get_cached_size(&self) -> u32 { 2871 | self.cached_size.get() 2872 | } 2873 | 2874 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 2875 | &self.unknown_fields 2876 | } 2877 | 2878 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 2879 | &mut self.unknown_fields 2880 | } 2881 | 2882 | fn as_any(&self) -> &dyn (::std::any::Any) { 2883 | self as &dyn (::std::any::Any) 2884 | } 2885 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 2886 | self as &mut dyn (::std::any::Any) 2887 | } 2888 | fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { 2889 | self 2890 | } 2891 | 2892 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 2893 | Self::descriptor_static() 2894 | } 2895 | 2896 | fn new() -> Pair { 2897 | Pair::new() 2898 | } 2899 | 2900 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 2901 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; 2902 | descriptor.get(|| { 2903 | let mut fields = ::std::vec::Vec::new(); 2904 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 2905 | "key", 2906 | |m: &Pair| { &m.key }, 2907 | |m: &mut Pair| { &mut m.key }, 2908 | )); 2909 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 2910 | "value", 2911 | |m: &Pair| { &m.value }, 2912 | |m: &mut Pair| { &mut m.value }, 2913 | )); 2914 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 2915 | "Pair", 2916 | fields, 2917 | file_descriptor_proto() 2918 | ) 2919 | }) 2920 | } 2921 | 2922 | fn default_instance() -> &'static Pair { 2923 | static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; 2924 | instance.get(Pair::new) 2925 | } 2926 | } 2927 | 2928 | impl ::protobuf::Clear for Pair { 2929 | fn clear(&mut self) { 2930 | self.key.clear(); 2931 | self.value.clear(); 2932 | self.unknown_fields.clear(); 2933 | } 2934 | } 2935 | 2936 | impl ::std::fmt::Debug for Pair { 2937 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2938 | ::protobuf::text_format::fmt(self, f) 2939 | } 2940 | } 2941 | 2942 | impl ::protobuf::reflect::ProtobufValue for Pair { 2943 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 2944 | ::protobuf::reflect::ReflectValueRef::Message(self) 2945 | } 2946 | } 2947 | 2948 | #[derive(Clone,PartialEq,Eq,Debug,Hash)] 2949 | pub enum EntryType { 2950 | ENTRYTYPECOMPATIBLEPROTO2 = 0, 2951 | TRANSACTIONBEGIN = 1, 2952 | ROWDATA = 2, 2953 | TRANSACTIONEND = 3, 2954 | HEARTBEAT = 4, 2955 | GTIDLOG = 5, 2956 | } 2957 | 2958 | impl ::protobuf::ProtobufEnum for EntryType { 2959 | fn value(&self) -> i32 { 2960 | *self as i32 2961 | } 2962 | 2963 | fn from_i32(value: i32) -> ::std::option::Option { 2964 | match value { 2965 | 0 => ::std::option::Option::Some(EntryType::ENTRYTYPECOMPATIBLEPROTO2), 2966 | 1 => ::std::option::Option::Some(EntryType::TRANSACTIONBEGIN), 2967 | 2 => ::std::option::Option::Some(EntryType::ROWDATA), 2968 | 3 => ::std::option::Option::Some(EntryType::TRANSACTIONEND), 2969 | 4 => ::std::option::Option::Some(EntryType::HEARTBEAT), 2970 | 5 => ::std::option::Option::Some(EntryType::GTIDLOG), 2971 | _ => ::std::option::Option::None 2972 | } 2973 | } 2974 | 2975 | fn values() -> &'static [Self] { 2976 | static values: &'static [EntryType] = &[ 2977 | EntryType::ENTRYTYPECOMPATIBLEPROTO2, 2978 | EntryType::TRANSACTIONBEGIN, 2979 | EntryType::ROWDATA, 2980 | EntryType::TRANSACTIONEND, 2981 | EntryType::HEARTBEAT, 2982 | EntryType::GTIDLOG, 2983 | ]; 2984 | values 2985 | } 2986 | 2987 | fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { 2988 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; 2989 | descriptor.get(|| { 2990 | ::protobuf::reflect::EnumDescriptor::new_pb_name::("EntryType", file_descriptor_proto()) 2991 | }) 2992 | } 2993 | } 2994 | 2995 | impl ::std::marker::Copy for EntryType { 2996 | } 2997 | 2998 | impl ::std::default::Default for EntryType { 2999 | fn default() -> Self { 3000 | EntryType::ENTRYTYPECOMPATIBLEPROTO2 3001 | } 3002 | } 3003 | 3004 | impl ::protobuf::reflect::ProtobufValue for EntryType { 3005 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 3006 | ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) 3007 | } 3008 | } 3009 | 3010 | #[derive(Clone,PartialEq,Eq,Debug,Hash)] 3011 | pub enum EventType { 3012 | EVENTTYPECOMPATIBLEPROTO2 = 0, 3013 | INSERT = 1, 3014 | UPDATE = 2, 3015 | DELETE = 3, 3016 | CREATE = 4, 3017 | ALTER = 5, 3018 | ERASE = 6, 3019 | QUERY = 7, 3020 | TRUNCATE = 8, 3021 | RENAME = 9, 3022 | CINDEX = 10, 3023 | DINDEX = 11, 3024 | GTID = 12, 3025 | XACOMMIT = 13, 3026 | XAROLLBACK = 14, 3027 | MHEARTBEAT = 15, 3028 | } 3029 | 3030 | impl ::protobuf::ProtobufEnum for EventType { 3031 | fn value(&self) -> i32 { 3032 | *self as i32 3033 | } 3034 | 3035 | fn from_i32(value: i32) -> ::std::option::Option { 3036 | match value { 3037 | 0 => ::std::option::Option::Some(EventType::EVENTTYPECOMPATIBLEPROTO2), 3038 | 1 => ::std::option::Option::Some(EventType::INSERT), 3039 | 2 => ::std::option::Option::Some(EventType::UPDATE), 3040 | 3 => ::std::option::Option::Some(EventType::DELETE), 3041 | 4 => ::std::option::Option::Some(EventType::CREATE), 3042 | 5 => ::std::option::Option::Some(EventType::ALTER), 3043 | 6 => ::std::option::Option::Some(EventType::ERASE), 3044 | 7 => ::std::option::Option::Some(EventType::QUERY), 3045 | 8 => ::std::option::Option::Some(EventType::TRUNCATE), 3046 | 9 => ::std::option::Option::Some(EventType::RENAME), 3047 | 10 => ::std::option::Option::Some(EventType::CINDEX), 3048 | 11 => ::std::option::Option::Some(EventType::DINDEX), 3049 | 12 => ::std::option::Option::Some(EventType::GTID), 3050 | 13 => ::std::option::Option::Some(EventType::XACOMMIT), 3051 | 14 => ::std::option::Option::Some(EventType::XAROLLBACK), 3052 | 15 => ::std::option::Option::Some(EventType::MHEARTBEAT), 3053 | _ => ::std::option::Option::None 3054 | } 3055 | } 3056 | 3057 | fn values() -> &'static [Self] { 3058 | static values: &'static [EventType] = &[ 3059 | EventType::EVENTTYPECOMPATIBLEPROTO2, 3060 | EventType::INSERT, 3061 | EventType::UPDATE, 3062 | EventType::DELETE, 3063 | EventType::CREATE, 3064 | EventType::ALTER, 3065 | EventType::ERASE, 3066 | EventType::QUERY, 3067 | EventType::TRUNCATE, 3068 | EventType::RENAME, 3069 | EventType::CINDEX, 3070 | EventType::DINDEX, 3071 | EventType::GTID, 3072 | EventType::XACOMMIT, 3073 | EventType::XAROLLBACK, 3074 | EventType::MHEARTBEAT, 3075 | ]; 3076 | values 3077 | } 3078 | 3079 | fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { 3080 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; 3081 | descriptor.get(|| { 3082 | ::protobuf::reflect::EnumDescriptor::new_pb_name::("EventType", file_descriptor_proto()) 3083 | }) 3084 | } 3085 | } 3086 | 3087 | impl ::std::marker::Copy for EventType { 3088 | } 3089 | 3090 | impl ::std::default::Default for EventType { 3091 | fn default() -> Self { 3092 | EventType::EVENTTYPECOMPATIBLEPROTO2 3093 | } 3094 | } 3095 | 3096 | impl ::protobuf::reflect::ProtobufValue for EventType { 3097 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 3098 | ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) 3099 | } 3100 | } 3101 | 3102 | #[derive(Clone,PartialEq,Eq,Debug,Hash)] 3103 | pub enum Type { 3104 | TYPECOMPATIBLEPROTO2 = 0, 3105 | ORACLE = 1, 3106 | MYSQL = 2, 3107 | PGSQL = 3, 3108 | } 3109 | 3110 | impl ::protobuf::ProtobufEnum for Type { 3111 | fn value(&self) -> i32 { 3112 | *self as i32 3113 | } 3114 | 3115 | fn from_i32(value: i32) -> ::std::option::Option { 3116 | match value { 3117 | 0 => ::std::option::Option::Some(Type::TYPECOMPATIBLEPROTO2), 3118 | 1 => ::std::option::Option::Some(Type::ORACLE), 3119 | 2 => ::std::option::Option::Some(Type::MYSQL), 3120 | 3 => ::std::option::Option::Some(Type::PGSQL), 3121 | _ => ::std::option::Option::None 3122 | } 3123 | } 3124 | 3125 | fn values() -> &'static [Self] { 3126 | static values: &'static [Type] = &[ 3127 | Type::TYPECOMPATIBLEPROTO2, 3128 | Type::ORACLE, 3129 | Type::MYSQL, 3130 | Type::PGSQL, 3131 | ]; 3132 | values 3133 | } 3134 | 3135 | fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { 3136 | static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; 3137 | descriptor.get(|| { 3138 | ::protobuf::reflect::EnumDescriptor::new_pb_name::("Type", file_descriptor_proto()) 3139 | }) 3140 | } 3141 | } 3142 | 3143 | impl ::std::marker::Copy for Type { 3144 | } 3145 | 3146 | impl ::std::default::Default for Type { 3147 | fn default() -> Self { 3148 | Type::TYPECOMPATIBLEPROTO2 3149 | } 3150 | } 3151 | 3152 | impl ::protobuf::reflect::ProtobufValue for Type { 3153 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 3154 | ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) 3155 | } 3156 | } 3157 | 3158 | static file_descriptor_proto_data: &'static [u8] = b"\ 3159 | \n\x13EntryProtocol.proto\x12\x20com.alibaba.otter.canal.protocol\"\xcb\ 3160 | \x01\n\x05Entry\x12@\n\x06header\x18\x01\x20\x01(\x0b2(.com.alibaba.otte\ 3161 | r.canal.protocol.HeaderR\x06header\x12K\n\tentryType\x18\x02\x20\x01(\ 3162 | \x0e2+.com.alibaba.otter.canal.protocol.EntryTypeH\0R\tentryType\x12\x1e\ 3163 | \n\nstoreValue\x18\x03\x20\x01(\x0cR\nstoreValueB\x13\n\x11entryType_pre\ 3164 | sent\"\xd5\x04\n\x06Header\x12\x1a\n\x07version\x18\x01\x20\x01(\x05H\0R\ 3165 | \x07version\x12\x20\n\x0blogfileName\x18\x02\x20\x01(\tR\x0blogfileName\ 3166 | \x12$\n\rlogfileOffset\x18\x03\x20\x01(\x03R\rlogfileOffset\x12\x1a\n\ 3167 | \x08serverId\x18\x04\x20\x01(\x03R\x08serverId\x12\"\n\x0cserverenCode\ 3168 | \x18\x05\x20\x01(\tR\x0cserverenCode\x12\x20\n\x0bexecuteTime\x18\x06\ 3169 | \x20\x01(\x03R\x0bexecuteTime\x12H\n\nsourceType\x18\x07\x20\x01(\x0e2&.\ 3170 | com.alibaba.otter.canal.protocol.TypeH\x01R\nsourceType\x12\x1e\n\nschem\ 3171 | aName\x18\x08\x20\x01(\tR\nschemaName\x12\x1c\n\ttableName\x18\t\x20\x01\ 3172 | (\tR\ttableName\x12\x20\n\x0beventLength\x18\n\x20\x01(\x03R\x0beventLen\ 3173 | gth\x12K\n\teventType\x18\x0b\x20\x01(\x0e2+.com.alibaba.otter.canal.pro\ 3174 | tocol.EventTypeH\x02R\teventType\x12<\n\x05props\x18\x0c\x20\x03(\x0b2&.\ 3175 | com.alibaba.otter.canal.protocol.PairR\x05props\x12\x12\n\x04gtid\x18\r\ 3176 | \x20\x01(\tR\x04gtidB\x11\n\x0fversion_presentB\x14\n\x12sourceType_pres\ 3177 | entB\x13\n\x11eventType_present\"\xb2\x02\n\x06Column\x12\x14\n\x05index\ 3178 | \x18\x01\x20\x01(\x05R\x05index\x12\x18\n\x07sqlType\x18\x02\x20\x01(\ 3179 | \x05R\x07sqlType\x12\x12\n\x04name\x18\x03\x20\x01(\tR\x04name\x12\x14\n\ 3180 | \x05isKey\x18\x04\x20\x01(\x08R\x05isKey\x12\x18\n\x07updated\x18\x05\ 3181 | \x20\x01(\x08R\x07updated\x12\x18\n\x06isNull\x18\x06\x20\x01(\x08H\0R\ 3182 | \x06isNull\x12<\n\x05props\x18\x07\x20\x03(\x0b2&.com.alibaba.otter.cana\ 3183 | l.protocol.PairR\x05props\x12\x14\n\x05value\x18\x08\x20\x01(\tR\x05valu\ 3184 | e\x12\x16\n\x06length\x18\t\x20\x01(\x05R\x06length\x12\x1c\n\tmysqlType\ 3185 | \x18\n\x20\x01(\tR\tmysqlTypeB\x10\n\x0eisNull_present\"\xe5\x01\n\x07Ro\ 3186 | wData\x12N\n\rbeforeColumns\x18\x01\x20\x03(\x0b2(.com.alibaba.otter.can\ 3187 | al.protocol.ColumnR\rbeforeColumns\x12L\n\x0cafterColumns\x18\x02\x20\ 3188 | \x03(\x0b2(.com.alibaba.otter.canal.protocol.ColumnR\x0cafterColumns\x12\ 3189 | <\n\x05props\x18\x03\x20\x03(\x0b2&.com.alibaba.otter.canal.protocol.Pai\ 3190 | rR\x05props\"\xed\x02\n\tRowChange\x12\x18\n\x07tableId\x18\x01\x20\x01(\ 3191 | \x03R\x07tableId\x12K\n\teventType\x18\x02\x20\x01(\x0e2+.com.alibaba.ot\ 3192 | ter.canal.protocol.EventTypeH\0R\teventType\x12\x16\n\x05isDdl\x18\n\x20\ 3193 | \x01(\x08H\x01R\x05isDdl\x12\x10\n\x03sql\x18\x0b\x20\x01(\tR\x03sql\x12\ 3194 | E\n\x08rowDatas\x18\x0c\x20\x03(\x0b2).com.alibaba.otter.canal.protocol.\ 3195 | RowDataR\x08rowDatas\x12<\n\x05props\x18\r\x20\x03(\x0b2&.com.alibaba.ot\ 3196 | ter.canal.protocol.PairR\x05props\x12$\n\rddlSchemaName\x18\x0e\x20\x01(\ 3197 | \tR\rddlSchemaNameB\x13\n\x11eventType_presentB\x0f\n\risDdl_present\"\ 3198 | \xb4\x01\n\x10TransactionBegin\x12\x20\n\x0bexecuteTime\x18\x01\x20\x01(\ 3199 | \x03R\x0bexecuteTime\x12$\n\rtransactionId\x18\x02\x20\x01(\tR\rtransact\ 3200 | ionId\x12<\n\x05props\x18\x03\x20\x03(\x0b2&.com.alibaba.otter.canal.pro\ 3201 | tocol.PairR\x05props\x12\x1a\n\x08threadId\x18\x04\x20\x01(\x03R\x08thre\ 3202 | adId\"\x96\x01\n\x0eTransactionEnd\x12\x20\n\x0bexecuteTime\x18\x01\x20\ 3203 | \x01(\x03R\x0bexecuteTime\x12$\n\rtransactionId\x18\x02\x20\x01(\tR\rtra\ 3204 | nsactionId\x12<\n\x05props\x18\x03\x20\x03(\x0b2&.com.alibaba.otter.cana\ 3205 | l.protocol.PairR\x05props\".\n\x04Pair\x12\x10\n\x03key\x18\x01\x20\x01(\ 3206 | \tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value*}\n\tEntryTyp\ 3207 | e\x12\x1d\n\x19ENTRYTYPECOMPATIBLEPROTO2\x10\0\x12\x14\n\x10TRANSACTIONB\ 3208 | EGIN\x10\x01\x12\x0b\n\x07ROWDATA\x10\x02\x12\x12\n\x0eTRANSACTIONEND\ 3209 | \x10\x03\x12\r\n\tHEARTBEAT\x10\x04\x12\x0b\n\x07GTIDLOG\x10\x05*\xe5\ 3210 | \x01\n\tEventType\x12\x1d\n\x19EVENTTYPECOMPATIBLEPROTO2\x10\0\x12\n\n\ 3211 | \x06INSERT\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06DELETE\x10\x03\ 3212 | \x12\n\n\x06CREATE\x10\x04\x12\t\n\x05ALTER\x10\x05\x12\t\n\x05ERASE\x10\ 3213 | \x06\x12\t\n\x05QUERY\x10\x07\x12\x0c\n\x08TRUNCATE\x10\x08\x12\n\n\x06R\ 3214 | ENAME\x10\t\x12\n\n\x06CINDEX\x10\n\x12\n\n\x06DINDEX\x10\x0b\x12\x08\n\ 3215 | \x04GTID\x10\x0c\x12\x0c\n\x08XACOMMIT\x10\r\x12\x0e\n\nXAROLLBACK\x10\ 3216 | \x0e\x12\x0e\n\nMHEARTBEAT\x10\x0f*B\n\x04Type\x12\x18\n\x14TYPECOMPATIB\ 3217 | LEPROTO2\x10\0\x12\n\n\x06ORACLE\x10\x01\x12\t\n\x05MYSQL\x10\x02\x12\t\ 3218 | \n\x05PGSQL\x10\x03B0\n\x20com.alibaba.otter.canal.protocolB\nCanalEntry\ 3219 | H\x01J\xfc2\n\x07\x12\x05\0\0\xe5\x01\x01\n\x08\n\x01\x0c\x12\x03\0\0\ 3220 | \x12\n\x08\n\x01\x02\x12\x03\x01\0)\n\x08\n\x01\x08\x12\x03\x03\09\n\t\n\ 3221 | \x02\x08\x01\x12\x03\x03\09\n\x08\n\x01\x08\x12\x03\x04\0+\n\t\n\x02\x08\ 3222 | \x08\x12\x03\x04\0+\n\x08\n\x01\x08\x12\x03\x05\0\x1c\n\t\n\x02\x08\t\ 3223 | \x12\x03\x05\0\x1c\n\xe5\x01\n\x02\x04\0\x12\x04\x0b\0\x15\x01\x1a\xd8\ 3224 | \x01***************************************************************\n\ 3225 | \x20message\x20model\n\xe5\xa6\x82\xe6\x9e\x9c\xe8\xa6\x81\xe5\x9c\xa8En\ 3226 | um\xe4\xb8\xad\xe6\x96\xb0\xe5\xa2\x9e\xe7\xb1\xbb\xe5\x9e\x8b\xef\xbc\ 3227 | \x8c\xe7\xa1\xae\xe4\xbf\x9d\xe4\xbb\xa5\xe5\x89\x8d\xe7\x9a\x84\xe7\xb1\ 3228 | \xbb\xe5\x9e\x8b\xe7\x9a\x84\xe4\xb8\x8b\xe6\xa0\x87\xe5\x80\xbc\xe4\xb8\ 3229 | \x8d\xe5\x8f\x98.\n*****************************************************\ 3230 | *********\n\n\n\x03\x04\0\x01\x12\x03\x0b\x08\r\n!\n\x04\x04\0\x02\0\x12\ 3231 | \x03\r\x05\\\x1a\x14*\xe5\x8d\x8f\xe8\xae\xae\xe5\xa4\xb4\xe9\x83\xa8\ 3232 | \xe4\xbf\xa1\xe6\x81\xaf*\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\r\x05\x0b\ 3233 | \n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\r8>\n\x0c\n\x05\x04\0\x02\0\x03\x12\ 3234 | \x03\rZ[\nA\n\x04\x04\0\x08\0\x12\x04\x0f\x08\x11\t\x1a3/**\xe6\x89\x93\ 3235 | \xe6\x95\xa3\xe5\x90\x8e\xe7\x9a\x84\xe4\xba\x8b\xe4\xbb\xb6\xe7\xb1\xbb\ 3236 | \xe5\x9e\x8b**/\x20[default\x20=\x20ROWDATA]\n\n\x0c\n\x05\x04\0\x08\0\ 3237 | \x01\x12\x03\x0f\x0e\x1f\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x10\x10d\n\ 3238 | \x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x10\x10\x19\n\x0c\n\x05\x04\0\x02\ 3239 | \x01\x01\x12\x03\x10@I\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x10bc\n'\n\ 3240 | \x04\x04\0\x02\x02\x12\x03\x14\x08\\\x1a\x1a*\xe4\xbc\xa0\xe8\xbe\x93\ 3241 | \xe7\x9a\x84\xe4\xba\x8c\xe8\xbf\x9b\xe5\x88\xb6\xe6\x95\xb0\xe7\xbb\x84\ 3242 | *\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x14\x08\r\n\x0c\n\x05\x04\0\x02\ 3243 | \x02\x01\x12\x03\x148B\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x14Z[\n2\n\ 3244 | \x02\x04\x01\x12\x04\x18\0H\x01\x1a\x10*message\x20Header*\"\x14*\xe5\ 3245 | \x8d\x8f\xe8\xae\xae\xe7\x9a\x84\xe7\x89\x88\xe6\x9c\xac\xe5\x8f\xb7*\n\ 3246 | \n\n\x03\x04\x01\x01\x12\x03\x18\x08\x0e\n\x1c\n\x04\x04\x01\x08\0\x12\ 3247 | \x04\x1a\x08\x1c\t\x1a\x0e[default\x20=\x201]\n\n\x0c\n\x05\x04\x01\x08\ 3248 | \0\x01\x12\x03\x1a\x0e\x1d\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x1b\x10\\\n\ 3249 | \x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x1b\x10\x15\n\x0c\n\x05\x04\x01\x02\ 3250 | \0\x01\x12\x03\x1b8?\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x1bZ[\n'\n\ 3251 | \x04\x04\x01\x02\x01\x12\x03\x20\x08T\x1a\x1a*binlog/redolog\x20\xe6\x96\ 3252 | \x87\xe4\xbb\xb6\xe5\x90\x8d*\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\ 3253 | \x20\x08\x0e\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x200;\n\x0c\n\x05\ 3254 | \x04\x01\x02\x01\x03\x12\x03\x20RS\n3\n\x04\x04\x01\x02\x02\x12\x03#\x08\ 3255 | L\x1a&*binlog/redolog\x20\xe6\x96\x87\xe4\xbb\xb6\xe7\x9a\x84\xe5\x81\ 3256 | \x8f\xe7\xa7\xbb\xe4\xbd\x8d\xe7\xbd\xae*\n\x0c\n\x05\x04\x01\x02\x02\ 3257 | \x05\x12\x03#\x08\r\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03#0=\n\x0c\n\ 3258 | \x05\x04\x01\x02\x02\x03\x12\x03#JK\n\x20\n\x04\x04\x01\x02\x03\x12\x03&\ 3259 | \x08D\x1a\x13*\xe6\x9c\x8d\xe5\x8a\xa1\xe7\xab\xafserverId*\n\x0c\n\x05\ 3260 | \x04\x01\x02\x03\x05\x12\x03&\x08\r\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\ 3261 | \x03&(0\n\x0c\n\x05\x04\x01\x02\x03\x03\x12\x03&BC\n&\n\x04\x04\x01\x02\ 3262 | \x04\x12\x03)\x08L\x1a\x19*\x20\xe5\x8f\x98\xe6\x9b\xb4\xe6\x95\xb0\xe6\ 3263 | \x8d\xae\xe7\x9a\x84\xe7\xbc\x96\xe7\xa0\x81\x20*\n\x0c\n\x05\x04\x01\ 3264 | \x02\x04\x05\x12\x03)\x08\x0e\n\x0c\n\x05\x04\x01\x02\x04\x01\x12\x03)0<\ 3265 | \n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03)JK\n+\n\x04\x04\x01\x02\x05\x12\ 3266 | \x03,\x08T\x1a\x1e*\xe5\x8f\x98\xe6\x9b\xb4\xe6\x95\xb0\xe6\x8d\xae\xe7\ 3267 | \x9a\x84\xe6\x89\xa7\xe8\xa1\x8c\xe6\x97\xb6\xe9\x97\xb4\x20*\n\x0c\n\ 3268 | \x05\x04\x01\x02\x05\x05\x12\x03,\x08\r\n\x0c\n\x05\x04\x01\x02\x05\x01\ 3269 | \x12\x03,0;\n\x0c\n\x05\x04\x01\x02\x05\x03\x12\x03,RS\n:\n\x04\x04\x01\ 3270 | \x08\x01\x12\x04/\x081\t\x1a\x12[default\x20=\x20MYSQL]\n2\x18*\x20\xe5\ 3271 | \x8f\x98\xe6\x9b\xb4\xe6\x95\xb0\xe6\x8d\xae\xe7\x9a\x84\xe6\x9d\xa5\xe6\ 3272 | \xba\x90*\n\x0c\n\x05\x04\x01\x08\x01\x01\x12\x03/\x0e\x20\n\x0b\n\x04\ 3273 | \x04\x01\x02\x06\x12\x030\x10\\\n\x0c\n\x05\x04\x01\x02\x06\x06\x12\x030\ 3274 | \x10\x14\n\x0c\n\x05\x04\x01\x02\x06\x01\x12\x0308B\n\x0c\n\x05\x04\x01\ 3275 | \x02\x06\x03\x12\x030Z[\n)\n\x04\x04\x01\x02\x07\x12\x035\x08T\x1a\x1c*\ 3276 | \x20\xe5\x8f\x98\xe6\x9b\xb4\xe6\x95\xb0\xe6\x8d\xae\xe7\x9a\x84schemana\ 3277 | me*\n\x0c\n\x05\x04\x01\x02\x07\x05\x12\x035\x08\x0e\n\x0c\n\x05\x04\x01\ 3278 | \x02\x07\x01\x12\x0350:\n\x0c\n\x05\x04\x01\x02\x07\x03\x12\x035RS\n'\n\ 3279 | \x04\x04\x01\x02\x08\x12\x038\x08T\x1a\x1a*\xe5\x8f\x98\xe6\x9b\xb4\xe6\ 3280 | \x95\xb0\xe6\x8d\xae\xe7\x9a\x84tablename*\n\x0c\n\x05\x04\x01\x02\x08\ 3281 | \x05\x12\x038\x08\x0e\n\x0c\n\x05\x04\x01\x02\x08\x01\x12\x03809\n\x0c\n\ 3282 | \x05\x04\x01\x02\x08\x03\x12\x038RS\n#\n\x04\x04\x01\x02\t\x12\x03;\x08I\ 3283 | \x1a\x16*\xe6\xaf\x8f\xe4\xb8\xaaevent\xe7\x9a\x84\xe9\x95\xbf\xe5\xba\ 3284 | \xa6*\n\x0c\n\x05\x04\x01\x02\t\x05\x12\x03;\x08\r\n\x0c\n\x05\x04\x01\ 3285 | \x02\t\x01\x12\x03;0;\n\x0c\n\x05\x04\x01\x02\t\x03\x12\x03;FH\n8\n\x04\ 3286 | \x04\x01\x08\x02\x12\x04>\x08@\t\x1a\x14\x20[default\x20=\x20UPDATE]\n2\ 3287 | \x14*\xe6\x95\xb0\xe6\x8d\xae\xe5\x8f\x98\xe6\x9b\xb4\xe7\xb1\xbb\xe5\ 3288 | \x9e\x8b*\n\x0c\n\x05\x04\x01\x08\x02\x01\x12\x03>\x0e\x1f\n\x0b\n\x04\ 3289 | \x04\x01\x02\n\x12\x03?\x10]\n\x0c\n\x05\x04\x01\x02\n\x06\x12\x03?\x10\ 3290 | \x19\n\x0c\n\x05\x04\x01\x02\n\x01\x12\x03?8A\n\x0c\n\x05\x04\x01\x02\n\ 3291 | \x03\x12\x03?Z\\\n\x1b\n\x04\x04\x01\x02\x0b\x12\x03D\x08]\x1a\x0e*\xe9\ 3292 | \xa2\x84\xe7\x95\x99\xe6\x89\xa9\xe5\xb1\x95*\n\x0c\n\x05\x04\x01\x02\ 3293 | \x0b\x04\x12\x03D\x08\x10\n\x0c\n\x05\x04\x01\x02\x0b\x06\x12\x03D\x11\ 3294 | \x15\n\x0c\n\x05\x04\x01\x02\x0b\x01\x12\x03D8=\n\x0c\n\x05\x04\x01\x02\ 3295 | \x0b\x03\x12\x03DZ\\\n\"\n\x04\x04\x01\x02\x0c\x12\x03G\x088\x1a\x15*\ 3296 | \xe5\xbd\x93\xe5\x89\x8d\xe4\xba\x8b\xe5\x8a\xa1\xe7\x9a\x84gitd*\n\x0c\ 3297 | \n\x05\x04\x01\x02\x0c\x05\x12\x03G\x08\x0e\n\x0c\n\x05\x04\x01\x02\x0c\ 3298 | \x01\x12\x03G\x1f#\n\x0c\n\x05\x04\x01\x02\x0c\x03\x12\x03G57\n)\n\x02\ 3299 | \x04\x02\x12\x04K\0l\x01\x1a\x1d*\xe6\xaf\x8f\xe4\xb8\xaa\xe5\xad\x97\ 3300 | \xe6\xae\xb5\xe7\x9a\x84\xe6\x95\xb0\xe6\x8d\xae\xe7\xbb\x93\xe6\x9e\x84\ 3301 | *\n\n\n\x03\x04\x02\x01\x12\x03K\x08\x0e\n\x1b\n\x04\x04\x02\x02\0\x12\ 3302 | \x03M\x08B\x1a\x0e*\xe5\xad\x97\xe6\xae\xb5\xe4\xb8\x8b\xe6\xa0\x87*\n\ 3303 | \x0c\n\x05\x04\x02\x02\0\x05\x12\x03M\x08\r\n\x0c\n\x05\x04\x02\x02\0\ 3304 | \x01\x12\x03M\x18\x1d\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03M@A\n\"\n\x04\ 3305 | \x04\x02\x02\x01\x12\x03P\x08B\x1a\x15*\xe5\xad\x97\xe6\xae\xb5java\xe4\ 3306 | \xb8\xad\xe7\xb1\xbb\xe5\x9e\x8b*\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\ 3307 | \x03P\x08\r\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03P\x18\x1f\n\x0c\n\x05\ 3308 | \x04\x02\x02\x01\x03\x12\x03P@A\nF\n\x04\x04\x02\x02\x02\x12\x03S\x08B\ 3309 | \x1a9*\xe5\xad\x97\xe6\xae\xb5\xe5\x90\x8d\xe7\xa7\xb0(\xe5\xbf\xbd\xe7\ 3310 | \x95\xa5\xe5\xa4\xa7\xe5\xb0\x8f\xe5\x86\x99)\xef\xbc\x8c\xe5\x9c\xa8mys\ 3311 | ql\xe4\xb8\xad\xe6\x98\xaf\xe6\xb2\xa1\xe6\x9c\x89\xe7\x9a\x84*\n\x0c\n\ 3312 | \x05\x04\x02\x02\x02\x05\x12\x03S\x08\x0e\n\x0c\n\x05\x04\x02\x02\x02\ 3313 | \x01\x12\x03S\x18\x1c\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03S@A\n\x1e\n\ 3314 | \x04\x04\x02\x02\x03\x12\x03V\x08B\x1a\x11*\xe6\x98\xaf\xe5\x90\xa6\xe6\ 3315 | \x98\xaf\xe4\xb8\xbb\xe9\x94\xae*\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\ 3316 | \x03V\x08\x0c\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03V\x18\x1d\n\x0c\n\ 3317 | \x05\x04\x02\x02\x03\x03\x12\x03V@A\nP\n\x04\x04\x02\x02\x04\x12\x03Y\ 3318 | \x08B\x1aC*\xe5\xa6\x82\xe6\x9e\x9cEventType=UPDATE,\xe7\x94\xa8\xe4\xba\ 3319 | \x8e\xe6\xa0\x87\xe8\xaf\x86\xe8\xbf\x99\xe4\xb8\xaa\xe5\xad\x97\xe6\xae\ 3320 | \xb5\xe5\x80\xbc\xe6\x98\xaf\xe5\x90\xa6\xe6\x9c\x89\xe4\xbf\xae\xe6\x94\ 3321 | \xb9*\n\x0c\n\x05\x04\x02\x02\x04\x05\x12\x03Y\x08\x0c\n\x0c\n\x05\x04\ 3322 | \x02\x02\x04\x01\x12\x03Y\x18\x1f\n\x0c\n\x05\x04\x02\x02\x04\x03\x12\ 3323 | \x03Y@A\n9\n\x04\x04\x02\x08\0\x12\x04\\\x08^\t\x1a\x12[default\x20=\x20\ 3324 | false]\n2\x17*\x20\xe6\xa0\x87\xe8\xaf\x86\xe6\x98\xaf\xe5\x90\xa6\xe4\ 3325 | \xb8\xba\xe7\xa9\xba\x20\x20*\n\x0c\n\x05\x04\x02\x08\0\x01\x12\x03\\\ 3326 | \x0e\x1c\n\x0b\n\x04\x04\x02\x02\x05\x12\x03]\x10J\n\x0c\n\x05\x04\x02\ 3327 | \x02\x05\x05\x12\x03]\x10\x14\n\x0c\n\x05\x04\x02\x02\x05\x01\x12\x03]\ 3328 | \x20&\n\x0c\n\x05\x04\x02\x02\x05\x03\x12\x03]HI\n\x1b\n\x04\x04\x02\x02\ 3329 | \x06\x12\x03b\x08J\x1a\x0e*\xe9\xa2\x84\xe7\x95\x99\xe6\x89\xa9\xe5\xb1\ 3330 | \x95*\n\x0c\n\x05\x04\x02\x02\x06\x04\x12\x03b\x08\x10\n\x0c\n\x05\x04\ 3331 | \x02\x02\x06\x06\x12\x03b\x11\x15\n\x0c\n\x05\x04\x02\x02\x06\x01\x12\ 3332 | \x03b\x20%\n\x0c\n\x05\x04\x02\x02\x06\x03\x12\x03bHI\nK\n\x04\x04\x02\ 3333 | \x02\x07\x12\x03e\x08B\x1a>*\x20\xe5\xad\x97\xe6\xae\xb5\xe5\x80\xbc,tim\ 3334 | estamp,Datetime\xe6\x98\xaf\xe4\xb8\x80\xe4\xb8\xaa\xe6\x97\xb6\xe9\x97\ 3335 | \xb4\xe6\xa0\xbc\xe5\xbc\x8f\xe7\x9a\x84\xe6\x96\x87\xe6\x9c\xac\x20*\n\ 3336 | \x0c\n\x05\x04\x02\x02\x07\x05\x12\x03e\x08\x0e\n\x0c\n\x05\x04\x02\x02\ 3337 | \x07\x01\x12\x03e\x18\x1d\n\x0c\n\x05\x04\x02\x02\x07\x03\x12\x03e@A\n/\ 3338 | \n\x04\x04\x02\x02\x08\x12\x03h\x08B\x1a\"*\x20\xe5\xaf\xb9\xe5\xba\x94\ 3339 | \xe6\x95\xb0\xe6\x8d\xae\xe5\xaf\xb9\xe8\xb1\xa1\xe5\x8e\x9f\xe5\xa7\x8b\ 3340 | \xe9\x95\xbf\xe5\xba\xa6\x20*\n\x0c\n\x05\x04\x02\x02\x08\x05\x12\x03h\ 3341 | \x08\r\n\x0c\n\x05\x04\x02\x02\x08\x01\x12\x03h\x18\x1e\n\x0c\n\x05\x04\ 3342 | \x02\x02\x08\x03\x12\x03h@A\n\x20\n\x04\x04\x02\x02\t\x12\x03k\x08C\x1a\ 3343 | \x13*\xe5\xad\x97\xe6\xae\xb5mysql\xe7\xb1\xbb\xe5\x9e\x8b*\n\x0c\n\x05\ 3344 | \x04\x02\x02\t\x05\x12\x03k\x08\x0e\n\x0c\n\x05\x04\x02\x02\t\x01\x12\ 3345 | \x03k\x18!\n\x0c\n\x05\x04\x02\x02\t\x03\x12\x03k@B\n\n\n\x02\x04\x03\ 3346 | \x12\x04n\0x\x01\n\n\n\x03\x04\x03\x01\x12\x03n\x08\x0f\nA\n\x04\x04\x03\ 3347 | \x02\0\x12\x03q\x08J\x1a4*\x20\xe5\xad\x97\xe6\xae\xb5\xe4\xbf\xa1\xe6\ 3348 | \x81\xaf\xef\xbc\x8c\xe5\xa2\x9e\xe9\x87\x8f\xe6\x95\xb0\xe6\x8d\xae(\ 3349 | \xe4\xbf\xae\xe6\x94\xb9\xe5\x89\x8d,\xe5\x88\xa0\xe9\x99\xa4\xe5\x89\ 3350 | \x8d)\x20*\n\x0c\n\x05\x04\x03\x02\0\x04\x12\x03q\x08\x10\n\x0c\n\x05\ 3351 | \x04\x03\x02\0\x06\x12\x03q\x11\x17\n\x0c\n\x05\x04\x03\x02\0\x01\x12\ 3352 | \x03q(5\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03qHI\nB\n\x04\x04\x03\x02\ 3353 | \x01\x12\x03t\x08J\x1a5*\x20\xe5\xad\x97\xe6\xae\xb5\xe4\xbf\xa1\xe6\x81\ 3354 | \xaf\xef\xbc\x8c\xe5\xa2\x9e\xe9\x87\x8f\xe6\x95\xb0\xe6\x8d\xae(\xe4\ 3355 | \xbf\xae\xe6\x94\xb9\xe5\x90\x8e,\xe6\x96\xb0\xe5\xa2\x9e\xe5\x90\x8e)\ 3356 | \x20\x20*\n\x0c\n\x05\x04\x03\x02\x01\x04\x12\x03t\x08\x10\n\x0c\n\x05\ 3357 | \x04\x03\x02\x01\x06\x12\x03t\x11\x17\n\x0c\n\x05\x04\x03\x02\x01\x01\ 3358 | \x12\x03t(4\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03tHI\n\x1b\n\x04\x04\ 3359 | \x03\x02\x02\x12\x03w\x08R\x1a\x0e*\xe9\xa2\x84\xe7\x95\x99\xe6\x89\xa9\ 3360 | \xe5\xb1\x95*\n\x0c\n\x05\x04\x03\x02\x02\x04\x12\x03w\x08\x10\n\x0c\n\ 3361 | \x05\x04\x03\x02\x02\x06\x12\x03w\x11\x15\n\x0c\n\x05\x04\x03\x02\x02\ 3362 | \x01\x12\x03w(-\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03wPQ\n<\n\x02\x04\ 3363 | \x04\x12\x05{\0\x98\x01\x01\x1a/*message\x20row\x20\xe6\xaf\x8f\xe8\xa1\ 3364 | \x8c\xe5\x8f\x98\xe6\x9b\xb4\xe6\x95\xb0\xe6\x8d\xae\xe7\x9a\x84\xe6\x95\ 3365 | \xb0\xe6\x8d\xae\xe7\xbb\x93\xe6\x9e\x84*\n\n\n\x03\x04\x04\x01\x12\x03{\ 3366 | \x08\x11\n)\n\x04\x04\x04\x02\0\x12\x03~\x08J\x1a\x1c*tableId,\xe7\x94\ 3367 | \xb1\xe6\x95\xb0\xe6\x8d\xae\xe5\xba\x93\xe4\xba\xa7\xe7\x94\x9f*\n\x0c\ 3368 | \n\x05\x04\x04\x02\0\x05\x12\x03~\x08\r\n\x0c\n\x05\x04\x04\x02\0\x01\ 3369 | \x12\x03~\x20'\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03~HI\n9\n\x04\x04\x04\ 3370 | \x08\0\x12\x06\x82\x01\x08\x84\x01\t\x1a\x13[default\x20=\x20UPDATE]\n2\ 3371 | \x14*\xe6\x95\xb0\xe6\x8d\xae\xe5\x8f\x98\xe6\x9b\xb4\xe7\xb1\xbb\xe5\ 3372 | \x9e\x8b*\n\r\n\x05\x04\x04\x08\0\x01\x12\x04\x82\x01\x0e\x1f\n\x0c\n\ 3373 | \x04\x04\x04\x02\x01\x12\x04\x83\x01\x10R\n\r\n\x05\x04\x04\x02\x01\x06\ 3374 | \x12\x04\x83\x01\x10\x19\n\r\n\x05\x04\x04\x02\x01\x01\x12\x04\x83\x01(1\ 3375 | \n\r\n\x05\x04\x04\x02\x01\x03\x12\x04\x83\x01PQ\nB\n\x04\x04\x04\x08\ 3376 | \x01\x12\x06\x88\x01\x08\x8a\x01\t\x1a\x13\x20[default\x20=\x20false]\n2\ 3377 | \x1d*\x20\xe6\xa0\x87\xe8\xaf\x86\xe6\x98\xaf\xe5\x90\xa6\xe6\x98\xafddl\ 3378 | \xe8\xaf\xad\xe5\x8f\xa5\x20\x20*\n\r\n\x05\x04\x04\x08\x01\x01\x12\x04\ 3379 | \x88\x01\x0e\x1b\n\x0c\n\x04\x04\x04\x02\x02\x12\x04\x89\x01\x10S\n\r\n\ 3380 | \x05\x04\x04\x02\x02\x05\x12\x04\x89\x01\x10\x14\n\r\n\x05\x04\x04\x02\ 3381 | \x02\x01\x12\x04\x89\x01(-\n\r\n\x05\x04\x04\x02\x02\x03\x12\x04\x89\x01\ 3382 | PR\n(\n\x04\x04\x04\x02\x03\x12\x04\x8e\x01\x08K\x1a\x1a*\x20ddl/query\ 3383 | \xe7\x9a\x84sql\xe8\xaf\xad\xe5\x8f\xa5\x20\x20*\n\r\n\x05\x04\x04\x02\ 3384 | \x03\x05\x12\x04\x8e\x01\x08\x0e\n\r\n\x05\x04\x04\x02\x03\x01\x12\x04\ 3385 | \x8e\x01\x20#\n\r\n\x05\x04\x04\x02\x03\x03\x12\x04\x8e\x01HJ\n:\n\x04\ 3386 | \x04\x04\x02\x04\x12\x04\x91\x01\x08S\x1a,*\x20\xe4\xb8\x80\xe6\xac\xa1\ 3387 | \xe6\x95\xb0\xe6\x8d\xae\xe5\xba\x93\xe5\x8f\x98\xe6\x9b\xb4\xe5\x8f\xaf\ 3388 | \xe8\x83\xbd\xe5\xad\x98\xe5\x9c\xa8\xe5\xa4\x9a\xe8\xa1\x8c\x20\x20*\n\ 3389 | \r\n\x05\x04\x04\x02\x04\x04\x12\x04\x91\x01\x08\x10\n\r\n\x05\x04\x04\ 3390 | \x02\x04\x06\x12\x04\x91\x01\x11\x18\n\r\n\x05\x04\x04\x02\x04\x01\x12\ 3391 | \x04\x91\x01(0\n\r\n\x05\x04\x04\x02\x04\x03\x12\x04\x91\x01PR\n\x1c\n\ 3392 | \x04\x04\x04\x02\x05\x12\x04\x94\x01\x08S\x1a\x0e*\xe9\xa2\x84\xe7\x95\ 3393 | \x99\xe6\x89\xa9\xe5\xb1\x95*\n\r\n\x05\x04\x04\x02\x05\x04\x12\x04\x94\ 3394 | \x01\x08\x10\n\r\n\x05\x04\x04\x02\x05\x06\x12\x04\x94\x01\x11\x15\n\r\n\ 3395 | \x05\x04\x04\x02\x05\x01\x12\x04\x94\x01(-\n\r\n\x05\x04\x04\x02\x05\x03\ 3396 | \x12\x04\x94\x01PR\ni\n\x04\x04\x04\x02\x06\x12\x04\x97\x01\x08C\x1a[*\ 3397 | \x20ddl/query\xe7\x9a\x84schemaName\xef\xbc\x8c\xe4\xbc\x9a\xe5\xad\x98\ 3398 | \xe5\x9c\xa8\xe8\xb7\xa8\xe5\xba\x93ddl\xef\xbc\x8c\xe9\x9c\x80\xe8\xa6\ 3399 | \x81\xe4\xbf\x9d\xe7\x95\x99\xe6\x89\xa7\xe8\xa1\x8cddl\xe7\x9a\x84\xe5\ 3400 | \xbd\x93\xe5\x89\x8dschemaName\x20\x20*\n\r\n\x05\x04\x04\x02\x06\x05\ 3401 | \x12\x04\x97\x01\x08\x0e\n\r\n\x05\x04\x04\x02\x06\x01\x12\x04\x97\x01\ 3402 | \x20-\n\r\n\x05\x04\x04\x02\x06\x03\x12\x04\x97\x01@B\n+\n\x02\x04\x05\ 3403 | \x12\x06\x9b\x01\0\xa8\x01\x01\x1a\x1d*\xe5\xbc\x80\xe5\xa7\x8b\xe4\xba\ 3404 | \x8b\xe5\x8a\xa1\xe7\x9a\x84\xe4\xb8\x80\xe4\xba\x9b\xe4\xbf\xa1\xe6\x81\ 3405 | \xaf*\n\x0b\n\x03\x04\x05\x01\x12\x04\x9b\x01\x08\x18\n<\n\x04\x04\x05\ 3406 | \x02\0\x12\x04\x9e\x01\x08J\x1a.*\xe5\xb7\xb2\xe5\xba\x9f\xe5\xbc\x83\ 3407 | \xef\xbc\x8c\xe8\xaf\xb7\xe4\xbd\xbf\xe7\x94\xa8header\xe9\x87\x8c\xe7\ 3408 | \x9a\x84executeTime*\n\r\n\x05\x04\x05\x02\0\x05\x12\x04\x9e\x01\x08\r\n\ 3409 | \r\n\x05\x04\x05\x02\0\x01\x12\x04\x9e\x01\x20+\n\r\n\x05\x04\x05\x02\0\ 3410 | \x03\x12\x04\x9e\x01HI\n5\n\x04\x04\x05\x02\x01\x12\x04\xa1\x01\x08B\x1a\ 3411 | '*\xe5\xb7\xb2\xe5\xba\x9f\xe5\xbc\x83\xef\xbc\x8cBegin\xe9\x87\x8c\xe4\ 3412 | \xb8\x8d\xe6\x8f\x90\xe4\xbe\x9b\xe4\xba\x8b\xe5\x8a\xa1id*\n\r\n\x05\ 3413 | \x04\x05\x02\x01\x05\x12\x04\xa1\x01\x08\x0e\n\r\n\x05\x04\x05\x02\x01\ 3414 | \x01\x12\x04\xa1\x01\x20-\n\r\n\x05\x04\x05\x02\x01\x03\x12\x04\xa1\x01@\ 3415 | A\n\x1c\n\x04\x04\x05\x02\x02\x12\x04\xa4\x01\x08R\x1a\x0e*\xe9\xa2\x84\ 3416 | \xe7\x95\x99\xe6\x89\xa9\xe5\xb1\x95*\n\r\n\x05\x04\x05\x02\x02\x04\x12\ 3417 | \x04\xa4\x01\x08\x10\n\r\n\x05\x04\x05\x02\x02\x06\x12\x04\xa4\x01\x11\ 3418 | \x15\n\r\n\x05\x04\x05\x02\x02\x01\x12\x04\xa4\x01(-\n\r\n\x05\x04\x05\ 3419 | \x02\x02\x03\x12\x04\xa4\x01PQ\n\"\n\x04\x04\x05\x02\x03\x12\x04\xa7\x01\ 3420 | \x08J\x1a\x14*\xe6\x89\xa7\xe8\xa1\x8c\xe7\x9a\x84thread\x20Id*\n\r\n\ 3421 | \x05\x04\x05\x02\x03\x05\x12\x04\xa7\x01\x08\r\n\r\n\x05\x04\x05\x02\x03\ 3422 | \x01\x12\x04\xa7\x01\x20(\n\r\n\x05\x04\x05\x02\x03\x03\x12\x04\xa7\x01H\ 3423 | I\n+\n\x02\x04\x06\x12\x06\xab\x01\0\xb5\x01\x01\x1a\x1d*\xe7\xbb\x93\ 3424 | \xe6\x9d\x9f\xe4\xba\x8b\xe5\x8a\xa1\xe7\x9a\x84\xe4\xb8\x80\xe4\xba\x9b\ 3425 | \xe4\xbf\xa1\xe6\x81\xaf*\n\x0b\n\x03\x04\x06\x01\x12\x04\xab\x01\x08\ 3426 | \x16\n<\n\x04\x04\x06\x02\0\x12\x04\xae\x01\x08J\x1a.*\xe5\xb7\xb2\xe5\ 3427 | \xba\x9f\xe5\xbc\x83\xef\xbc\x8c\xe8\xaf\xb7\xe4\xbd\xbf\xe7\x94\xa8head\ 3428 | er\xe9\x87\x8c\xe7\x9a\x84executeTime*\n\r\n\x05\x04\x06\x02\0\x05\x12\ 3429 | \x04\xae\x01\x08\r\n\r\n\x05\x04\x06\x02\0\x01\x12\x04\xae\x01\x20+\n\r\ 3430 | \n\x05\x04\x06\x02\0\x03\x12\x04\xae\x01HI\n\x19\n\x04\x04\x06\x02\x01\ 3431 | \x12\x04\xb1\x01\x08B\x1a\x0b*\xe4\xba\x8b\xe5\x8a\xa1\xe5\x8f\xb7*\n\r\ 3432 | \n\x05\x04\x06\x02\x01\x05\x12\x04\xb1\x01\x08\x0e\n\r\n\x05\x04\x06\x02\ 3433 | \x01\x01\x12\x04\xb1\x01\x20-\n\r\n\x05\x04\x06\x02\x01\x03\x12\x04\xb1\ 3434 | \x01@A\n\x1c\n\x04\x04\x06\x02\x02\x12\x04\xb4\x01\x08R\x1a\x0e*\xe9\xa2\ 3435 | \x84\xe7\x95\x99\xe6\x89\xa9\xe5\xb1\x95*\n\r\n\x05\x04\x06\x02\x02\x04\ 3436 | \x12\x04\xb4\x01\x08\x10\n\r\n\x05\x04\x06\x02\x02\x06\x12\x04\xb4\x01\ 3437 | \x11\x15\n\r\n\x05\x04\x06\x02\x02\x01\x12\x04\xb4\x01(-\n\r\n\x05\x04\ 3438 | \x06\x02\x02\x03\x12\x04\xb4\x01PQ\n\x1c\n\x02\x04\x07\x12\x06\xb8\x01\0\ 3439 | \xbb\x01\x01\x1a\x0e*\xe9\xa2\x84\xe7\x95\x99\xe6\x89\xa9\xe5\xb1\x95*\n\ 3440 | \x0b\n\x03\x04\x07\x01\x12\x04\xb8\x01\x08\x0c\n\x0c\n\x04\x04\x07\x02\0\ 3441 | \x12\x04\xb9\x01\x08R\n\r\n\x05\x04\x07\x02\0\x05\x12\x04\xb9\x01\x08\ 3442 | \x0e\n\r\n\x05\x04\x07\x02\0\x01\x12\x04\xb9\x01\x18\x1b\n\r\n\x05\x04\ 3443 | \x07\x02\0\x03\x12\x04\xb9\x01PQ\n\x0c\n\x04\x04\x07\x02\x01\x12\x04\xba\ 3444 | \x01\x08J\n\r\n\x05\x04\x07\x02\x01\x05\x12\x04\xba\x01\x08\x0e\n\r\n\ 3445 | \x05\x04\x07\x02\x01\x01\x12\x04\xba\x01\x18\x1d\n\r\n\x05\x04\x07\x02\ 3446 | \x01\x03\x12\x04\xba\x01HI\nd\n\x02\x05\0\x12\x06\xbe\x01\0\xc6\x01\x01\ 3447 | \x1aV*\xe6\x89\x93\xe6\x95\xa3\xe5\x90\x8e\xe7\x9a\x84\xe4\xba\x8b\xe4\ 3448 | \xbb\xb6\xe7\xb1\xbb\xe5\x9e\x8b\xef\xbc\x8c\xe4\xb8\xbb\xe8\xa6\x81\xe7\ 3449 | \x94\xa8\xe4\xba\x8e\xe6\xa0\x87\xe8\xaf\x86\xe4\xba\x8b\xe5\x8a\xa1\xe7\ 3450 | \x9a\x84\xe5\xbc\x80\xe5\xa7\x8b\xef\xbc\x8c\xe5\x8f\x98\xe6\x9b\xb4\xe6\ 3451 | \x95\xb0\xe6\x8d\xae\xef\xbc\x8c\xe7\xbb\x93\xe6\x9d\x9f*\n\x0b\n\x03\ 3452 | \x05\0\x01\x12\x04\xbe\x01\x05\x0e\n\x0c\n\x04\x05\0\x02\0\x12\x04\xbf\ 3453 | \x01\x08&\n\r\n\x05\x05\0\x02\0\x01\x12\x04\xbf\x01\x08!\n\r\n\x05\x05\0\ 3454 | \x02\0\x02\x12\x04\xbf\x01$%\n\x0c\n\x04\x05\0\x02\x01\x12\x04\xc0\x01\ 3455 | \x08:\n\r\n\x05\x05\0\x02\x01\x01\x12\x04\xc0\x01\x08\x18\n\r\n\x05\x05\ 3456 | \0\x02\x01\x02\x12\x04\xc0\x0189\n\x0c\n\x04\x05\0\x02\x02\x12\x04\xc1\ 3457 | \x01\x08B\n\r\n\x05\x05\0\x02\x02\x01\x12\x04\xc1\x01\x08\x0f\n\r\n\x05\ 3458 | \x05\0\x02\x02\x02\x12\x04\xc1\x01@A\n\x0c\n\x04\x05\0\x02\x03\x12\x04\ 3459 | \xc2\x01\x08:\n\r\n\x05\x05\0\x02\x03\x01\x12\x04\xc2\x01\x08\x16\n\r\n\ 3460 | \x05\x05\0\x02\x03\x02\x12\x04\xc2\x0189\nN\n\x04\x05\0\x02\x04\x12\x04\ 3461 | \xc4\x01\x08B\x1a@*\x20\xe5\xbf\x83\xe8\xb7\xb3\xe7\xb1\xbb\xe5\x9e\x8b\ 3462 | \xef\xbc\x8c\xe5\x86\x85\xe9\x83\xa8\xe4\xbd\xbf\xe7\x94\xa8\xef\xbc\x8c\ 3463 | \xe5\xa4\x96\xe9\x83\xa8\xe6\x9a\x82\xe4\xb8\x8d\xe5\x8f\xaf\xe8\xa7\x81\ 3464 | \xef\xbc\x8c\xe5\x8f\xaf\xe5\xbf\xbd\xe7\x95\xa5\x20*\n\r\n\x05\x05\0\ 3465 | \x02\x04\x01\x12\x04\xc4\x01\x08\x11\n\r\n\x05\x05\0\x02\x04\x02\x12\x04\ 3466 | \xc4\x01@A\n\x0c\n\x04\x05\0\x02\x05\x12\x04\xc5\x01\x08*\n\r\n\x05\x05\ 3467 | \0\x02\x05\x01\x12\x04\xc5\x01\x08\x0f\n\r\n\x05\x05\0\x02\x05\x02\x12\ 3468 | \x04\xc5\x01()\n\x1e\n\x02\x05\x01\x12\x06\xc9\x01\0\xdd\x01\x01\x1a\x10\ 3469 | *\x20\xe4\xba\x8b\xe4\xbb\xb6\xe7\xb1\xbb\xe5\x9e\x8b\x20*\n\x0b\n\x03\ 3470 | \x05\x01\x01\x12\x04\xc9\x01\x05\x0e\n\x0c\n\x04\x05\x01\x02\0\x12\x04\ 3471 | \xca\x01\x08&\n\r\n\x05\x05\x01\x02\0\x01\x12\x04\xca\x01\x08!\n\r\n\x05\ 3472 | \x05\x01\x02\0\x02\x12\x04\xca\x01$%\n\x0c\n\x04\x05\x01\x02\x01\x12\x04\ 3473 | \xcb\x01\x04*\n\r\n\x05\x05\x01\x02\x01\x01\x12\x04\xcb\x01\x04\n\n\r\n\ 3474 | \x05\x05\x01\x02\x01\x02\x12\x04\xcb\x01()\n\x0c\n\x04\x05\x01\x02\x02\ 3475 | \x12\x04\xcc\x01\x04*\n\r\n\x05\x05\x01\x02\x02\x01\x12\x04\xcc\x01\x04\ 3476 | \n\n\r\n\x05\x05\x01\x02\x02\x02\x12\x04\xcc\x01()\n\x0c\n\x04\x05\x01\ 3477 | \x02\x03\x12\x04\xcd\x01\x04*\n\r\n\x05\x05\x01\x02\x03\x01\x12\x04\xcd\ 3478 | \x01\x04\n\n\r\n\x05\x05\x01\x02\x03\x02\x12\x04\xcd\x01()\n\x0c\n\x04\ 3479 | \x05\x01\x02\x04\x12\x04\xce\x01\x04*\n\r\n\x05\x05\x01\x02\x04\x01\x12\ 3480 | \x04\xce\x01\x04\n\n\r\n\x05\x05\x01\x02\x04\x02\x12\x04\xce\x01()\n\x0c\ 3481 | \n\x04\x05\x01\x02\x05\x12\x04\xcf\x01\x04*\n\r\n\x05\x05\x01\x02\x05\ 3482 | \x01\x12\x04\xcf\x01\x04\t\n\r\n\x05\x05\x01\x02\x05\x02\x12\x04\xcf\x01\ 3483 | ()\n\x0c\n\x04\x05\x01\x02\x06\x12\x04\xd0\x01\x04*\n\r\n\x05\x05\x01\ 3484 | \x02\x06\x01\x12\x04\xd0\x01\x04\t\n\r\n\x05\x05\x01\x02\x06\x02\x12\x04\ 3485 | \xd0\x01()\n\x0c\n\x04\x05\x01\x02\x07\x12\x04\xd1\x01\x04*\n\r\n\x05\ 3486 | \x05\x01\x02\x07\x01\x12\x04\xd1\x01\x04\t\n\r\n\x05\x05\x01\x02\x07\x02\ 3487 | \x12\x04\xd1\x01()\n\x0c\n\x04\x05\x01\x02\x08\x12\x04\xd2\x01\x04\"\n\r\ 3488 | \n\x05\x05\x01\x02\x08\x01\x12\x04\xd2\x01\x04\x0c\n\r\n\x05\x05\x01\x02\ 3489 | \x08\x02\x12\x04\xd2\x01\x20!\n\x0c\n\x04\x05\x01\x02\t\x12\x04\xd3\x01\ 3490 | \x04*\n\r\n\x05\x05\x01\x02\t\x01\x12\x04\xd3\x01\x04\n\n\r\n\x05\x05\ 3491 | \x01\x02\t\x02\x12\x04\xd3\x01()\n\x1c\n\x04\x05\x01\x02\n\x12\x04\xd5\ 3492 | \x01\x04+\x1a\x0e*CREATE\x20INDEX*\n\r\n\x05\x05\x01\x02\n\x01\x12\x04\ 3493 | \xd5\x01\x04\n\n\r\n\x05\x05\x01\x02\n\x02\x12\x04\xd5\x01(*\n\x0c\n\x04\ 3494 | \x05\x01\x02\x0b\x12\x04\xd6\x01\x04+\n\r\n\x05\x05\x01\x02\x0b\x01\x12\ 3495 | \x04\xd6\x01\x04\n\n\r\n\x05\x05\x01\x02\x0b\x02\x12\x04\xd6\x01(*\n\x0c\ 3496 | \n\x04\x05\x01\x02\x0c\x12\x04\xd7\x01\x04\x1b\n\r\n\x05\x05\x01\x02\x0c\ 3497 | \x01\x12\x04\xd7\x01\x04\x08\n\r\n\x05\x05\x01\x02\x0c\x02\x12\x04\xd7\ 3498 | \x01\x18\x1a\n\x14\n\x04\x05\x01\x02\r\x12\x04\xd9\x01\x04\x1b\x1a\x06*\ 3499 | \x20XA\x20*\n\r\n\x05\x05\x01\x02\r\x01\x12\x04\xd9\x01\x04\x0c\n\r\n\ 3500 | \x05\x05\x01\x02\r\x02\x12\x04\xd9\x01\x18\x1a\n\x0c\n\x04\x05\x01\x02\ 3501 | \x0e\x12\x04\xda\x01\x04#\n\r\n\x05\x05\x01\x02\x0e\x01\x12\x04\xda\x01\ 3502 | \x04\x0e\n\r\n\x05\x05\x01\x02\x0e\x02\x12\x04\xda\x01\x20\"\n\"\n\x04\ 3503 | \x05\x01\x02\x0f\x12\x04\xdc\x01\x04\x1b\x1a\x14*\x20MASTER\x20HEARTBEAT\ 3504 | \x20*\n\r\n\x05\x05\x01\x02\x0f\x01\x12\x04\xdc\x01\x04\x0e\n\r\n\x05\ 3505 | \x05\x01\x02\x0f\x02\x12\x04\xdc\x01\x18\x1a\n\x1f\n\x02\x05\x02\x12\x06\ 3506 | \xe0\x01\0\xe5\x01\x01\x1a\x11*\xe6\x95\xb0\xe6\x8d\xae\xe5\xba\x93\xe7\ 3507 | \xb1\xbb\xe5\x9e\x8b*\n\x0b\n\x03\x05\x02\x01\x12\x04\xe0\x01\x05\t\n\ 3508 | \x0c\n\x04\x05\x02\x02\0\x12\x04\xe1\x01\x08!\n\r\n\x05\x05\x02\x02\0\ 3509 | \x01\x12\x04\xe1\x01\x08\x1c\n\r\n\x05\x05\x02\x02\0\x02\x12\x04\xe1\x01\ 3510 | \x1f\x20\n\x0c\n\x04\x05\x02\x02\x01\x12\x04\xe2\x01\x04*\n\r\n\x05\x05\ 3511 | \x02\x02\x01\x01\x12\x04\xe2\x01\x04\n\n\r\n\x05\x05\x02\x02\x01\x02\x12\ 3512 | \x04\xe2\x01()\n\x0c\n\x04\x05\x02\x02\x02\x12\x04\xe3\x01\x04*\n\r\n\ 3513 | \x05\x05\x02\x02\x02\x01\x12\x04\xe3\x01\x04\t\n\r\n\x05\x05\x02\x02\x02\ 3514 | \x02\x12\x04\xe3\x01()\n\x0c\n\x04\x05\x02\x02\x03\x12\x04\xe4\x01\x04*\ 3515 | \n\r\n\x05\x05\x02\x02\x03\x01\x12\x04\xe4\x01\x04\t\n\r\n\x05\x05\x02\ 3516 | \x02\x03\x02\x12\x04\xe4\x01()b\x06proto3\ 3517 | "; 3518 | 3519 | static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; 3520 | 3521 | fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { 3522 | ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() 3523 | } 3524 | 3525 | pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { 3526 | file_descriptor_proto_lazy.get(|| { 3527 | parse_descriptor_proto() 3528 | }) 3529 | } 3530 | -------------------------------------------------------------------------------- /src/protobuf/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod EntryProtocol; 2 | pub mod CanalProtocol; --------------------------------------------------------------------------------