CConfigParamMapping.h 1.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//---------------------------------------------------------------------------
//	Greenplum Database
//	Copyright (C) 2012 EMC Corp.
//
//	@filename:
//		CConfigParamMapping.h
//
//	@doc:
//		Mapping of GPDB config params to traceflags
//
//	@test:
//
//
//---------------------------------------------------------------------------
#ifndef GPOPT_CGUCMapping_H
#define GPOPT_CGUCMapping_H

#include "gpos/base.h"
#include "gpos/common/CBitSet.h"
20
#include "gpos/memory/CMemoryPool.h"
21

22
#include "naucrates/traceflags/traceflags.h"
23 24 25 26 27

using namespace gpos;

namespace gpdxl
{
J
Jesse Zhang 已提交
28 29 30 31 32 33 34 35 36 37 38 39
//---------------------------------------------------------------------------
//	@class:
//		CConfigParamMapping
//
//	@doc:
//		Functionality for mapping GPDB config params to traceflags
//
//---------------------------------------------------------------------------
class CConfigParamMapping
{
private:
	//------------------------------------------------------------------
40
	//	@class:
J
Jesse Zhang 已提交
41
	//		SConfigMappingElem
42 43
	//
	//	@doc:
J
Jesse Zhang 已提交
44 45
	//		Unit describing the mapping of a single GPDB config param
	//		to a trace flag
46
	//
J
Jesse Zhang 已提交
47 48
	//------------------------------------------------------------------
	struct SConfigMappingElem
49
	{
J
Jesse Zhang 已提交
50 51
		// trace flag
		EOptTraceFlag m_trace_flag;
52

J
Jesse Zhang 已提交
53 54
		// config param address
		BOOL *m_is_param;
55

J
Jesse Zhang 已提交
56 57
		// if true, we negate the config param value before setting traceflag value
		BOOL m_negate_param;
58

J
Jesse Zhang 已提交
59 60 61
		// description
		const WCHAR *description_str;
	};
62

J
Jesse Zhang 已提交
63 64
	// array of mapping elements
	static SConfigMappingElem m_elements[];
65

J
Jesse Zhang 已提交
66 67
	// private ctor
	CConfigParamMapping(const CConfigParamMapping &);
68

J
Jesse Zhang 已提交
69 70 71 72 73
public:
	// pack enabled optimizer config params in a traceflag bitset
	static CBitSet *PackConfigParamInBitset(CMemoryPool *mp, ULONG xform_id);
};
}  // namespace gpdxl
74

J
Jesse Zhang 已提交
75
#endif	// ! GPOPT_CGUCMapping_H
76 77

// EOF