github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/docs/media/db-sorter-sequence.svg (about) 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="679px" preserveAspectRatio="none" style="width:927px;height:679px;background:#FFFFFF;" version="1.1" viewBox="0 0 927 679" width="927px" zoomAndPan="magnify"><defs/><g><rect height="183.9297" style="stroke:#000000;stroke-width:1.5;fill:none;" width="591" x="10" y="53.2969"/><rect height="286.4609" style="stroke:#000000;stroke-width:1.5;fill:none;" width="718.5" x="108.5" y="251.2266"/><rect height="75.3984" style="stroke:#000000;stroke-width:1.5;fill:none;" width="812.5" x="108.5" y="551.6875"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="58" x2="58" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="168.5" x2="168.5" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="280.5" x2="280.5" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="407" x2="407" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="558" x2="558" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="689" x2="689" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="769" x2="769" y1="36.2969" y2="644.0859"/><line style="stroke:#181818;stroke-width:0.5;fill:none;stroke-dasharray:5.0,5.0;" x1="869" x2="869" y1="36.2969" y2="644.0859"/><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="77" x="20" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="63" x="27" y="24.9951">KVClient</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="77" x="20" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="63" x="27" y="663.0811">KVClient</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="100" x="118.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="86" x="125.5" y="24.9951">TableSorter</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="100" x="118.5" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="86" x="125.5" y="663.0811">TableSorter</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="60" x="250.5" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="46" x="257.5" y="24.9951">Writer</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="60" x="250.5" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="46" x="257.5" y="663.0811">Writer</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="75" x="370" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="61" x="377" y="24.9951">DBActor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="75" x="370" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="61" x="377" y="663.0811">DBActor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="65" x="526" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="533" y="24.9951">Reader</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="65" x="526" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="51" x="533" y="663.0811">Reader</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="45" x="667" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31" x="674" y="24.9951">Sink</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="45" x="667" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="31" x="674" y="663.0811">Sink</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="95" x="722" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81" x="729" y="24.9951">Compactor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="95" x="722" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="81" x="729" y="663.0811">Compactor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="827" y="5"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="834" y="24.9951">Processor</text><rect fill="#E2E2F0" height="30.2969" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="84" x="827" y="643.0859"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="70" x="834" y="663.0811">Processor</text><path d="M10,53.2969 L88,53.2969 L88,60.4297 L78,70.4297 L10,70.4297 L10,53.2969 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="183.9297" style="stroke:#000000;stroke-width:1.5;" width="591" x="10" y="53.2969"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="33" x="25" y="66.3638">loop</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="70" x="103" y="65.5073">[AddEntry]</text><polygon fill="#181818" points="156.5,87.5625,166.5,91.5625,156.5,95.5625,160.5,91.5625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="58.5" x2="162.5" y1="91.5625" y2="91.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="86" x="65.5" y="86.4966">Call AddEntry</text><polygon fill="#181818" points="268.5,116.6953,278.5,120.6953,268.5,124.6953,272.5,120.6953" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="168.5" x2="274.5" y1="120.6953" y2="120.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="88" x="175.5" y="115.6294">Task (Events)</text><polygon fill="#181818" points="395.5,145.8281,405.5,149.8281,395.5,153.8281,399.5,149.8281" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="280.5" x2="401.5" y1="149.8281" y2="149.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="103" x="287.5" y="144.7622">Task (WriteReq)</text><line style="stroke:#181818;stroke-width:1.0;" x1="407.5" x2="449.5" y1="175.4609" y2="175.4609"/><line style="stroke:#181818;stroke-width:1.0;" x1="449.5" x2="449.5" y1="175.4609" y2="188.4609"/><line style="stroke:#181818;stroke-width:1.0;" x1="408.5" x2="449.5" y1="188.4609" y2="188.4609"/><polygon fill="#181818" points="418.5,184.4609,408.5,188.4609,418.5,192.4609,414.5,188.4609" style="stroke:#181818;stroke-width:1.0;"/><path d="M457,162.8281 L457,202.8281 L560,202.8281 L560,172.8281 L550,162.8281 L457,162.8281 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M550,162.8281 L550,172.8281 L560,172.8281 L550,162.8281 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="82" x="463" y="179.895">Write events</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="63" x="463" y="195.0278">to leveldb</text><polygon fill="#181818" points="546.5,225.2266,556.5,229.2266,546.5,233.2266,550.5,229.2266" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="280.5" x2="552.5" y1="229.2266" y2="229.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="92" x="287.5" y="224.1606">Task (ReadTs)</text><path d="M108.5,251.2266 L186.5,251.2266 L186.5,258.3594 L176.5,268.3594 L108.5,268.3594 L108.5,251.2266 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="286.4609" style="stroke:#000000;stroke-width:1.5;" width="718.5" x="108.5" y="251.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="33" x="123.5" y="264.2935">loop</text><text fill="#000000" font-family="sans-serif" font-size="11" font-weight="bold" lengthAdjust="spacing" textLength="58" x="201.5" y="263.437">[Output]</text><polygon fill="#181818" points="179.5,285.4922,169.5,289.4922,179.5,293.4922,175.5,289.4922" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="173.5" x2="688.5" y1="289.4922" y2="289.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="71" x="185.5" y="284.4263">Call Output</text><polygon fill="#181818" points="546.5,314.625,556.5,318.625,546.5,322.625,550.5,318.625" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="168.5" x2="552.5" y1="318.625" y2="318.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="92" x="175.5" y="313.5591">Task (ReadTs)</text><polygon fill="#181818" points="418.5,343.7578,408.5,347.7578,418.5,351.7578,414.5,347.7578" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="412.5" x2="557.5" y1="347.7578" y2="347.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="90" x="424.5" y="342.6919">Task (IterReq)</text><line style="stroke:#181818;stroke-width:1.0;" x1="407.5" x2="449.5" y1="373.3906" y2="373.3906"/><line style="stroke:#181818;stroke-width:1.0;" x1="449.5" x2="449.5" y1="373.3906" y2="386.3906"/><line style="stroke:#181818;stroke-width:1.0;" x1="408.5" x2="449.5" y1="386.3906" y2="386.3906"/><polygon fill="#181818" points="418.5,382.3906,408.5,386.3906,418.5,390.3906,414.5,386.3906" style="stroke:#181818;stroke-width:1.0;"/><path d="M457,360.7578 L457,400.7578 L567,400.7578 L567,370.7578 L557,360.7578 L457,360.7578 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M557,360.7578 L557,370.7578 L567,370.7578 L557,360.7578 " fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="89" x="463" y="377.8247">Take iterators</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="81" x="463" y="392.9575">from leveldb</text><polygon fill="#181818" points="546.5,423.1563,556.5,427.1563,546.5,431.1563,550.5,427.1563" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="407.5" x2="552.5" y1="427.1563" y2="427.1563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="47" x="414.5" y="422.0903">Iterator</text><polygon fill="#181818" points="677.5,467.4219,687.5,471.4219,677.5,475.4219,681.5,471.4219" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="558.5" x2="683.5" y1="471.4219" y2="471.4219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="107" x="565.5" y="451.2231">Resolved Events</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="92" x="565.5" y="466.356">(from Iterator)</text><polygon fill="#181818" points="418.5,496.5547,408.5,500.5547,418.5,504.5547,414.5,500.5547" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="412.5" x2="557.5" y1="500.5547" y2="500.5547"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="127" x="424.5" y="495.4888">Task (DeleteRange)</text><polygon fill="#181818" points="757.5,525.6875,767.5,529.6875,757.5,533.6875,761.5,529.6875" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="407.5" x2="763.5" y1="529.6875" y2="529.6875"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="58" x="414.5" y="524.6216">Compact</text><path d="M108.5,551.6875 L257.5,551.6875 L257.5,558.8203 L247.5,568.8203 L108.5,568.8203 L108.5,551.6875 " fill="#EEEEEE" style="stroke:#000000;stroke-width:1.5;"/><rect fill="none" height="75.3984" style="stroke:#000000;stroke-width:1.5;" width="812.5" x="108.5" y="551.6875"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacing" textLength="104" x="123.5" y="564.7544">Remove table</text><polygon fill="#181818" points="179.5,585.9531,169.5,589.9531,179.5,593.9531,175.5,589.9531" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="173.5" x2="868" y1="589.9531" y2="589.9531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="29" x="185.5" y="584.8872">Stop</text><polygon fill="#181818" points="395.5,615.0859,405.5,619.0859,395.5,623.0859,399.5,619.0859" style="stroke:#181818;stroke-width:1.0;"/><line style="stroke:#181818;stroke-width:1.0;" x1="168.5" x2="401.5" y1="619.0859" y2="619.0859"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacing" textLength="127" x="175.5" y="614.02">Task (DeleteRange)</text><!--MD5=[0dfd4e4d0557c278160938bf750d5b9d] 2 @startuml 3 loop AddEntry 4 5 KVClient -> TableSorter : Call AddEntry 6 TableSorter -> Writer : Task (Events) 7 Writer -> DBActor : Task (WriteReq) 8 DBActor -> DBActor 9 note right 10 Write events 11 to leveldb 12 end note 13 Writer -> Reader : Task (ReadTs) 14 15 end 16 17 loop Output 18 19 Sink -> TableSorter : Call Output 20 TableSorter -> Reader : Task (ReadTs) 21 Reader -> DBActor : Task (IterReq) 22 DBActor -> DBActor 23 note right 24 Take iterators 25 from leveldb 26 end note 27 DBActor -> Reader : Iterator 28 Reader -> Sink : Resolved Events\n(from Iterator) 29 Reader -> DBActor : Task (DeleteRange) 30 DBActor -> Compactor : Compact 31 32 end 33 34 group Remove table 35 36 Processor -> TableSorter : Stop 37 TableSorter -> DBActor : Task (DeleteRange) 38 39 end 40 @enduml 41 42 PlantUML version 1.2022.3beta2(Unknown compile time) 43 (GPL source distribution) 44 Java Runtime: Java(TM) SE Runtime Environment 45 JVM: Java HotSpot(TM) 64-Bit Server VM 46 Default Encoding: UTF-8 47 Language: en 48 Country: US 49 --></g></svg>