本文整理汇总了C++中CDistributionSpec::FSingletonOrStrictSingleton方法的典型用法代码示例。如果您正苦于以下问题:C++ CDistributionSpec::FSingletonOrStrictSingleton方法的具体用法?C++ CDistributionSpec::FSingletonOrStrictSingleton怎么用?C++ CDistributionSpec::FSingletonOrStrictSingleton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDistributionSpec
的用法示例。
在下文中一共展示了CDistributionSpec::FSingletonOrStrictSingleton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GPOS_NEW
//---------------------------------------------------------------------------
// @function:
// CPhysicalSequence::PdsRequired
//
// @doc:
// Compute required distribution of the n-th child
//
//---------------------------------------------------------------------------
CDistributionSpec *
CPhysicalSequence::PdsRequired
(
IMemoryPool *pmp,
CExpressionHandle &
#ifdef GPOS_DEBUG
exprhdl
#endif // GPOS_DEBUG
,
CDistributionSpec *pdsRequired,
ULONG ulChildIndex,
DrgPdp *pdrgpdpCtxt,
ULONG ulOptReq
)
const
{
GPOS_ASSERT(2 == exprhdl.UlArity());
GPOS_ASSERT(ulChildIndex < exprhdl.UlArity());
GPOS_ASSERT(ulOptReq < UlDistrRequests());
if (0 == ulOptReq)
{
if (CDistributionSpec::EdtSingleton == pdsRequired->Edt() ||
CDistributionSpec::EdtStrictSingleton == pdsRequired->Edt())
{
// incoming request is a singleton, request singleton on all children
CDistributionSpecSingleton *pdss = CDistributionSpecSingleton::PdssConvert(pdsRequired);
return GPOS_NEW(pmp) CDistributionSpecSingleton(pdss->Est());
}
// incoming request is a non-singleton, request non-singleton on all children
return GPOS_NEW(pmp) CDistributionSpecNonSingleton();
}
GPOS_ASSERT(1 == ulOptReq);
if (0 == ulChildIndex)
{
// no distribution requirement on first child
return GPOS_NEW(pmp) CDistributionSpecAny(this->Eopid());
}
// get derived plan properties of first child
CDrvdPropPlan *pdpplan = CDrvdPropPlan::Pdpplan((*pdrgpdpCtxt)[0]);
CDistributionSpec *pds = pdpplan->Pds();
if (pds->FSingletonOrStrictSingleton())
{
// first child is singleton, request singleton distribution on second child
CDistributionSpecSingleton *pdss = CDistributionSpecSingleton::PdssConvert(pds);
return GPOS_NEW(pmp) CDistributionSpecSingleton(pdss->Est());
}
if (CDistributionSpec::EdtUniversal == pds->Edt())
{
// first child is universal, impose no requirements on second child
return GPOS_NEW(pmp) CDistributionSpecAny(this->Eopid());
}
// first child is non-singleton, request a non-singleton distribution on second child
return GPOS_NEW(pmp) CDistributionSpecNonSingleton();
}