Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
refactor(rpc): refactor request meta & add support for backup request (
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao authored Feb 7, 2020
1 parent 0941e76 commit 2efa13d
Show file tree
Hide file tree
Showing 8 changed files with 1,047 additions and 149 deletions.
97 changes: 97 additions & 0 deletions include/dsn/cpp/serialization_helper/dsn.layer2_types.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions include/dsn/tool-api/rpc_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ typedef union msg_context
uint64_t unused : 4; ///< not used yet
uint64_t serialize_format : 4; ///< dsn_msg_serialize_format
uint64_t is_forward_supported : 1; ///< whether support forwarding a message to real leader
uint64_t reserved : 53;
uint64_t is_backup_request : 1; ///< whether the RPC is a backup request
uint64_t reserved : 52;
} u;
uint64_t context; ///< msg_context is of sizeof(uint64_t)
} msg_context_t;
Expand Down Expand Up @@ -208,6 +209,8 @@ class message_ex : public ref_counter,
size_t body_size() { return (size_t)header->body_length; }
DSN_API void *rw_ptr(size_t offset_begin);

bool is_backup_request() const { return header->context.u.is_backup_request; }

private:
DSN_API message_ex();
DSN_API void prepare_buffer_header();
Expand All @@ -228,4 +231,4 @@ class message_ex : public ref_counter,
};
typedef dsn::ref_ptr<message_ex> message_ptr;

} // end namespace
} // namespace dsn
210 changes: 210 additions & 0 deletions src/core/core/dsn.layer2_types.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2efa13d

Please sign in to comment.