greenplumn CMDKey 源码

2022-08-18 浏览 (329)

greenplumn CMDKey 代码

文件路径:/src/backend/gporca/libgpopt/src/mdcache/CMDKey.cpp

/---------------------------------------------------------------------------
/	Greenplum Database
/	Copyright (C) 2011 EMC Corp.
/
/	@filename:
/		CMDKey.cpp
/
/	@doc:
/		Implementation of a key for metadata cache objects
/---------------------------------------------------------------------------

#include "gpopt/mdcache/CMDKey.h"

#include "gpos/io/COstreamString.h"

#include "naucrates/dxl/CDXLUtils.h"

using namespace gpos;
using namespace gpmd;
using namespace gpopt;


/---------------------------------------------------------------------------
/	@function:
/		CMDKey::CMDKey
/
/	@doc:
/		Constructs a md cache key
/
/---------------------------------------------------------------------------
CMDKey::CMDKey(const IMDId *mdid) : m_mdid(mdid)
{
	GPOS_ASSERT(mdid->IsValid());
}

/---------------------------------------------------------------------------
/	@function:
/		CMDKey::Equals
/
/	@doc:
/		Equality function
/
/---------------------------------------------------------------------------
BOOL
CMDKey::Equals(const CMDKey &mdkey) const
{
	return mdkey.MDId()->Equals(m_mdid);
}

/---------------------------------------------------------------------------
/	@function:
/		CMDKey::FEqualMDKey
/
/	@doc:
/		Equality function for using MD keys in a cache
/
/---------------------------------------------------------------------------
BOOL
CMDKey::FEqualMDKey(CMDKey *const &pvLeft, CMDKey *const &pvRight)
{
	if (nullptr == pvLeft && nullptr == pvRight)
	{
		return true;
	}

	if (nullptr == pvLeft || nullptr == pvRight)
	{
		return false;
	}

	GPOS_ASSERT(nullptr != pvLeft && nullptr != pvRight);

	return pvLeft->MDId()->Equals(pvRight->MDId());
}

/---------------------------------------------------------------------------
/	@function:
/		CMDKey::HashValue
/
/	@doc:
/		Hash function
/
/---------------------------------------------------------------------------
ULONG
CMDKey::HashValue() const
{
	return m_mdid->HashValue();
}

/---------------------------------------------------------------------------
/	@function:
/		CMDKey::UlHashMDKey
/
/	@doc:
/		Hash function for using MD keys in a cache
/
/---------------------------------------------------------------------------
ULONG
CMDKey::UlHashMDKey(CMDKey *const &pv)
{
	return pv->MDId()->HashValue();
}

/ EOF

相关信息

greenplumn 源码目录

相关文章

greenplumn CMDAccessor 源码

greenplumn CMDAccessorUtils 源码

greenplumn CMDCache 源码

  • 所属分类: 大数据
  • 本文标签: greenplum
  • 版权声明: 本文链接 https://seaxiang.com/blog/99d188a2f4c94bfc98848eb357d517c3