greenplumn CSerializableMDAccessor 源码
greenplumn CSerializableMDAccessor 代码
文件路径:/src/backend/gporca/libgpopt/src/minidump/CSerializableMDAccessor.cpp
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2011 EMC Corp.
//
// @filename:
// CSerializableMDAccessor.cpp
//
// @doc:
// Wrapper for serializing MD objects
//---------------------------------------------------------------------------
#include "gpopt/minidump/CSerializableMDAccessor.h"
#include "gpos/base.h"
#include "gpos/error/CErrorContext.h"
#include "gpos/task/CTask.h"
#include "gpopt/mdcache/CMDAccessor.h"
#include "naucrates/dxl/xml/CDXLSections.h"
using namespace gpos;
using namespace gpopt;
using namespace gpdxl;
//---------------------------------------------------------------------------
// @function:
// CSerializableMDAccessor::CSerializableMDAccessor
//
// @doc:
// Ctor
//
//---------------------------------------------------------------------------
CSerializableMDAccessor::CSerializableMDAccessor(CMDAccessor *md_accessor)
: CSerializable(), m_pmda(md_accessor)
{
GPOS_ASSERT(nullptr != md_accessor);
}
//---------------------------------------------------------------------------
// @function:
// CSerializableMDAccessor::SerializeHeader
//
// @doc:
// Serialize header into provided stream
//
//---------------------------------------------------------------------------
void
CSerializableMDAccessor::SerializeHeader(COstream &oos)
{
oos << CDXLSections::m_wszMetadataHeaderPrefix;
m_pmda->SerializeSysid(oos);
// serialize header suffix ">"
oos << CDXLSections::m_wszMetadataHeaderSuffix;
}
//---------------------------------------------------------------------------
// @function:
// CSerializableMDAccessor::SerializeFooter
//
// @doc:
// Serialize footer into provided stream
//
//---------------------------------------------------------------------------
void
CSerializableMDAccessor::SerializeFooter(COstream &oos)
{
oos << CDXLSections::m_wszMetadataFooter;
}
//---------------------------------------------------------------------------
// @function:
// CSerializableMDAccessor::Serialize
//
// @doc:
// Serialize contents into provided stream
//
//---------------------------------------------------------------------------
void
CSerializableMDAccessor::Serialize(COstream &oos)
{
SerializeHeader(oos);
m_pmda->Serialize(oos);
SerializeFooter(oos);
}
// EOF
相关信息
相关文章
greenplumn CMetadataAccessorFactory 源码
greenplumn CMinidumperUtils 源码
greenplumn CSerializableOptimizerConfig 源码
greenplumn CSerializablePlan 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦