本文整理汇总了C++中mutation_ptr::prepare_msg方法的典型用法代码示例。如果您正苦于以下问题:C++ mutation_ptr::prepare_msg方法的具体用法?C++ mutation_ptr::prepare_msg怎么用?C++ mutation_ptr::prepare_msg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mutation_ptr
的用法示例。
在下文中一共展示了mutation_ptr::prepare_msg方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy_from
void mutation::copy_from(mutation_ptr& old)
{
data.updates = old->data.updates;
client_requests = old->client_requests;
_appro_data_bytes = old->_appro_data_bytes;
_create_ts_ns = old->_create_ts_ns;
for (auto& r : client_requests)
{
if (r != nullptr)
{
dsn_msg_add_ref(r); // release in dctor
}
}
// let's always re-append the mutation to
// replication logs as the ballot number
// is changed, to ensure the invariance:
// if decree(A) >= decree(B)
// then ballot(A) >= ballot(B)
/*if (old->is_logged())
{
set_logged();
data.header.log_offset = old->data.header.log_offset;
}
*/
_prepare_request = old->prepare_msg();
if (_prepare_request)
{
dsn_msg_add_ref(_prepare_request);
}
}
示例2: ack_prepare_message
void replica::ack_prepare_message(error_code err, mutation_ptr& mu)
{
prepare_ack resp;
resp.gpid = get_gpid();
resp.err = err;
resp.ballot = get_ballot();
resp.decree = mu->data.header.decree;
// for PS_POTENTIAL_SECONDARY ONLY
resp.last_committed_decree_in_app = _app->last_committed_decree();
resp.last_committed_decree_in_prepare_list = last_committed_decree();
dassert(nullptr != mu->prepare_msg(), "");
reply(mu->prepare_msg(), resp);
ddebug("%s: mutation %s ack_prepare_message, err = %s", name(), mu->name(), err.to_string());
}
示例3: move_from
void mutation::move_from(mutation_ptr& old)
{
data.updates = std::move(old->data.updates);
rpc_code = old->rpc_code;
_client_request = old->client_msg();
if (_client_request)
{
old->_client_request = nullptr;
}
_prepare_request = old->prepare_msg();
if (_prepare_request)
{
old->_prepare_request = nullptr;
}
}
示例4: copy_from
void mutation::copy_from(mutation_ptr& old)
{
data.updates = old->data.updates;
rpc_code = old->rpc_code;
if (old->is_logged())
{
set_logged();
data.header.log_offset = old->data.header.log_offset;
}
_client_request = old->client_msg();
if (_client_request)
{
dsn_msg_add_ref(_client_request);
}
_prepare_request = old->prepare_msg();
if (_prepare_request)
{
dsn_msg_add_ref(_prepare_request);
}
}