tree: 0e55852a111e16e2cf33655816cec4e09a79be9f [path history] [tgz]
  1. async_acceptor.cpp
  2. async_acceptor.h
  3. async_acceptor_test.cpp
  4. async_replica_client.cpp
  5. async_replica_client.h
  6. async_replica_client_test.cpp
  7. BUILD
  8. consensus_manager.cpp
  9. consensus_manager.h
  10. consensus_manager_test.cpp
  11. mock_async_replica_client.h
  12. mock_replica_communicator.h
  13. mock_service_interface.h
  14. README.md
  15. replica_communicator.cpp
  16. replica_communicator.h
  17. replica_communicator_test.cpp
  18. server_comm.h
  19. service_interface.cpp
  20. service_interface.h
  21. service_network.cpp
  22. service_network.h
  23. service_network_test.cpp
platform/networkstrate/README.md

Licensed to the Apache Software Foundation (ASF) under one

or more contributor license agreements. See the NOTICE file

distributed with this work for additional information

regarding copyright ownership. The ASF licenses this file

to you under the Apache License, Version 2.0 (the

“License”); you may not use this file except in compliance

with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,

software distributed under the License is distributed on an

“AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

KIND, either express or implied. See the License for the

specific language governing permissions and limitations

under the License.

NexresRPC contains three components: Acceptor, Service, and ReplicaClient.

  • Acceptor runs two types of connections: Long Connection that is built between internal services, and Short Connection that is connected from the user clients.

    • Long Connection uses an Async Acceptor, which uses the boost::asio library as the core io operator, to manage the socket channels.
    • Short Connection uses the standard tcp socket library to accept a client request. The client socket information will be passed to the service in case they need to send messages back to the client. The incoming messages will be pushed into the message input queue(MIQ).
  • Service runs multiple workers which keep watching the incoming messages from MIQ, popping and executing. Messages that need to be delivered to other services will be pushed into the message output queue(MOQ).

  • ReplicaClient is also an asnychronous io client which uses the boost::asio library to send out the messages from MOQ as well. Async Replica Client handlers a few numbers of boost::io_service so as to fully utilize the IO write. Messages from MOQ will be grouped as one batch to reduce the IO latency.