本文整理汇总了C++中KEY::has_locality_manager方法的典型用法代码示例。如果您正苦于以下问题:C++ KEY::has_locality_manager方法的具体用法?C++ KEY::has_locality_manager怎么用?C++ KEY::has_locality_manager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KEY
的用法示例。
在下文中一共展示了KEY::has_locality_manager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finalize_sub_plan
void Locality_Splitter::finalize_sub_plan (
Deployment::DeploymentPlan &sub_plan,
KEY &sub_plan_key)
{
DANCEX11_LOG_TRACE ("Locality_Splitter::finalize_sub_plan");
// check for availability of LocalityManager instance
if (!sub_plan_key.has_locality_manager ())
{
// add minimal default LocalityManager instance to sub plan
uint32_t impl_index = sub_plan.implementation ().size ();
sub_plan.implementation ().push_back (::Deployment::MonolithicDeploymentDescription ());
uint32_t inst_index = sub_plan.instance ().size ();
sub_plan.instance ().push_back (::Deployment::InstanceDeploymentDescription ());
sub_plan.instance ().back ().implementationRef (impl_index);
// set correct implementation type
Deployment::Property exec_property;
exec_property.name (IMPL_TYPE);
exec_property.value () <<= DANCE_LOCALITYMANAGER;
sub_plan.implementation ().back ().execParameter ().push_back (exec_property);
// create unique name for Locality Manager
ACE_Utils::UUID uuid;
ACE_Utils::UUID_GENERATOR::instance ()->generate_UUID (uuid);
std::string lm_name ("Locality Manager [");
lm_name += uuid.to_string ()->c_str ();
lm_name += "]";
sub_plan.instance ().back ().name (lm_name);
DANCEX11_LOG_TRACE ("Locality_Splitter::finalize_sub_plan - " <<
"No locality manager found, created a default locality named<" <<
sub_plan.instance ().back ().name () << ">");
// add instance to sub plan key
sub_plan_key.add_instance (inst_index);
// mark as locality manager
sub_plan_key.locality_manager_instance (
sub_plan_key.instances ().size () - 1);
}
}
示例2: prepare_sub_plan
void Locality_Splitter::prepare_sub_plan (
uint32_t instance,
Deployment::DeploymentPlan &sub_plan,
KEY &sub_plan_key)
{
DANCEX11_LOG_TRACE ("Locality_Splitter::prepare_sub_plan");
// first time?
if (sub_plan_key.uuid ().empty ())
{
// use UUID to uniquely identify sub plan key
sub_plan_key.uuid (sub_plan.UUID ());
}
if (sub_plan_key.node () != this->plan_.instance ()[instance].node ())
{
// set sub plan key to node name for instance
sub_plan_key.node (this->plan_.instance ()[instance].node ());
}
if (!sub_plan_key.has_instance (instance))
{
sub_plan_key.add_instance (instance);
if (!sub_plan_key.has_locality_manager ())
{
// check if this is the LocalityManager instance
uint32_t impl_idx =
this->plan_.instance ()[instance].implementationRef ();
if (impl_idx >= this->plan_.implementation ().size ())
{
DANCEX11_LOG_ERROR ("Locality_Splitter::prepare_sub_plan - " <<
"Invalid implementation index");
}
else
{
const std::string instance_type =
DAnCE::Utility::get_instance_type (
plan_.implementation ()[impl_idx].execParameter ());
if (!instance_type.empty ())
{
if (instance_type == DANCE_LOCALITYMANAGER)
{
// mark locality manager instance offset
sub_plan_key.locality_manager_instance (
sub_plan_key.instances ().size () - 1);
DANCEX11_LOG_TRACE ("Locality_Splitter::prepare_sub_plan - " <<
"Found locality manager instance " <<
instance << ":" << plan_.instance ()[instance].name ());
}
}
}
}
}
if (sub_plan.label ().empty ())
{
// derive descriptive label
std::string sub_label ("Split plan from ");
if (!this->plan_.label ().empty ())
{
sub_label += this->plan_.label ();
}
else
{
sub_label += this->plan_.UUID ();
}
sub_label += " for a Locality on Node ";
sub_label += sub_plan_key.node ();
sub_plan.label (sub_label);
}
}