提交 442c105e 编写于 作者: H Heikki Linnakangas

Misc header file cleanup

Remove unnecessary #includes, add #includes that are actually needed by
some headers.
上级 d1765734
......@@ -37,6 +37,7 @@
#include "access/xlogutils.h"
#include "catalog/catalog.h"
#include "catalog/catversion.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_control.h"
#include "catalog/pg_type.h"
#include "catalog/pg_database.h"
......
......@@ -23,6 +23,7 @@
#include "postgres.h"
#include "access/xlogutils.h"
#include "catalog/pg_tablespace.h"
#include "storage/bufpage.h"
#include "storage/smgr.h"
#include "utils/hsearch.h"
......
......@@ -9,14 +9,19 @@
#include "postgres.h"
#include "access/aosegfiles.h"
#include "access/aocssegfiles.h"
#include "cdb/cdbdirectopen.h"
#include "utils/guc.h"
#include "storage/smgr.h"
#include "utils/memutils.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_am.h"
#include "catalog/pg_index.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_opclass.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_tablespace.h"
#include "utils/builtins.h"
/*
......
......@@ -16,6 +16,7 @@
#include <signal.h>
#include "access/xlogmm.h"
#include "catalog/pg_tablespace.h"
#include "cdb/cdbfilerepprimary.h"
#include "cdb/cdbmirroredbufferpool.h"
#include "cdb/cdbfilerepresyncmanager.h"
......
......@@ -27,6 +27,7 @@
#include "cdb/cdbhash.h" /* isGreenplumDbHashable() */
#include "cdb/cdbpath.h" /* me */
#include "cdb/cdbvars.h"
#ifdef small /* <socket.h> might #define small */
#undef small /* but I want it for a variable name */
......
......@@ -15,6 +15,7 @@
#include <sys/file.h>
#include <sys/stat.h>
#include "catalog/pg_authid.h"
#include "cdb/cdbtm.h"
#include "libpq/libpq-be.h"
#include "miscadmin.h"
......
......@@ -37,6 +37,7 @@
#include "utils/syscache.h"
#include "cdb/cdbdisp.h"
#include "cdb/cdbdoublylinked.h"
#include "cdb/cdbsrlz.h"
#include "cdb/cdbvars.h"
#include "cdb/cdbmotion.h"
......
......@@ -78,11 +78,11 @@
#include "cdb/cdbvars.h"
#include "cdb/cdbutil.h"
#include "access/persistentfilesysobjname.h"
#include "cdb/cdbpersistentdatabase.h"
#include "cdb/cdbpersistentrelation.h"
#include "cdb/cdbmirroredfilesysobj.h"
/* GUC variable */
char *default_tablespace = NULL;
......
......@@ -37,6 +37,7 @@
#include "parser/parse_expr.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteManip.h"
#include "utils/guc.h"
#include "utils/lsyscache.h"
#include "cdb/cdbllize.h" /* repartitionPlan */
......
......@@ -76,6 +76,7 @@
#include "utils/tuplesort.h"
#include "cdb/cdbpath.h" /* cdbpath_rows() */
#include "cdb/cdbvars.h"
#define LOG2(x) (log(x) / 0.693147180559945)
......
......@@ -46,6 +46,7 @@
#include "cdb/cdbpathtoplan.h" /* cdbpathtoplan_create_flow() etc. */
#include "cdb/cdbpullup.h" /* cdbpullup_targetlist() */
#include "cdb/cdbsreh.h"
#include "cdb/cdbvars.h"
static Plan *create_subplan(PlannerInfo *root, Path *best_path); /*CDB*/
......
......@@ -29,6 +29,7 @@
#include "utils/selfuncs.h"
#include "cdb/cdbpath.h" /* cdbpath_rows() */
#include "cdb/cdbvars.h"
static Bitmapset *distcols_in_groupclause(List *gc, Bitmapset *bms);
......
......@@ -51,9 +51,11 @@
#include "cdb/cdbpath.h" /* cdbpath_segments */
#include "cdb/cdbpathtoplan.h" /* cdbpathtoplan_create_flow() */
#include "cdb/cdbpartition.h" /* query_has_external_partition() */
#include "cdb/cdbplan.h"
#include "cdb/cdbgroup.h" /* grouping_planner extensions */
#include "cdb/cdbsetop.h" /* motion utilities */
#include "cdb/cdbsubselect.h" /* cdbsubselect_flatten_sublinks() */
#include "cdb/cdbvars.h"
/* GUC parameter */
double cursor_tuple_fraction = DEFAULT_CURSOR_TUPLE_FRACTION;
......
......@@ -16,6 +16,7 @@
#include "postgres.h"
#include "access/reloptions.h"
#include "access/transam.h"
#include "access/url.h"
#include "access/xlog_internal.h"
#include "cdb/cdbappendonlyam.h"
......
......@@ -12,8 +12,6 @@
#ifndef CDBDATABASEINFO_H
#define CDBDATABASEINFO_H
#include "utils/palloc.h"
#include "storage/fd.h"
#include "storage/itemptr.h"
#include "storage/dbdirnode.h"
#include "catalog/pg_appendonly.h"
......
......@@ -9,24 +9,12 @@
#ifndef CDBDIRECTOPEN_H
#define CDBDIRECTOPEN_H
#include "miscadmin.h"
#include "pgstat.h"
#include "utils/palloc.h"
#include "storage/fd.h"
#include "storage/relfilenode.h"
#include "access/transam.h"
#include "catalog/catalog.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_class.h"
#include "catalog/gp_persistent.h"
#include "catalog/gp_global_sequence.h"
#include "catalog/pg_appendonly.h"
#include "catalog/pg_tablespace.h"
#include "catalog/index.h"
#include "access/transam.h"
#include "access/aosegfiles.h"
#include "access/aocssegfiles.h"
#include "pgstat.h"
/*
* The goal here is to open any relations without going through
......
......@@ -13,7 +13,6 @@
#include "lib/stringinfo.h" /* StringInfo */
#include "cdb/cdbselect.h"
#include "cdb/cdbtm.h"
#include <pthread.h>
......
......@@ -9,19 +9,16 @@
#ifndef CDBFILEREP_H
#define CDBFILEREP_H
#include "c.h"
#include <signal.h>
#include "utils/pg_crc.h"
#include "pg_config_manual.h"
#include "storage/relfilenode.h"
#include "access/xlogdefs.h"
#include "cdb/cdbresynchronizechangetracking.h"
#include "postmaster/primary_mirror_mode.h"
#include "storage/fd.h"
#include "storage/dbdirnode.h"
#include "storage/lwlock.h"
#include "storage/pg_sema.h"
#include "storage/spin.h"
#include "signal.h"
#include "gpmon/gpmon.h"
#include "utils/timestamp.h"
......
......@@ -9,11 +9,8 @@
#ifndef CDBFILEREPPRIMARYRECOVERY_H
#define CDBFILEREPPRIMARYRECOVERY_H
#include "cdb/cdbfilerep.h"
extern void FileRepPrimary_StartRecovery(void);
#endif
......@@ -9,10 +9,6 @@
#ifndef CDBGLOBALSEQUENCE_H
#define CDBGLOBALSEQUENCE_H
#include "utils/palloc.h"
#include "storage/fd.h"
#include "storage/itemptr.h"
#include "utils/rel.h"
#include "catalog/gp_global_sequence.h"
int64 GlobalSequence_Next(
......
......@@ -16,6 +16,7 @@
struct directTransportBuffer;
#include "cdb/cdbselect.h"
#include "cdb/tupser.h"
#include "cdb/tupchunk.h"
#include "cdb/tupchunklist.h"
......@@ -23,6 +24,7 @@ struct directTransportBuffer;
struct CdbProcess; /* #include "nodes/execnodes.h" */
struct Slice; /* #include "nodes/execnodes.h" */
struct SliceTable; /* #include "nodes/execnodes.h" */
struct EState; /* #include "nodes/execnodes.h" */
typedef struct icpkthdr
{
......@@ -513,7 +515,7 @@ typedef struct ChunkTransportState
int sliceId;
/* Estate pointer for this statement (UDP-IC specific) */
EState *estate;
struct EState *estate;
/* Function pointers to our send/receive functions */
bool (*SendChunk)(MotionLayerState *mlStates, struct ChunkTransportState *transportStates, ChunkTransportStateEntry *pEntry, MotionConn *conn, TupleChunkListItem tcItem, int16 motionId);
......
......@@ -18,7 +18,6 @@
#include "nodes/parsenodes.h"
#include "nodes/plannodes.h"
#include "nodes/params.h"
#include "cdb/cdbplan.h"
extern Plan *cdbparallelize(struct PlannerInfo *root, Plan *plan, Query *query,
int cursorOptions,
......
......@@ -9,7 +9,7 @@
#ifndef CDBMIRROREDFLATFILE_H
#define CDBMIRROREDFLATFILE_H
#include "utils/palloc.h"
#include "access/xlogdefs.h"
#include "storage/fd.h"
#include "storage/dbdirnode.h"
......
......@@ -12,7 +12,6 @@
#define CDBMOTION_H
#include "access/htup.h"
#include "cdb/htupfifo.h"
#include "cdb/cdbselect.h"
#include "cdb/cdbinterconnect.h"
#include "cdb/ml_ipc.h"
......
......@@ -10,7 +10,7 @@
#ifndef CDBPATH_H
#define CDBPATH_H
#include "cdb/cdbvars.h" /* getgpsegmentCount, gp_opt_segments, etc */
#include "nodes/relation.h"
void
cdbpath_cost_motion(PlannerInfo *root, CdbMotionPath *motionpath);
......
......@@ -11,8 +11,8 @@
#include "miscadmin.h"
#include "utils/guc.h"
#include "utils/palloc.h"
#include "storage/fd.h"
#include "cdb/cdbpersistentstore.h"
/*
* This struct provides accounting information to help Post DTM recovery
......
......@@ -9,12 +9,9 @@
#ifndef CDBPERSISTENTDATABASE_H
#define CDBPERSISTENTDATABASE_H
#include "utils/palloc.h"
#include "storage/fd.h"
#include "storage/itemptr.h"
#include "cdb/cdbsharedoidsearch.h"
#include "access/persistentfilesysobjname.h"
#include "cdb/cdbdoublylinked.h"
#include "access/xlogmm.h"
#include "cdb/cdbpersistentfilesysobj.h"
......
......@@ -12,10 +12,7 @@
#include "access/persistentfilesysobjname.h"
#include "access/xlogmm.h"
#include "cdb/cdbsharedoidsearch.h"
#include "cdb/cdbdoublylinked.h"
#include "storage/fd.h"
#include "storage/itemptr.h"
#include "utils/palloc.h"
#include "cdb/cdbpersistentfilesysobj.h"
extern void PersistentFilespace_Reset(void);
......
......@@ -11,13 +11,9 @@
#include "miscadmin.h"
#include "utils/guc.h"
#include "utils/palloc.h"
#include "storage/fd.h"
#include "access/persistentfilesysobjname.h"
#include "access/persistentendxactrec.h"
#include "cdb/cdbpersistentstore.h"
#include "cdb/cdbdoublylinked.h"
#include "storage/smgr.h"
#include "catalog/gp_persistent.h"
typedef struct PersistentFileSysObjSharedData
......
......@@ -9,12 +9,8 @@
#ifndef CDBPERSISTENTRELATION_H
#define CDBPERSISTENTRELATION_H
#include "utils/palloc.h"
#include "storage/fd.h"
#include "access/persistentfilesysobjname.h"
#include "cdb/cdbpersistentfilesysobj.h"
#include "cdb/cdbpersistentdatabase.h"
#include "cdb/cdbdoublylinked.h"
/*
* This module is for generic relation file create and drop.
......
......@@ -9,14 +9,13 @@
#ifndef CDBPERSISTENTSTORE_H
#define CDBPERSISTENTSTORE_H
#include "utils/palloc.h"
#include "storage/fd.h"
#include "miscadmin.h"
#include "access/persistentfilesysobjname.h"
#include "catalog/gp_global_sequence.h"
#include "storage/itemptr.h"
#include "access/genam.h"
#include "access/heapam.h"
#include "utils/rel.h"
#include "utils/relcache.h"
#include "cdb/cdbfilerepprimary.h"
#include "cdb/cdbdirectopen.h"
#include "utils/guc.h"
......
......@@ -12,10 +12,7 @@
#include "access/persistentfilesysobjname.h"
#include "access/xlogmm.h"
#include "cdb/cdbsharedoidsearch.h"
#include "cdb/cdbdoublylinked.h"
#include "storage/fd.h"
#include "storage/itemptr.h"
#include "utils/palloc.h"
#include "cdb/cdbpersistentfilesysobj.h"
extern void PersistentTablespace_Reset(void);
......
......@@ -12,7 +12,7 @@
#ifndef CDBRELSIZE_H_
#define CDBRELSIZE_H_
#include "utils/rel.h"
#include "utils/relcache.h"
extern void clear_relsize_cache(void);
......
......@@ -9,10 +9,7 @@
#ifndef CDBSHAREDOIDSEARCH_H
#define CDBSHAREDOIDSEARCH_H
#include "utils/palloc.h"
#include "storage/fd.h"
#include "cdb/cdbshareddoublylinked.h"
#include "cdb/cdbsharedoidsearch.h"
typedef struct SharedOidSearchFreeObjPool
......
......@@ -11,7 +11,6 @@
#ifndef CDBSREH_H
#define CDBSREH_H
#include "c.h"
#include "fmgr.h"
#include "cdb/cdbcopy.h"
#include "utils/memutils.h"
......
......@@ -13,12 +13,9 @@
#ifndef CDBSRLZ_H
#define CDBSRLZ_H
#include "lib/stringinfo.h"
#include "nodes/pg_list.h"
#include "nodes/nodes.h"
extern char *serializeNode(Node *node, int *size, int *uncompressed_size);
extern Node *deserializeNode(const char *strNode, int size);
#endif /* CDBSRLZ_H */
......@@ -8,7 +8,6 @@
#define CDBTM_H
#include "storage/lwlock.h"
#include "utils/hsearch.h"
#include "lib/stringinfo.h"
#include "access/xlogdefs.h"
#include "cdb/cdbdistributedsnapshot.h"
......
......@@ -16,6 +16,8 @@
#ifndef HTUPFIFO_H
#define HTUPFIFO_H
#include "access/htup.h"
/* An entry in the HeapTuple FIFO. Entries are formed into queues. */
typedef struct htf_entry_data
{
......
......@@ -17,6 +17,7 @@
#define IC_SHORT_PACKET_LIMIT (10) /* MPP-10351: treat some short-packets as drops */
struct SliceTable; /* #include "nodes/execnodes.h" */
struct EState; /* #include "nodes/execnodes.h" */
/* listener filedescriptors */
extern int TCP_listenerFd;
......@@ -100,10 +101,10 @@ extern int GetSeqServerFD(void);
* mySliceId - the index of the slice in the slicetable that we are a member of.
*
*/
extern void SetupInterconnect(EState *estate);
extern void SetupUDPInterconnect(EState *estate);
extern void SetupUDPIFCInterconnect(EState *estate);
extern void SetupTCPInterconnect(EState *estate);
extern void SetupInterconnect(struct EState *estate);
extern void SetupUDPInterconnect(struct EState *estate);
extern void SetupUDPIFCInterconnect(struct EState *estate);
extern void SetupTCPInterconnect(struct EState *estate);
/* The TeardownInterconnect() function should be called at the end of executing
* a DML statement to close down all TCP socket resources that were setup during
......
......@@ -79,6 +79,12 @@ typedef struct SerTupInfo
bool *nulls;
} SerTupInfo;
/*
* forward declaration to avoid #including cdbmotion.h here, which would create a circular
* dependency
*/
struct directTransportBuffer;
/* Populate a SerTupInfo struct with information looked up from the specified
* tuple-descriptor.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册