Cobar-server Source code Address: GitHub Welcome fork.
The official document describes Cobar's network communication module.
Cobar uses the Java NIO for processing and reading. NIO is the IO multiplexing in Java. There is no need to establish a processing thread for each connection.
For details, see non-clogging I/o–java nio tutorial
The initialization flowchart for Cobar is as follows:
In the Cobar instantiation process, the load class diagram relationships for three XML configuration files are as follows (the specific members are not indicated):
So the Cobar system is executing:
- Each processor starts the reactor's two threads R and W to process the NIO inputs and outputs
- a connector thread. Processing and back-end MySQL node connections
- A acceptor thread that accepts connection requests from the client.
- The timer task contains (the time is updated regularly, the processor check is performed periodically. Used to clean up resource collection, data node spare timeout check, data node heartbeat packet, Cobar cluster heartbeat pack)
Geekcome
Source:Geek to
Original:Distributed Database Middleware – (1) Cobar initialization process
Tips:The copyright of this article belongs to author. Welcome reprint, but without the author's permission must retain this statement, and in the article page obvious location to the original link.
If you have any questions about the article, you can leave a comment in the comments, I will reply you as much as possible, thank you for reading
Distributed Database Middleware – (1) Cobar initialization process