greenplumn CDistributionSpecStrictSingleton 源码

  • 2022-08-18
  • 浏览 (285)

greenplumn CDistributionSpecStrictSingleton 代码

文件路径:/src/backend/gporca/libgpopt/src/base/CDistributionSpecStrictSingleton.cpp

//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2013 EMC Corp.
//
//	@filename:
//		CDistributionSpecStrictSingleton.cpp
//
//	@doc:
//		Specification of strict singleton distribution
//---------------------------------------------------------------------------

#include "gpopt/base/CDistributionSpecStrictSingleton.h"

using namespace gpopt;


//---------------------------------------------------------------------------
//	@function:
//		CDistributionSpecStrictSingleton::CDistributionSpecStrictSingleton
//
//	@doc:
//		Ctor
//
//---------------------------------------------------------------------------
CDistributionSpecStrictSingleton::CDistributionSpecStrictSingleton(
	ESegmentType est)
	: CDistributionSpecSingleton(est)
{
}


//---------------------------------------------------------------------------
//	@function:
//		CDistributionSpecStrictSingleton::FSatisfies
//
//	@doc:
//		Check if this distribution spec satisfies the given one
//
//---------------------------------------------------------------------------
BOOL
CDistributionSpecStrictSingleton::FSatisfies(
	const CDistributionSpec *pdss) const
{
	if (Matches(pdss))
	{
		// exact match implies satisfaction
		return true;
	}

	if (EdtNonSingleton == pdss->Edt())
	{
		// singleton does not satisfy non-singleton requirements
		return false;
	}

	if (EdtAny == pdss->Edt())
	{
		// a singleton distribution satisfies "any"
		return true;
	}

	return (
		(EdtSingleton == pdss->Edt() || EdtStrictSingleton == pdss->Edt()) &&
		m_est == static_cast<const CDistributionSpecSingleton *>(pdss)->Est());
}



//---------------------------------------------------------------------------
//	@function:
//		CDistributionSpecStrictSingleton::OsPrint
//
//	@doc:
//		Print function
//
//---------------------------------------------------------------------------
IOstream &
CDistributionSpecStrictSingleton::OsPrint(IOstream &os) const
{
	return os << "STRICT SINGLETON (" << m_szSegmentType[m_est] << ")";
}


// EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CAutoOptCtxt 源码

greenplumn CCTEInfo 源码

greenplumn CCTEMap 源码

greenplumn CCTEReq 源码

greenplumn CCastUtils 源码

greenplumn CColConstraintsArrayMapper 源码

greenplumn CColConstraintsHashMapper 源码

greenplumn CColRef 源码

greenplumn CColRefComputed 源码

greenplumn CColRefSet 源码

0  赞