Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of the MDSTableClient class

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you what is the use of the MDSTableClient class, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

The MDSTableClient class is used to communicate with MDSTableServer, send messages to the MDSTableServer class, and receive message replies from the MDSTableServer class

MDSTableClient::handle_request () client total routing scheduling function, which calls different handle_* () functions for processing depending on the operation type of the message.

| | _ TABLESERVER_OP_QUERY_REPLY |

| | _ handle_query_result () |

| | _ TABLESERVER_OP_AGREE |

| | _ _ the reply is in the pending_prepare array |

| | _ _ set pending_ prepare [reqid] .ptid = tid |

| | _ _ set pending_ prepare [reqid] .pbl = m-> bl |

| | _ _ Delete pending_ prepare [reqid] |

| | _ _ set prepared_ update [tid] = reqid |

| | _ _ the reply is in the prepared_update array |

| | _ _ repeat reply |

| | _ _ the reply is in the pending_commit array |

| | _ _ is no longer in the above array for replies |

| | _ _ create MMDSTableRequest message (TABLESERVER_OP_ROLLBACK) |

| | _ _ mds- > send_message_mds () sends a message to Server |

| | _ TABLESERVER_OP_ACK |

| | _ _ the reply is in the pending_commit array |

| | _ _ Delete pending_ contacts [tid]-> pending_commit_ tids [table] |

| | _ _ delete pending_ contacts [tid] |

| | _ mds- > mdlog- > start_submit_entry () |

| | _ TABLESERVER_OP_SERVER_READY |

| | _ _ set server_ready = true |

| | _ resend_queries () |

| | _ resend_prepares () |

| | _ resend_commits () |

MDSTableClient::_logged_ack () writes the callback function of log for the TABLESERVER_OP_ACK operation

| | _ _ for ack_ waiters[ tid] |

| | _ _ mds- > queue_waiters (ack_ waiters[ tid]) |

| | _ _ clear ack_ waiters[ tid] |

MDSTableClient::_prepare ()

| | _ _ if tableserver is not ready, the prepare message is inserted into the waiting_for_reqid array |

| | _ _ get reqid = + + last_reqid |

| | _ _ fill pending_ prepare [reqid] array |

| _ _ if tableserver is ready |

| | _ _ create MMDSTableRequest message (TABLESERVER_OP_PREPARE) |

| | _ _ mds- > send_message_mds () sends a message to tableserver |

MDSTableClient::commit ()

| | _ _ delete prepared_ update [tid] |

| | _ _ set pending_ settings [tid] = ls |

| _ _ if tableserver is ready |

| | _ _ create MMDSTableRequest message (TABLESERVER_OP_COMMIT) |

| | _ _ mds- > send_message_mds () sends a message to tableserver |

MDSTableClient::got_journaled_agree ()

| | _ _ pending_ requests [tid] = ls |

MDSTableClient::got_journaled_ack ()

| | _ _ delete pending_ contacts [tid] |

MDSTableClient::resend_prepares ()

| | _ _ traverse the waiting_for_reqid array |

| | _ _ copy the contents of the array to pending_ preparation [+ + last_reqid] |

| | _ _ Delete the entry corresponding to waiting_for_reqid array |

| | _ _ traverse the pending_prepare array |

| | _ _ create MMDSTableRequest message (TABLESERVER_OP_PREPARE) |

| | _ _ mds- > send_message_mds () sends class messages to tableserver |

MDSTableClient::resend_commits ()

| | _ _ traverse the pending_commit array |

| | _ _ create MMDSTableRequest message (TABLESERVER_OP_COMMIT) |

| | _ _ mds- > send_message_mds () sends class messages to tableserver |

MDSTableClient::handle_mds_failure ()

| | _ _ set server_ready = false |

SnapClient class inherits from MDSTableClient class. In fact, SnapClient encapsulates some processing functions. The specific operation functions of SnapClient are described as follows:

SnapClient::prepare_create ()

| | _ _ set op = TABLE_OP_CREATE |

| | _ _ serialize op/dirino/name/stamp to bufferlist |

| | _ MDSTableClient::_prepare () |

SnapClient::prepare_create_realm ()

| | _ _ set op = TABLE_OP_CREATE |

| | _ _ serialize op/ino to bufferlist |

| | _ MDSTableClient::_prepare () |

SnapClient::prepare_destroy ()

| | _ _ set op = TABLE_OP_DESTROY |

| | _ _ serialize op/ino/snapid to bufferlist |

| | _ MDSTableClient::_prepare () |

SnapClient::prepare_update ()

| | _ _ set op = TABLE_OP_UPDATE |

| | _ _ serialize op/ino/snapid/name/stamp to bufferlist |

| | _ MDSTableClient::_prepare () |

The correspondence between SnapClient and MDSTableClient is shown in the following figure:

The above is all the content of this article "what is the use of MDSTableClient classes?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report