提交 2a10ac51 编写于 作者: D Daniel Gustafsson

Remove duplicate getgpsegmentCount() prototype

getgpsegmentCount() was defined in both cdbvars.h and cdbutil.h. While
not needing another header include in some cases, getgpsegmentCount()
is not a variable and the correct location is cdbutil.h. Remove the
prototype from cdbvars.g and update includes as required.

Also fix the function comment to match reality and minor tweaking of
the debug elog() performed.
Reviewed-by: NHeikki Linnakangas <hlinnakangas@pivotal.io>
Reviewed-by: NVenkatesh Raghavan <vraghavan@pivotal.io>
上级 b2c9182c
......@@ -56,6 +56,7 @@
#include "cdb/cdbpullup.h"
#include "cdb/cdbsetop.h"
#include "cdb/cdbvars.h"
#include "cdb/cdbutil.h"
#include "cdb/cdbtargeteddispatch.h"
#include "nodes/print.h"
......
......@@ -1234,10 +1234,6 @@ contentid_get_dbid(int16 contentid, char role, bool getPreferredRoleNotCurrentRo
/*
* Returns the number of segments
*
* N.B. Gp_role must be either dispatch or execute, since
* when utiliy no GP catalog tables are read. An Assert is
* thrown if Gp_role = utility.
*/
int
getgpsegmentCount(void)
......@@ -1246,12 +1242,11 @@ getgpsegmentCount(void)
{
if (GpIdentity.numsegments <= 0)
{
elog(DEBUG5, "getgpsegmentCount called when Gp_role == utility. returning zero segments.");
elog(DEBUG5, "getgpsegmentCount called when Gp_role == utility, returning zero segments.");
return 0;
}
elog(DEBUG1, "getgpsegmentCount called when Gp_role == utility, but is relying on gp_id info");
}
verifyGpIdentityIsSet();
......
......@@ -31,6 +31,7 @@
#include "cdb/cdbhash.h"
#include "cdb/cdbpartition.h"
#include "cdb/cdbtm.h"
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
#include "commands/analyzeutils.h"
#include "commands/dbcommands.h"
......
......@@ -51,6 +51,7 @@
#include "cdb/cdbappendonlyam.h"
#include "cdb/cdbaocsam.h"
#include "cdb/cdbdisp_query.h"
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
#include "cdb/memquota.h"
......
......@@ -50,6 +50,7 @@
#include "commands/vacuum.h"
#include "cdb/cdbdisp_query.h"
#include "cdb/cdbpartition.h"
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
#include "cdb/cdbsrlz.h"
#include "cdb/cdbdispatchresult.h" /* CdbDispatchResults */
......
......@@ -42,6 +42,7 @@
#include "utils/syscache.h"
#include "cdb/cdbexplain.h"
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
static void ExecHashIncreaseNumBatches(HashJoinTable hashtable);
......
......@@ -95,6 +95,7 @@
#include "utils/spccache.h"
#include "utils/tuplesort.h"
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
#define LOG2(x) (log(x) / 0.693147180559945)
......
......@@ -58,6 +58,7 @@
#include "cdb/cdbpullup.h"
#include "cdb/cdbgroup.h" /* grouping_planner extensions */
#include "cdb/cdbsetop.h" /* motion utilities */
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
#include "storage/lmgr.h"
......
......@@ -142,7 +142,8 @@
#include "utils/tqual.h"
#include "utils/typcache.h"
#include "cdb/cdbvars.h" /* getgpsegmentCount */
#include "cdb/cdbutil.h"
#include "cdb/cdbvars.h"
/* Hooks for plugins to get control when we ask for stats */
get_relation_stats_hook_type get_relation_stats_hook = NULL;
......
......@@ -172,10 +172,6 @@ extern int16 contentid_get_dbid(int16 contentid, char role, bool getPreferredRol
/*
* Returns the number of segments
*
* N.B. Gp_role must be either dispatch or execute, since
* when utiliy no mpp catalog tables are read. An Assert is
* thrown if Gp_role = utility.
*/
extern int getgpsegmentCount(void);
......
......@@ -445,8 +445,6 @@ extern bool gp_interconnect_cache_future_packets;
#define UNDEF_SEGMENT -2
extern int getgpsegmentCount(void);
/*
* Parameter interconnect_setup_timeout
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册