hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ent...@apache.org
Subject incubator-hawq git commit: HAWQ-221. Cleanup unused files related to optimizer
Date Fri, 04 Dec 2015 22:34:14 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 099717d29 -> ad8ed914d


HAWQ-221. Cleanup unused files related to optimizer

Closes #159.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/ad8ed914
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/ad8ed914
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/ad8ed914

Branch: refs/heads/master
Commit: ad8ed914df9919cb09c6f50e5f78f1f5519b303b
Parents: 099717d
Author: Entong Shen <shenentong@gmail.com>
Authored: Thu Dec 3 13:21:07 2015 -0800
Committer: Entong Shen <shenentong@gmail.com>
Committed: Fri Dec 4 14:33:08 2015 -0800

----------------------------------------------------------------------
 src/backend/gpopt/utils/COptClient.cpp | 427 ---------------------
 src/backend/gpopt/utils/COptServer.cpp | 568 ----------------------------
 src/backend/gpopt/utils/Makefile       |   4 +-
 src/backend/gpopt/utils/funcs.cpp      |  41 --
 src/backend/optimizer/plan/planner.c   |  13 -
 src/backend/postmaster/Makefile        |   2 +-
 src/backend/postmaster/optserver.c     | 257 -------------
 src/backend/postmaster/postmaster.c    |  10 -
 src/include/postmaster/optserver.h     |  48 ---
 9 files changed, 3 insertions(+), 1367 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/gpopt/utils/COptClient.cpp
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/utils/COptClient.cpp b/src/backend/gpopt/utils/COptClient.cpp
deleted file mode 100644
index f7ba486..0000000
--- a/src/backend/gpopt/utils/COptClient.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-//---------------------------------------------------------------------------
-//	Greenplum Database
-//	Copyright (C) 2012 EMC Corp.
-//
-//	@filename:
-//		COptClient.cpp
-//
-//	@doc:
-//		Implementation of communication handler for message exchange
-//		between OPT and QD
-//
-//	@owner:
-//		solimm1
-//
-//	@test:
-//
-//---------------------------------------------------------------------------
-
-#define ALLOW_printf
-#define ALLOW_sigsetjmp
-#define ALLOW_DatumGetPointer
-#define ALLOW_ntohl
-
-#include "gpopt/utils/gpdbdefs.h"
-#include "gpopt/config/CConfigParamMapping.h"
-#include "gpopt/relcache/CMDProviderRelcache.h"
-#include "gpopt/translate/CStateDXLToQuery.h"
-#include "gpopt/translate/CTranslatorUtils.h"
-#include "gpopt/translate/CTranslatorQueryToDXL.h"
-#include "gpopt/translate/CTranslatorDXLToPlStmt.h"
-#include "gpopt/translate/CTranslatorDXLToQuery.h"
-#include "gpopt/translate/CContextDXLToPlStmt.h"
-#include "gpopt/translate/CTranslatorRelcacheToDXL.h"
-
-#include "cdb/cdbvars.h"
-#include "utils/guc.h"
-
-#include "gpos/_api.h"
-#include "gpos/base.h"
-#include "gpos/common/CAutoP.h"
-#include "gpos/common/CBitSetIter.h"
-#include "gpos/error/CErrorHandlerStandard.h"
-#include "gpos/io/COstreamString.h"
-#include "gpos/memory/CAutoMemoryPool.h"
-#include "gpos/net/CSocketConnectorUDS.h"
-#include "gpos/string/CWStringDynamic.h"
-
-#include "gpopt/base/CAutoOptCtxt.h"
-#include "gpopt/mdcache/CAutoMDAccessor.h"
-#include "gpopt/xforms/CXform.h"
-
-#include "naucrates/exception.h"
-#include "naucrates/comm/CCommunicator.h"
-#include "naucrates/dxl/operators/CDXLNode.h"
-#include "naucrates/dxl/CDXLUtils.h"
-#include "naucrates/dxl/CIdGenerator.h"
-#include "naucrates/md/CMDProviderCommProxy.h"
-#include "naucrates/md/CSystemId.h"
-
-#include "gpopt/utils/COptClient.h"
-#include "gpopt/gpdbwrappers.h"
-
-using namespace gpos;
-using namespace gpnaucrates;
-using namespace gpoptudfs;
-
-// initialization of static members
-const CSystemId COptClient::m_sysidDefault(IMDId::EmdidGPDB, GPOS_WSZ_STR_LENGTH("GPDB"));
-
-ULONG COptClient::m_rgrgulSev[CException::ExsevSentinel][2] =
-{
-	{CException::ExsevInvalid, LOG},
-	{CException::ExsevPanic, PANIC},
-	{CException::ExsevFatal, FATAL},
-	{CException::ExsevError, ERROR},
-	{CException::ExsevWarning, WARNING},
-	{CException::ExsevNotice, NOTICE},
-	{CException::ExsevTrace, LOG},
-};
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::PvRun
-//
-//	@doc:
-//		Invoke optimizer instance
-//
-//---------------------------------------------------------------------------
-void *
-COptClient::PvRun
-	(
-	void *pv
-	)
-{
-	for (ULONG ul = 0; ul < (ULONG) optimizer_retries; ul++)
-	{
-		CErrorHandlerStandard errhdl;
-		GPOS_TRY_HDL(&errhdl)
-		{
-			COptClient optProc((SOptParams *) pv);
-			return optProc.PplstmtOptimize();
-		}
-		GPOS_CATCH_EX(ex)
-		{
-			if (!GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiNetError) ||
-			    ul + 1 == (ULONG) optimizer_retries)
-			{
-				GPOS_RETHROW(ex);
-			}
-
-			GPOS_RESET_EX;
-		}
-		GPOS_CATCH_END;
-	}
-
-	return NULL;
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::PplstmtOptimize
-//
-//	@doc:
-//		Request optimization from server
-//
-//---------------------------------------------------------------------------
-PlannedStmt *
-COptClient::PplstmtOptimize()
-{
-	ITask::PtskSelf()->PlogErr()->SetErrorInfoLevel(ILogger::EeilMsg);
-
-	CAutoMemoryPool amp
-		(
-		CAutoMemoryPool::ElcNone,
-		CMemoryPoolManager::EatMalloc,
-		false /*fThreadSafe*/
-		);
-	m_pmp = amp.Pmp();
-
-	// scope for socket connector
-	{
-		// setup communication with server
-		CSocketConnectorUDS sc(m_pmp, m_szPath);
-		sc.Connect();
-		CCommunicator comm(m_pmp, sc.Psocket());
-		m_pcomm = &comm;
-
-		SetTraceflags();
-
-		// scope for MD provider
-		{
-			IMDProvider *pmdp = New(m_pmp) CMDProviderRelcache(m_pmp);
-
-			// scope for MD accessor
-			{
-				CAutoMDAccessor amda(m_pmp, pmdp, m_sysidDefault);
-
-				// scope for optimization context
-				{
-					COptimizerConfig *poconfig = NULL;
-					// install opt context in TLS
-					CAutoOptCtxt aoc
-					  (
-					   m_pmp,
-					   amda.Pmda(),
-					   NULL, /* IConstExprEvaluator */
-					   poconfig
-					  );
-
-					// send request to client
-					SendRequest(amda.Pmda());
-
-					// retrieve serialized plan
-					const CHAR *szPlanDXL = SzPlanDXL(pmdp);
-
-					// create and return planned statement
-					return PplstmtConstruct(amda.Pmda(), szPlanDXL);
-				}
-			}
-		}
-	}
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::SetTraceflags
-//
-//	@doc:
-//		Set trace flags to current task
-//
-//---------------------------------------------------------------------------
-void
-COptClient::SetTraceflags()
-{
-	CBitSet *pbs = CConfigParamMapping::PbsPack(m_pmp, CXform::ExfSentinel);
-
-	CWStringDynamic str(m_pmp);
-	COstreamString oss(&str);
-
-	oss << "Traceflags: " << *pbs;
-	Elog(CException::ExsevNotice, str.Wsz());
-
-	// scope for iterator
-	{
-		CBitSetIter bsi(*pbs);
-		while (bsi.FAdvance())
-		{
-			GPOS_SET_TRACE(bsi.UlBit());
-		}
-	}
-
-	pbs->Release();
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::SendRequest
-//
-//	@doc:
-//		Send query optimization request to server
-//
-//---------------------------------------------------------------------------
-void
-COptClient::SendRequest
-	(
-	CMDAccessor *pmda
-	)
-{
-	GPOS_ASSERT(NULL != m_pmp);
-	GPOS_ASSERT(NULL != m_pcomm);
-
-	// translate query to DXL
-	CIdGenerator *pidgtorCol = New(m_pmp) CIdGenerator(GPDXL_COL_ID_START);
-	CIdGenerator *pidgtorCTE = New(m_pmp) CIdGenerator(GPDXL_CTE_ID_START);
-	CMappingVarColId *pmapvarcolid = New(m_pmp) CMappingVarColId(m_pmp);
-	CAutoP<CTranslatorQueryToDXL> ptrquerytodxl;
-	ptrquerytodxl = CTranslatorQueryToDXL::PtrquerytodxlInstance
-					(
-					m_pmp,
-					pmda,
-					pidgtorCol,
-					pidgtorCTE,
-					pmapvarcolid,
-					m_pquery,
-					0 // ulQueryLevel
-					);
-
-	CDXLNode *pdxlnRoot = ptrquerytodxl->PdxlnFromQuery();
-	DrgPdxln *pdrgpdxlnQueryOutput = ptrquerytodxl->PdrgpdxlnQueryOutput();
-	DrgPdxln *pdrgpdxlnCTE = ptrquerytodxl->PdrgpdxlnCTE();
-	GPOS_ASSERT(NULL != pdrgpdxlnQueryOutput);
-
-	CWStringDynamic *pstrQuery = CDXLUtils::PstrSerializeQuery
-		(
-		m_pmp,
-		pdxlnRoot,
-		pdrgpdxlnQueryOutput,
-		pdrgpdxlnCTE,
-		true /*fDocumentHeaderFootter*/,
-		false /*fIndent*/
-		);
-
-	// create optimization request message and send it
-	CCommMessage msg(CCommMessage::EcmtOptRequest, pstrQuery->Wsz(), 0 /*ullUserData*/);
-	m_pcomm->SendMsg(&msg);
-
-	// clean up
-	delete pstrQuery;
-	pdxlnRoot->Release();
-	pdrgpdxlnQueryOutput->Release();
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::SzPlanDXL
-//
-//	@doc:
-//		Retrieve DXL plan
-//
-//---------------------------------------------------------------------------
-const CHAR *
-COptClient::SzPlanDXL
-	(
-	IMDProvider *pmdp
-	)
-{
-	GPOS_ASSERT(NULL != m_pmp);
-	GPOS_ASSERT(NULL != m_pcomm);
-
-	const CHAR *szPlan = NULL;
-	CMDProviderCommProxy mdpcp(m_pmp, pmdp);
-
-	while (NULL == szPlan)
-	{
-		CCommMessage *pmsg = m_pcomm->PmsgReceiveMsg();
-		switch (pmsg->Ecmt())
-		{
-			case CCommMessage::EcmtMDRequest:
-				SendMDResponse(&mdpcp, pmsg->Wsz());
-				break;
-
-			case CCommMessage::EcmtLog:
-				// log message
-				Elog((ULONG) pmsg->UllInfo(), pmsg->Wsz());
-				break;
-
-			case CCommMessage::EcmtOptResponse:
-				szPlan = CDXLUtils::SzFromWsz(m_pmp, pmsg->Wsz());
-				break;
-
-			default:
-				GPOS_RAISE(gpdxl::ExmaComm, gpdxl::ExmiCommUnexpectedMessage, pmsg->Ecmt());
-		}
-
-		delete [] pmsg->Wsz();
-		delete pmsg;
-	}
-
-	GPOS_ASSERT(NULL != szPlan);
-
-	return szPlan;
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::SendMDResponse
-//
-//	@doc:
-//		Send MD response
-//
-//---------------------------------------------------------------------------
-void
-COptClient::SendMDResponse
-	(
-	CMDProviderCommProxy *pmdpcp,
-	const WCHAR *wszReq
-	)
-{
-	GPOS_ASSERT(NULL != m_pmp);
-	GPOS_ASSERT(NULL != m_pcomm);
-
-	CWStringBase *pstrResponse = pmdpcp->PstrObject(wszReq);
-
-	// send response
-	CCommMessage msgResponse(CCommMessage::EcmtMDResponse, pstrResponse->Wsz(), 0 /*ullUserData*/);
-	m_pcomm->SendMsg(&msgResponse);
-
-	delete pstrResponse;
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::PplstmtConstruct
-//
-//	@doc:
-//		Build planned statement from serialized plan
-//
-//---------------------------------------------------------------------------
-PlannedStmt *
-COptClient::PplstmtConstruct
-	(
-	CMDAccessor *pmda,
-	const CHAR *szPlan
-	)
-{
-	GPOS_ASSERT(NULL != m_pmp);
-
-	CIdGenerator idgtorPlanId(1 /* ulStartId */);
-	CIdGenerator idgtorMotionId(1 /* ulStartId */);
-	CIdGenerator idgtorParamId(0 /* ulStartId */);
-
-	List *plRTable = NULL;
-	List *plSubplans = NULL;
-
-	CContextDXLToPlStmt ctxdxltoplstmt
-		(
-		m_pmp,
-		&idgtorPlanId,
-		&idgtorMotionId,
-		&idgtorParamId,
-		&plRTable,
-		&plSubplans
-		);
-
-	// translate DXL -> PlannedStmt
-	CTranslatorDXLToPlStmt trdxltoplstmt(m_pmp, pmda, &ctxdxltoplstmt, gpdb::UlSegmentCountGP());
-	ULLONG ullPlanId = 0;
-	ULLONG ullPlanSpaceSize = 0;
-	CDXLNode *pdxlnPlan = CDXLUtils::PdxlnParsePlan(m_pmp, szPlan, NULL /*szXSDPath*/, &ullPlanId,
&ullPlanSpaceSize);
-	PlannedStmt *pplstmt = trdxltoplstmt.PplstmtFromDXL(pdxlnPlan);
-
-	GPOS_ASSERT(NULL != pplstmt);
-	GPOS_ASSERT(CurrentMemoryContext);
-
-	return (PlannedStmt *) gpdb::PvCopyObject(pplstmt);;
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptClient::Elog
-//
-//	@doc:
-//		elog wrapper
-//
-//---------------------------------------------------------------------------
-void
-COptClient::Elog
-	(
-	ULONG ulSev,
-	const WCHAR *wszMsg
-	)
-{
-	GPOS_ASSERT(CException::ExsevSentinel > ulSev);
-	GPOS_ASSERT(m_rgrgulSev[ulSev][0] == ulSev);
-
-	PG_TRY();
-	{
-		elog(m_rgrgulSev[ulSev][1], "%ls", wszMsg);
-	}
-	PG_CATCH();
-	{
-		GPOS_RAISE(gpdxl::ExmaGPDB, gpdxl::ExmiGPDBError);
-	}
-	PG_END_TRY();
-}
-
-// EOF

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/gpopt/utils/COptServer.cpp
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/utils/COptServer.cpp b/src/backend/gpopt/utils/COptServer.cpp
deleted file mode 100644
index 695538a..0000000
--- a/src/backend/gpopt/utils/COptServer.cpp
+++ /dev/null
@@ -1,568 +0,0 @@
-//---------------------------------------------------------------------------
-//	Greenplum Database
-//	Copyright (C) 2012 EMC Corp.
-//
-//	@filename:
-//		COptServer.cpp
-//
-//	@doc:
-//		Implementation of communication handler for message exchange
-//		between OPT and QD
-//
-//	@owner:
-//		solimm1
-//
-//	@test:
-//
-//
-//---------------------------------------------------------------------------
-
-#define ALLOW_DatumGetPointer
-#define ALLOW_ntohl
-#define ALLOW_memset
-#define ALLOW_printf
-
-#include "postgres.h"
-#include "gpopt/config/CConfigParamMapping.h"
-#include "gpopt/translate/CStateDXLToQuery.h"
-#include "gpopt/translate/CTranslatorUtils.h"
-#include "gpopt/translate/CTranslatorQueryToDXL.h"
-#include "gpopt/translate/CTranslatorDXLToPlStmt.h"
-#include "gpopt/translate/CTranslatorDXLToQuery.h"
-#include "gpopt/translate/CContextDXLToPlStmt.h"
-#include "gpopt/translate/CTranslatorRelcacheToDXL.h"
-
-#include "gpos/_api.h"
-#include "gpos/base.h"
-#include "gpos/utils.h"
-#include "gpos/common/CAutoP.h"
-#include "gpos/error/CErrorHandlerStandard.h"
-#include "gpos/error/CAutoLogger.h"
-#include "gpos/memory/CAutoMemoryPool.h"
-#include "gpos/net/CAutoSocketProxy.h"
-#include "gpos/net/CSocketListenerUDS.h"
-#include "gpos/task/CAutoTaskProxy.h"
-
-#include "naucrates/base/CQueryToDXLResult.h"
-#include "naucrates/comm/CCommunicator.h"
-#include "naucrates/comm/CLoggerComm.h"
-
-#include "gpopt/base/CAutoOptCtxt.h"
-#include "gpopt/base/CQueryContext.h"
-#include "gpopt/engine/CEngine.h"
-#include "gpopt/mdcache/CAutoMDAccessor.h"
-#include "gpopt/minidump/CMiniDumperDXL.h"
-#include "gpopt/minidump/CMinidumperUtils.h"
-#include "gpopt/minidump/CSerializableStackTrace.h"
-#include "gpopt/minidump/CSerializableQuery.h"
-#include "gpopt/minidump/CSerializablePlan.h"
-#include "gpopt/minidump/CSerializableMDAccessor.h"
-#include "gpopt/translate/CTranslatorDXLToExpr.h"
-#include "gpopt/translate/CTranslatorExprToDXL.h"
-
-#include "naucrates/exception.h"
-#include "gpopt/utils/COptServer.h"
-
-#include "naucrates/dxl/operators/CDXLNode.h"
-#include "naucrates/dxl/CDXLUtils.h"
-#include "naucrates/dxl/CIdGenerator.h"
-#include "naucrates/md/CMDProviderComm.h"
-#include "naucrates/md/CSystemId.h"
-
-#include "gpopt/gpdbwrappers.h"
-
-#include "gpdbcost/CCostModelGPDB.h"
-
-using namespace gpos;
-using namespace gpmd;
-using namespace gpnaucrates;
-using namespace gpoptudfs;
-using namespace gpdbcost;
-
-#define GPOPT_FILE_NAME_LEN 		(1024)
-#define GPOPT_CONN_HT_SIZE			(ULONG(128))
-#define GPOPT_CONN_CHECK_SLEEP_MS	(ULONG(1000))
-
-// initialization of static members
-ULONG_PTR COptServer::SConnectionDescriptor::m_ulpInvalid = 0;
-const CSystemId COptServer::m_sysidDefault(IMDId::EmdidGPDB, GPOS_WSZ_STR_LENGTH("GPDB"));
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::COptServer
-//
-//	@doc:
-//		Ctor
-//
-//---------------------------------------------------------------------------
-COptServer::COptServer
-	(
-	const CHAR *szSocketPath
-	)
-	:
-	m_szSocketPath(szSocketPath),
-	m_pshtConnections(NULL)
-{}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::~COptServer
-//
-//	@doc:
-//		Dtor
-//
-//---------------------------------------------------------------------------
-COptServer::~COptServer()
-{}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::PvRun
-//
-//	@doc:
-//		Invoke optimizer instance
-//
-//---------------------------------------------------------------------------
-void *
-COptServer::PvRun
-	(
-	void *pv
-	)
-{
-	COptServer optProc((const char *) pv);
-	optProc.Loop();
-
-	return NULL;
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::Loop
-//
-//	@doc:
-//		Start serving requests
-//
-//---------------------------------------------------------------------------
-void
-COptServer::Loop()
-{
-	CAutoMemoryPool amp
-		(
-		CAutoMemoryPool::ElcNone,
-		CMemoryPoolManager::EatMalloc,
-		true /*fThreadSafe*/
-		);
-
-	m_pmp = amp.Pmp();
-
-	gpos_set_threads(4, 4);
-
-	// scope for socket listener
-	{
-		CSocketListenerUDS sl(m_pmp, m_szSocketPath);
-		sl.StartListener();
-
-		InitHT();
-
-		// scope for tasks
-		{
-			CWorkerPoolManager *pwpm = CWorkerPoolManager::Pwpm();
-			CAutoTaskProxy atp(m_pmp, pwpm, false /*fPropagateError*/);
-
-			// start task that checks connection status
-			CTask *ptskCheck = atp.PtskCreate(PvCheckConnections, m_pshtConnections);
-			atp.Schedule(ptskCheck);
-
-			// keep listening for new requests
-			while (true)
-			{
-				CSocket *psocket = sl.PsocketNext();
-
-				// create new task to handle communication
-				CTask *ptsk = atp.PtskCreate(PvOptimize, psocket);
-				ptsk->Tls().Reset(m_pmp);
-
-				TrackConnection(ptsk, psocket);
-
-				atp.Schedule(ptsk);
-
-				// release completed tasks
-				while (0 != atp.UlTasks() &&
-					   GPOS_OK == atp.EresTimedWaitAny(&ptsk, 0 /*ulTimeoutMs*/))
-				{
-					ReleaseConnection(ptsk);
-					atp.Destroy(ptsk);
-				}
-
-				GPOS_CHECK_ABORT;
-			}
-		}
-	}
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::InitHT
-//
-//	@doc:
-//		Initialize hashtable
-//
-//---------------------------------------------------------------------------
-void
-COptServer::InitHT()
-{
-	GPOS_ASSERT(NULL != m_pmp);
-	GPOS_ASSERT(NULL == m_pshtConnections);
-
-	m_pshtConnections = New(m_pmp) ConnectionHT();
-	m_pshtConnections->Init
-		(
-		m_pmp,
-		GPOPT_CONN_HT_SIZE,
-		GPOS_OFFSET(SConnectionDescriptor, m_link),
-		GPOS_OFFSET(SConnectionDescriptor, m_ulpId),
-		&(SConnectionDescriptor::m_ulpInvalid),
-		UlHashUlp,
-		FEqualUlp
-		);
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::TrackConnection
-//
-//	@doc:
-//		Register connection for status checking
-//
-//---------------------------------------------------------------------------
-void
-COptServer::TrackConnection
-	(
-	CTask *ptsk,
-	CSocket *psocket
-	)
-{
-	GPOS_ASSERT(NULL != m_pmp);
-	GPOS_ASSERT(NULL != psocket);
-	GPOS_ASSERT(NULL != ptsk);
-
-	SConnectionDescriptor *pcd = New(m_pmp) SConnectionDescriptor(ptsk, psocket);
-
-	// scope for accessor
-	{
-		ConnectionKeyAccessor shtacc(*m_pshtConnections, (ULONG_PTR) pcd->m_ptsk);
-		shtacc.Insert(pcd);
-	}
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::ReleaseConnection
-//
-//	@doc:
-//		Release connection
-//
-//---------------------------------------------------------------------------
-void
-COptServer::ReleaseConnection
-	(
-	CTask *ptsk
-	)
-{
-	SConnectionDescriptor *pcd = NULL;
-
-	// scope for accessor
-	{
-		ConnectionKeyAccessor shtacc(*m_pshtConnections, (ULONG_PTR) ptsk);
-		pcd = shtacc.PtLookup();
-		shtacc.Remove(pcd);
-	}
-
-	// release socket
-	CAutoSocketProxy asp(pcd->m_psocket);
-	delete pcd;
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::PvCheckConnections
-//
-//	@doc:
-//		Connection check task
-//
-//---------------------------------------------------------------------------
-void *
-COptServer::PvCheckConnections
-	(
-	void *pv
-	)
-{
-	ConnectionHT *pshtConnections = static_cast<ConnectionHT*>(pv);
-
-	while (true)
-	{
-		GPOS_CHECK_ABORT;
-
-		ConnectionIter conniter(*pshtConnections);
-		while (conniter.FAdvance())
-		{
-			ConnectionIterAccessor shtacc(conniter);
-			SConnectionDescriptor *pcd = shtacc.Pt();
-
-			// cancel task if its connection is broken
-			if (NULL != pcd && !pcd->m_psocket->FCheck())
-			{
-				pcd->m_ptsk->Cancel();
-			}
-		}
-
-		clib::USleep(GPOPT_CONN_CHECK_SLEEP_MS);
-	}
-
-	return NULL;
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::PvOptimize
-//
-//	@doc:
-//		Optimization task
-//
-//---------------------------------------------------------------------------
-void *
-COptServer::PvOptimize
-	(
-	void *pv
-	)
-{
-	CSocket *psocket = static_cast<CSocket*>(pv);
-
-	CAutoMemoryPool amp
-		(
-		CAutoMemoryPool::ElcNone,
-		CMemoryPoolManager::EatMalloc,
-		true /*fThreadSafe*/
-		);
-
-	IMemoryPool *pmp = amp.Pmp();
-	CCommunicator comm(pmp, psocket);
-	CCommunicator *pcomm = &comm;
-
-	const ULONG ulSegments = gpdb::UlSegmentCountGP();
-	// scope for setup objects
-	{
-		// setup loggers
-		CAutoP<CLoggerComm> a_ploggerComm;
-		a_ploggerComm = New(pmp) CLoggerComm(&comm);
-		a_ploggerComm.Pt()->SetErrorInfoLevel(ILogger::EeilMsg);
-		CAutoLogger alError(a_ploggerComm.Pt(), true /*fError*/);
-		CAutoLogger alOut(a_ploggerComm.Pt(), false /*fError*/);
-
-		// setup MD cache accessor
-		CMDProviderComm *pmdp = New(pmp) CMDProviderComm(pmp, &comm);
-		CAutoMDAccessor amda(pmp, pmdp, m_sysidDefault);
-
-		CMiniDumperDXL mdmp(pmp);
-		mdmp.Init();
-
-		CErrorHandlerStandard errhdl;
-		GPOS_TRY_HDL(&errhdl)
-		{
-			CSerializableStackTrace serStack;
-			serStack.AllocateBuffer(pmp);
-			CSerializableMDAccessor serMDA(amda.Pmda());
-
-			// install opt context in TLS
-			CAutoOptCtxt aoc
-			  (
-			   pmp,
-			   amda.Pmda(),
-			   NULL /*pceeval*/,
-			   New(pmp) CCostModelGPDB(pmp, ulSegments)
-			  );
-
-			// build query context from requested query
-			CQueryContext *pqc = PqcRecvQuery(pmp, pcomm, amda.Pmda());
-
-			// optimize logical expression tree into physical expression tree.
-			CEngine eng(pmp);
-			eng.Init(pqc, NULL /*pdrgpss*/);
-			eng.Optimize();
-
-			// extract plan and send it back
-			SendPlan(pmp, pcomm, amda.Pmda(), pqc, eng.PexprExtractPlan());
-
-			// TODO: add traceflag to create minidump without error during optimization
-		}
-		GPOS_CATCH_EX(ex)
-		{
-			FinalizeMinidump(&mdmp);
-
-			GPOS_RESET_EX;
-		}
-		GPOS_CATCH_END;
-	}
-
-	return NULL;
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::PqcRecvQuery
-//
-//	@doc:
-//		Receive optimization request and construct query context for it
-//
-//---------------------------------------------------------------------------
-CQueryContext *
-COptServer::PqcRecvQuery
-	(
-	IMemoryPool *pmp,
-	CCommunicator *pcomm,
-	CMDAccessor *pmda
-	)
-{
-	GPOS_ASSERT(NULL != pmp);
-	GPOS_ASSERT(NULL != pcomm);
-	GPOS_ASSERT(NULL != pmda);
-
-	// receive query request
-	CCommMessage *pmsg = pcomm->PmsgReceiveMsg();
-	GPOS_ASSERT(CCommMessage::EcmtOptRequest == pmsg->Ecmt());
-	const CHAR *szQuery = CDXLUtils::SzFromWsz(pmp, pmsg->Wsz());
-	delete [] pmsg->Wsz();
-	delete pmsg;
-
-	CQueryToDXLResult *pqdxlr = CDXLUtils::PdxlnParseDXLQuery(pmp, szQuery, NULL /*szXSDPath*/);
-	CSerializableQuery serQuery(pqdxlr->Pdxln(), pqdxlr->PdrgpdxlnOutputCols(), pqdxlr->PdrgpdxlnCTE());
-	serQuery.Serialize(pmp);
-
-	// translate DXL Tree -> Expr Tree
-	CTranslatorDXLToExpr *pdxltr = New(pmp) CTranslatorDXLToExpr(pmp, pmda);
-	CExpression *pexprTranslated =	pdxltr->PexprTranslateQuery(pqdxlr->Pdxln(), pqdxlr->PdrgpdxlnOutputCols(),
pqdxlr->PdrgpdxlnCTE());
-	gpdxl::DrgPul *pdrgul = pdxltr->PdrgpulOutputColRefs();
-	gpmd::DrgPmdname *pdrgpmdname = pdxltr->Pdrgpmdname();
-
-	CQueryContext *pqc = CQueryContext::PqcGenerate(pmp, pexprTranslated, pdrgul, pdrgpmdname,
true /*fDeriveStats*/);
-
-	if (GPOS_FTRACE(EopttracePrintQuery))
-	{
-		(void) pqc->Pexpr()->PdpDerive();
-
-		CAutoTrace at(pmp);
-		at.Os()
-			<< "\nTranslated expression: \n" << *pexprTranslated
-			<< "\nPreprocessed expression: \n" << *(pqc->Pexpr());
-	}
-
-	return pqc;
-}
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::SendPlan
-//
-//	@doc:
-//		Extract query plan, serialize it and send it to client
-//
-//---------------------------------------------------------------------------
-void
-COptServer::SendPlan
-	(
-	IMemoryPool *pmp,
-	CCommunicator *pcomm,
-	CMDAccessor *pmda,
-	CQueryContext *pqc,
-	CExpression *pexprPlan
-	)
-{
-	GPOS_ASSERT(NULL != pmp);
-	GPOS_ASSERT(NULL != pcomm);
-	GPOS_ASSERT(NULL != pmda);
-	GPOS_ASSERT(NULL != pqc);
-
-	(void) pexprPlan->PrppCompute(pmp, pqc->Prpp());
-
-	if (GPOS_FTRACE(EopttracePrintPlan))
-	{
-		CAutoTrace at(pmp);
-		at.Os() << "\nPhysical plan: \n%ls" << *pexprPlan;
-	}
-
-	// translate plan into DXL
-	DrgPi *pdrgpiSegments = New(pmp) DrgPi(pmp);
-
-	// TODO: replace function with entry in request message
-	const ULONG ulSegments = gpdb::UlSegmentCountGP();
-	GPOS_ASSERT(0 < ulSegments);
-	for (ULONG ul = 0; ul < ulSegments; ul++)
-	{
-		pdrgpiSegments->Append(New(pmp) INT(ul));
-	}
-
-	CTranslatorExprToDXL ptrexprtodxl(pmp, pmda, pdrgpiSegments);
-	CDXLNode *pdxlnPlan = ptrexprtodxl.PdxlnTranslate(pexprPlan, pqc->PdrgPcr(), pqc->Pdrgpmdname());
-
-	ULLONG ullPlanId = 0;
-	ULLONG ullPlanSpaceSize = 0;
-	CSerializablePlan serPlan(pdxlnPlan, ullPlanId, ullPlanSpaceSize);
-	serPlan.Serialize(pmp);
-
-	// serialize DXL to xml
-	CWStringDynamic *pstrPlan = CDXLUtils::PstrSerializePlan
-		(
-		pmp,
-		pdxlnPlan,
-		ullPlanId,
-		ullPlanSpaceSize,
-		true /*fSerializeHeaderFooter*/,
-		false /*fIndent*/
-		);
-
-	CCommMessage msg(CCommMessage::EcmtOptResponse, pstrPlan->Wsz(), 0 /*ullUserData*/);
-	pcomm->SendMsg(&msg);
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		COptServer::FinalizeMinidump
-//
-//	@doc:
-//		Dump collected artifacts to file
-//
-//---------------------------------------------------------------------------
-void
-COptServer::FinalizeMinidump
-	(
-	CMiniDumperDXL *pmdmp
-	)
-{
-	pmdmp->Finalize();
-
-	// dump to a temp file
-	//TODO: pass session and command ID from QD
-	CHAR szFileName[GPOPT_FILE_NAME_LEN];
-	CMinidumperUtils::GenerateMinidumpFileName
-		(
-		szFileName,
-		GPOPT_FILE_NAME_LEN,
-		0 /*gp_session_id*/,
-		0 /*gp_command_count*/
-		);
-
-	// dump the same to given file
-	CMinidumperUtils::Dump(szFileName, pmdmp);
-}
-
-
-// EOF

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/gpopt/utils/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/utils/Makefile b/src/backend/gpopt/utils/Makefile
index 60ba8c7..8996063 100644
--- a/src/backend/gpopt/utils/Makefile
+++ b/src/backend/gpopt/utils/Makefile
@@ -22,8 +22,8 @@ endif
 
 override CPPFLAGS := $(CFLAGS_DL) $(CPPFLAGS)
 
-OBJS = COptTasks.o COptServer.o COptClient.o CCatalogUtils.o CConstExprEvaluatorProxy.o nodeutils.o
funcs.o
+OBJS = COptTasks.o CCatalogUtils.o CConstExprEvaluatorProxy.o nodeutils.o funcs.o
 
 include $(top_srcdir)/src/backend/common.mk
 
-	
\ No newline at end of file
+	

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/gpopt/utils/funcs.cpp
----------------------------------------------------------------------
diff --git a/src/backend/gpopt/utils/funcs.cpp b/src/backend/gpopt/utils/funcs.cpp
index dffdb58..f47ca7e 100644
--- a/src/backend/gpopt/utils/funcs.cpp
+++ b/src/backend/gpopt/utils/funcs.cpp
@@ -22,8 +22,6 @@
 #include "gpopt/utils/nodeutils.h"
 #include "gpopt/utils/CCatalogUtils.h"
 #include "gpopt/utils/COptTasks.h"
-#include "gpopt/utils/COptClient.h"
-#include "gpopt/utils/COptServer.h"
 
 #include "gpos/_api.h"
 #include "gpos/io/CFileReader.h"
@@ -1348,45 +1346,6 @@ PlannedStmt *orca(Query *pquery)
 }
 
 
-//---------------------------------------------------------------------------
-//	@function:
-//		optimize_query
-//
-//	@doc:
-//		Optimize query using the OPT process
-//
-//---------------------------------------------------------------------------
-
-extern "C" {
-int optimize_query(void *pv)
-{
-	gpos_exec_params *pparams = (gpos_exec_params *) pv;
-	pparams->func = gpoptudfs::COptClient::PvRun;
-
-	return gpos_exec(pparams);
-}
-}
-
-
-//---------------------------------------------------------------------------
-//	@function:
-//		optimizer_loop
-//
-//	@doc:
-//		API for optimizer loop initialization
-//
-//---------------------------------------------------------------------------
-
-extern "C" {
-int optimizer_loop(void *pv)
-{
-	gpos_exec_params *pparams = (gpos_exec_params *) pv;
-	pparams->func = gpoptudfs::COptServer::PvRun;
-
-	return gpos_exec(pparams);
-}
-}
-
 extern "C" {
 char *read_file(const char *szFilename)
 {

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/optimizer/plan/planner.c
----------------------------------------------------------------------
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index e007a69..b09389a 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -63,7 +63,6 @@
 #include "utils/debugbreak.h"
 #include "catalog/gp_policy.h"
 
-#include "postmaster/optserver.h"
 #include "postmaster/identity.h"
 
 /* GUC parameter */
@@ -84,18 +83,6 @@ ParamListInfo PlannerBoundParamList = NULL;		/* current boundParams */
 #define EXPRKIND_APPINFO		6
 #define EXPRKIND_WINDOW_BOUND	7
 
-/*
- * struct containing optimization request parameters;
- * needs to be in sync with the argument expected by COptClient object;
- */
-struct optimizer_params
-{
-	// path where socket is initialized
-	const char *socketPath;
-
-	// input query
-	Query *query;
-};
 
 /*
  * structure containing psudo optimization result

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/postmaster/Makefile
----------------------------------------------------------------------
diff --git a/src/backend/postmaster/Makefile b/src/backend/postmaster/Makefile
index 83d1aa8..1f37dd2 100644
--- a/src/backend/postmaster/Makefile
+++ b/src/backend/postmaster/Makefile
@@ -15,7 +15,7 @@ override CPPFLAGS := -I$(top_srcdir)/src/backend/gp_libpq_fe $(CPPFLAGS)
 override CPPFLAGS := -I$(top_srcdir)/src/backend/resourcemanager/include $(CPPFLAGS)
 OBJS = bgwriter.o autovacuum.o service.o checkpoint.o seqserver.o ddaserver.o walsendserver.o
walredoserver.o pgarch.o pgstat.o \
 	postmaster.o primary_mirror_mode.o primary_mirror_transition_client.o syslogger.o \
-	fork_process.o perfmon.o perfmon_segmentinfo.o optserver.o identity.o backoff.o \
+	fork_process.o perfmon.o perfmon_segmentinfo.o identity.o backoff.o \
 	sendalert.o alertseverity.o
 
 include $(top_srcdir)/src/backend/common.mk

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/postmaster/optserver.c
----------------------------------------------------------------------
diff --git a/src/backend/postmaster/optserver.c b/src/backend/postmaster/optserver.c
deleted file mode 100644
index 601b5ef..0000000
--- a/src/backend/postmaster/optserver.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * optserver.c
- *	  Process handling all query optimization requests.
- *
- * Copyright (c) 2012, EMC Corp.
- *
- *-------------------------------------------------------------------------
- */
-
-#include <dlfcn.h>
-#include <unistd.h>
-#include <wchar.h>
-
-#include "postgres.h"
-#include "miscadmin.h"
-#include "gp-libpq-fe.h"
-#include "cdb/cdbdisp.h"
-#include "libpq/pqsignal.h"
-#include "postmaster/fork_process.h"
-#include "postmaster/optserver.h"
-#include "postmaster/postmaster.h"
-#include "storage/backendid.h"
-#include "storage/ipc.h"
-#include "storage/proc.h"
-#include "tcop/tcopprot.h"
-#include "utils/ps_status.h"
-
-#define GP_EXCEPTION_MSG	L"PG exception raised"
-
-/*
- * STATIC VARIABLES
- */
-
-static volatile bool shutdown_requested = false;
-
-
-/*
- * FUNCTION PROTOTYPES
- */
-
-/* run optimizer */
-static void OptimizerMain(void);
-
-/* start optimizer server loop */
-static void OptimizerLaunch(void);
-
-/* record shutdown request */
-static void RequestShutdown(SIGNAL_ARGS);
-
-
-/*
- * Entry point for optimizer process
- */
-int
-optimizer_start()
-{
-	pid_t optimizerPID;
-
-	switch ((optimizerPID = fork_process()))
-	{
-		case -1:
-			ereport(LOG, (errmsg("could not fork optimizer process: %m")));
-			return 0;
-
-#ifndef EXEC_BACKEND
-		case 0:
-			/* in postmaster child ... */
-			ClosePostmasterPorts(false);
-
-			OptimizerMain();
-			break;
-#endif /* EXEC_BACKEND */
-		default:
-			return (int) optimizerPID;
-	}
-
-	return 0;
-}
-
-
-/*
- * run optimizer
- */
-static void
-OptimizerMain()
-{
-	sigjmp_buf	local_sigjmp_buf;
-
-	IsUnderPostmaster = true;
-
-	/* Reset MyProcPid */
-	MyProcPid = getpid();
-
-    /* Save our main thread-id for comparison during signal handling */
-	main_tid = pthread_self();
-
-	/* Lose the postmaster's on-exit routines */
-	on_exit_reset();
-
-	/* Identify this process via ps */
-	init_ps_display("optimizer process", "", "", "");
-
-	SetProcessingMode(InitProcessing);
-
-	/* Set up reference point for stack depth checking */
-	char stack_base;
-	stack_base_ptr = &stack_base;
-
-	/*
-	 * Set up signal handlers. This process behaves much like a regular
-	 * backend, so it uses the same signal handling.  See equivalent code in
-	 * tcop/postgres.c.
-	 */
-	pqsignal(SIGHUP, SIG_IGN);
-	pqsignal(SIGINT, SIG_IGN);
-	pqsignal(SIGALRM, SIG_IGN);
-	pqsignal(SIGPIPE, SIG_IGN);
-	pqsignal(SIGUSR1, SIG_IGN);
-
-	pqsignal(SIGTERM, die);
-	pqsignal(SIGQUIT, quickdie);
-	pqsignal(SIGUSR2, RequestShutdown);
-
-	pqsignal(SIGFPE, FloatExceptionHandler);
-	pqsignal(SIGCHLD, SIG_DFL);
-
-	pqsignal(SIGILL, CdbProgramErrorHandler);
-	pqsignal(SIGSEGV, CdbProgramErrorHandler);
-	pqsignal(SIGBUS, CdbProgramErrorHandler);
-
-	CurrentResourceOwner = ResourceOwnerCreate(NULL, "Optimizer");
-
-	/* Early initialization */
-	BaseInit();
-
-	/* See InitPostgres()... */
-	InitProcess();
-
-	SetProcessingMode(NormalProcessing);
-
-	/*
-	 * If an exception is encountered, processing resumes here.
-	 *
-	 * See notes in postgres.c about the design of this coding.
-	 */
-	if (sigsetjmp(local_sigjmp_buf, 1) != 0)
-	{
-		/* Prevents interrupts while cleaning up */
-		HOLD_INTERRUPTS();
-
-		/* Report the error to the server log */
-		EmitErrorReport();
-
-		/*
-		 * We can now go away.	Note that because we'll call InitProcess, a
-		 * callback will be registered to do ProcKill, which will clean up
-		 * necessary state.
-		 */
-		proc_exit(0);
-	}
-
-	/* We can now handle ereport(ERROR) */
-	PG_exception_stack = &local_sigjmp_buf;
-
-	PG_SETMASK(&UnBlockSig);
-
-	MyBackendId = InvalidBackendId;
-
-	/* Unlink optimizer socket */
-	(void) unlink(OPT_SOCKET_NAME);
-
-	/* Start optimizer loop */
-	OptimizerLaunch();
-
-	proc_exit(0);
-}
-
-
-/*
- * Start optimizer server loop
- */
-static void
-OptimizerLaunch()
-{
-	char error_buffer[OPT_ERROR_BUFFER_SIZE];
-
-	(void) libopt_exec("optimizer_loop", OPT_SOCKET_NAME, error_buffer, sizeof(error_buffer),
-			           &shutdown_requested);
-}
-
-/*
- * dynamically load optimizer library;
- * invoke requested function and return result;
- */
-void *
-libopt_exec(const char *funcName, void *args, void *error_buffer, int error_buffer_size,
-            volatile bool *abort)
-{
-	void *libOptHandle = dlopen(OPT_LIB, RTLD_LAZY);
-	if (libOptHandle == NULL)
-	{
-		elog(LOG, "Unable to load optimizer library");
-		return NULL;
-	}
-
-	/* gpos task signature */
-	typedef int (*optTask)(void *);
-
-	/* dynamically load function */
-	optTask funcPtr = (optTask) dlsym(libOptHandle, funcName);
-
-	char *error = NULL;
-	if ((error = dlerror()) != NULL)
-	{
-		elog(LOG, "Unable to load function %s from library %s", funcName, error);
-		return NULL;
-	}
-
-	struct gpos_exec_params params;
-	params.func = NULL; /* set by the called function to avoid including GPOS headers here */
-	params.arg = args;
-	params.error_buffer = error_buffer;
-	params.error_buffer_size = error_buffer_size;
-	params.result = NULL;
-	params.stack_start = stack_base_ptr;
-	params.abort_requested = abort;
-
-	/* execute function */
-	int result = (*funcPtr)(&params);
-
-	(void) dlclose(libOptHandle);
-
-	if (result != 0)
-	{
-		if (wcsstr(error_buffer, GP_EXCEPTION_MSG) != NULL)
-		{
-			PG_RE_THROW();
-		}
-		elog(ERROR, "%ls", (const wchar_t *) params.error_buffer);
-	}
-
-	return params.result;
-}
-
-
-/*
- * record shutdown request
- */
-static void
-RequestShutdown(SIGNAL_ARGS)
-{
-	shutdown_requested = true;
-}
-
-
-/* EOF */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/backend/postmaster/postmaster.c
----------------------------------------------------------------------
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 03a5ec5..ff954b8 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -134,7 +134,6 @@
 #include "postmaster/ddaserver.h"
 #include "postmaster/syslogger.h"
 #include "postmaster/perfmon_segmentinfo.h"
-#include "postmaster/optserver.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
 #include "storage/pg_shmem.h"
@@ -196,7 +195,6 @@ typedef struct bkend
 static Dllist *BackendList;
 
 /* #define DO_DDA_SERV 1 */
-/* #define GP_OPT_PROCESS 1 */
 /* CDB */
 typedef enum pmsub_type
 {
@@ -210,9 +208,6 @@ typedef enum pmsub_type
 	PerfmonSegmentInfoProc,
     MetadataCacheProc,
     ResouceManagerProc,
-#ifdef GP_OPT_PROCESS
-	OptProc,
-#endif	
 	MaxPMSubType
 } PMSubType;
 
@@ -489,11 +484,6 @@ static PMSubProc PMSubProcList[MaxPMSubType] =
     {0, ResouceManagerProc,
     (PMSubStartCallback*)&ResManagerProcessStartup,
     "resourcemanager process", PMSUBPROC_FLAG_QD_AND_QE, true},
-#ifdef GP_OPT_PROCESS
-	{0, OptProc,
-	(PMSubStartCallback*)&optimizer_start,
-	"optimizer process", PMSUBPROC_FLAG_QD, true},
-#endif // !GP_OPT_PROCESS
 #ifdef DO_DDA_SERV
 	{0, DdaServerProc,
 	 (PMSubStartCallback*)&ddaserver_start,

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ad8ed914/src/include/postmaster/optserver.h
----------------------------------------------------------------------
diff --git a/src/include/postmaster/optserver.h b/src/include/postmaster/optserver.h
deleted file mode 100644
index d2d44f9..0000000
--- a/src/include/postmaster/optserver.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * optserver.h
- *	  Interface for Optimizer process management.
- *
- *
- * Copyright (c) 2012, EMC Corp.
- *
- *
- *-------------------------------------------------------------------------
- */
-#ifndef OPTSERVER_H
-#define OPTSERVER_H
-
-#include "postgres.h"
-
-#ifdef __darwin__
-#define OPT_LIB "libgpoptudf.dylib"
-#else
-#define OPT_LIB "libgpoptudf.so"
-#endif
-
-#define OPT_SOCKET_NAME "gp_opt_socket"
-#define OPT_ERROR_BUFFER_SIZE	(4096)
-
-/* struct with configuration parameters for GPOS task execution */
-struct gpos_exec_params
-{
-	void *(*func)(void*);			/* task function */
-	void *arg;						/* task argument */
-	void *result;					/* task result */
-	void *stack_start;				/* start of current thread's stack */
-	char *error_buffer;				/* buffer used to store error messages */
-	int error_buffer_size;			/* size of error message buffer */
-	volatile bool *abort_requested;	/* flag indicating if abort is requested */
-};
-
-
-/* start optimizer */
-extern int optimizer_start(void);
-
-/* invoke optimizer function */
-extern void *libopt_exec(const char *funcName, void *args, void *error_buffer,
-		                 int error_buffer_size, volatile bool *abort);
-
-
-
-#endif /* OPTSERVER_H */



Mime
View raw message