本文整理汇总了C++中ArrayDesc::setResidency方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayDesc::setResidency方法的具体用法?C++ ArrayDesc::setResidency怎么用?C++ ArrayDesc::setResidency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayDesc
的用法示例。
在下文中一共展示了ArrayDesc::setResidency方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inferSchema
ArrayDesc inferSchema(std::vector<ArrayDesc> schemas, std::shared_ptr<Query> query)
{
assert(schemas.size() == 0);
assert(_parameters.size() == 2);
assert(((std::shared_ptr<OperatorParam>&)_parameters[0])->getParamType() == PARAM_ARRAY_REF);
assert(((std::shared_ptr<OperatorParam>&)_parameters[1])->getParamType() == PARAM_ARRAY_REF);
std::string oldArrayName;
std::string oldNamespaceName;
std::string newArrayName;
std::string newNamespaceName;
const string &oldArrayNameOrg =
((std::shared_ptr<OperatorParamReference>&)_parameters[0])->getObjectName();
query->getNamespaceArrayNames(oldArrayNameOrg, oldNamespaceName, oldArrayName);
const string &newArrayNameOrg =
((std::shared_ptr<OperatorParamReference>&)_parameters[1])->getObjectName();
query->getNamespaceArrayNames(newArrayNameOrg, newNamespaceName, newArrayName);
if(newNamespaceName != oldNamespaceName)
{
throw USER_QUERY_EXCEPTION(
SCIDB_SE_INFER_SCHEMA, SCIDB_LE_CANNOT_RENAME_ACROSS_NAMESPACES,
_parameters[1]->getParsingContext())
<< ArrayDesc::makeQualifiedArrayName(oldNamespaceName, oldArrayName)
<< ArrayDesc::makeQualifiedArrayName(newNamespaceName, newArrayName);
}
if (scidb::namespaces::Communicator::containsArray(newNamespaceName, newArrayName))
{
throw USER_QUERY_EXCEPTION(SCIDB_SE_INFER_SCHEMA, SCIDB_LE_ARRAY_ALREADY_EXIST,
_parameters[1]->getParsingContext()) << newArrayName;
}
ArrayDesc arrDesc;
arrDesc.setDistribution(defaultPartitioning());
arrDesc.setResidency(query->getDefaultArrayResidency());
return arrDesc;
}