提交 f6006651 编写于 作者: H Heikki Linnakangas

Remove dead code.

And other misc cleeanup.
上级 d09cf2e6
......@@ -739,7 +739,7 @@ GpVars_Verbosity gp_log_interconnect;
/*
* gpvars_string_to_verbosity
*/
GpVars_Verbosity
static GpVars_Verbosity
gpvars_string_to_verbosity(const char *s)
{
GpVars_Verbosity result;
......@@ -762,7 +762,7 @@ gpvars_string_to_verbosity(const char *s)
/*
* gpvars_verbosity_to_string
*/
const char *
static const char *
gpvars_verbosity_to_string(GpVars_Verbosity verbosity)
{
switch (verbosity)
......
......@@ -12,7 +12,7 @@
#include "postgres.h"
#include "miscadmin.h"
#include "access/heapam.h"
#include "access/htup.h"
#include "cdb/cdbconn.h"
#include "nodes/execnodes.h" //SliceTable
#include "cdb/cdbmotion.h"
......@@ -21,7 +21,6 @@
#include "cdb/ml_ipc.h"
#include "cdb/tupser.h"
#include "libpq/pqformat.h"
#include "utils/hsearch.h"
#include "utils/memutils.h"
......@@ -482,12 +481,6 @@ SendTuple(MotionLayerState *mlStates,
return rc;
}
TupleChunkListItem
get_eos_tuplechunklist(void)
{
return s_eos_chunk_data;
}
/*
* Sends a token to all peer Motion Nodes, indicating that this motion
* node has no more tuples to send out.
......
......@@ -8,15 +8,6 @@
*-------------------------------------------------------------------------
*/
#ifdef WIN32
/*
* Need this to get WSAPoll (poll). And it
* has to be set before any header from the Win32 API is loaded.
*/
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#include "postgres.h"
#include "nodes/execnodes.h" /* Slice, SliceTable */
......@@ -41,13 +32,6 @@
#include <sys/time.h>
#include <netinet/in.h>
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
#include "port.h"
#ifdef WIN32
......@@ -56,55 +40,10 @@
#define _WIN32_WINNT 0x0600
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#define SHUT_RDWR SD_BOTH
#define SHUT_RD SD_RECEIVE
#define SHUT_WR SD_SEND
/* If we have old platform sdk headers, WSAPoll() might not be there */
#ifndef POLLIN
/* Event flag definitions for WSAPoll(). */
#define POLLRDNORM 0x0100
#define POLLRDBAND 0x0200
#define POLLIN (POLLRDNORM | POLLRDBAND)
#define POLLPRI 0x0400
#define POLLWRNORM 0x0010
#define POLLOUT (POLLWRNORM)
#define POLLWRBAND 0x0020
#define POLLERR 0x0001
#define POLLHUP 0x0002
#define POLLNVAL 0x0004
typedef struct pollfd {
SOCKET fd;
SHORT events;
SHORT revents;
} WSAPOLLFD, *PWSAPOLLFD, FAR *LPWSAPOLLFD;
__control_entrypoint(DllExport)
WINSOCK_API_LINKAGE
int
WSAAPI
WSAPoll(
IN OUT LPWSAPOLLFD fdArray,
IN ULONG fds,
IN INT timeout
);
#endif
#define poll WSAPoll
/*
* Postgres normally uses it's own custom select implementation
* on Windows, but they haven't implemented execeptfds, which
* we use here. So, undef this to use the normal Winsock version
* for now
*/
#undef select
#endif
/*
......@@ -128,15 +67,6 @@ int savedSeqServerFd = -1;
char *savedSeqServerHost = NULL;
uint16 savedSeqServerPort = 0;
/*
* Outgoing port assignment
*
* To reserve a port number for outgoing connections, we open a dummy
* listening socket. Nobody connects to this socket.
*/
int portReservationFd = -1;
int outgoingPort = 0;
/*=========================================================================
* FUNCTIONS PROTOTYPES
*/
......@@ -293,13 +223,9 @@ CleanUpMotionLayerIPC(void)
if (UDP_listenerFd >= 0)
closesocket(UDP_listenerFd);
if (portReservationFd >= 0)
closesocket(portReservationFd);
/* be safe and reset global state variables. */
Gp_listener_port = 0;
UDP_listenerFd = -1;
portReservationFd = -1;
}
/* See ml_ipc.h */
......
......@@ -2583,7 +2583,7 @@ getSndBuffer(MotionConn *conn)
* RETURNS
* Initialized ChunkTransportState for the Sending Motion Node Id.
*/
ChunkTransportStateEntry *
static ChunkTransportStateEntry *
startOutgoingUDPConnections(ChunkTransportState *transportStates,
Slice *sendSlice,
int *pOutgoingCount)
......@@ -3217,12 +3217,12 @@ SetupUDPIFCInterconnect(EState *estate)
static void
freeDisorderedPackets(MotionConn *conn)
{
int k = 0;
int k;
if (conn->pkt_q == NULL)
return;
for(; k < Gp_interconnect_queue_depth; k++)
for(k = 0; k < Gp_interconnect_queue_depth; k++)
{
icpkthdr *buf = (icpkthdr *)conn->pkt_q[k];
if (buf != NULL)
......@@ -3611,7 +3611,6 @@ TeardownUDPIFCInterconnect(ChunkTransportState *transportStates,
static void
prepareRxConnForRead(MotionConn *conn)
{
elog(DEBUG3, "In prepareRxConnForRead: conn %p, q_head %d q_tail %d q_size %d", conn, conn->pkt_q_head, conn->pkt_q_tail, conn->pkt_q_size);
Assert(conn->pkt_q[conn->pkt_q_head] != NULL);
......@@ -6396,7 +6395,7 @@ handleMismatch(icpkthdr *pkt, struct sockaddr_storage *peer, int peer_len)
static bool
cacheFuturePacket(icpkthdr *pkt, struct sockaddr_storage *peer, int peer_len)
{
MotionConn *conn = NULL;
MotionConn *conn;
conn = findConnByHeader(&ic_control_info.startupCacheHtab, pkt);
......
......@@ -12,7 +12,6 @@
#include "access/htup.h"
#include "catalog/pg_type.h"
#include "nodes/execnodes.h" //SliceTable
#include "cdb/cdbmotion.h"
#include "cdb/tupser.h"
#include "cdb/cdbvars.h"
......@@ -23,7 +22,6 @@
#include "utils/numeric.h"
#include "utils/memutils.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "access/memtup.h"
......
......@@ -14,8 +14,6 @@
#include "access/htup.h"
#include "cdb/htupfifo.h"
struct directTransportBuffer;
#include "cdb/cdbselect.h"
#include "cdb/tupser.h"
#include "cdb/tupchunk.h"
......@@ -500,5 +498,5 @@ typedef struct ChunkTransportState
extern void dumpICBufferList(ICBufferList *list, const char *fname);
extern void dumpUnackQueueRing(const char *fname);
extern void dumpConnections(ChunkTransportStateEntry *pEntry, const char *fname);
#endif /* CDBINTERCONNECT_H */
#endif /* CDBINTERCONNECT_H */
......@@ -140,10 +140,4 @@ extern void SendStopMessage(MotionLayerState *mlStates,
*/
extern void setExpectedReceivers(MotionLayerState *mlStates, int16 motNodeID, int expectedReceivers);
/*
* Return a pointer to the internal "end-of-stream" message
*/
extern TupleChunkListItem get_eos_tuplechunklist(void);
#endif /* CDBMOTION_H */
......@@ -539,11 +539,6 @@ typedef enum GpVars_Verbosity
GPVARS_VERBOSITY_DEBUG,
} GpVars_Verbosity;
GpVars_Verbosity
gpvars_string_to_verbosity(const char *s);
const char *
gpvars_verbosity_to_string(GpVars_Verbosity verbosity);
/* Enable single-slice single-row inserts. */
extern bool gp_enable_fast_sri;
......
......@@ -14,33 +14,12 @@
#include "cdb/cdbvars.h"
#include "cdb/cdbgang.h"
#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 UDP_listenerFd;
/*
* Registration message
*
* Upon making a connection, the sender sends a registration message to
* identify itself to the receiver. A lot of the fields are just there
* for validity checking.
*/
typedef struct RegisterMessage
{
int32 msgBytes;
int32 recvSliceIndex;
int32 sendSliceIndex;
int32 srcContentId;
int32 srcListenerPort;
int32 srcPid;
int32 srcSessionId;
int32 srcCommandCount;
} RegisterMessage;
/* 2 bytes to store the size of the entire packet. a packet is composed of
* of one or more serialized TupleChunks (each of which has a TupleChunk
* header.
......@@ -101,12 +80,9 @@ extern int GetSeqServerFD(void);
*
*/
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
* a DML statement to close down all socket resources that were setup during
* SetupInterconnect().
*
* NOTE: it is important that TeardownInterconnect() happens
......@@ -119,20 +95,7 @@ extern void TeardownInterconnect(ChunkTransportState *transportStates,
MotionLayerState *mlStates,
bool forceEOS);
extern void TeardownTCPInterconnect(ChunkTransportState *transportStates,
MotionLayerState *mlStates,
bool forceEOS);
extern void TeardownUDPInterconnect(ChunkTransportState *transportStates,
MotionLayerState *mlStates,
bool forceEOS);
extern void TeardownUDPIFCInterconnect(ChunkTransportState *transportStates,
MotionLayerState *mlStates,
bool forceEOS);
extern void SetupSequenceServer(const char *host, int port);
extern void TeardownSequenceServer(void);
......@@ -226,15 +189,12 @@ extern void DeregisterReadInterest(ChunkTransportState *transportStates,
int srcRoute,
const char *reason);
extern void readPacket(MotionConn *conn, bool inTeardown);
/*
* Return a UDP receive buffer to our freelist.
*
* allows us to "keep" a buffer held for a connection, to avoid a copy
* (see inplace in chunklist).
*/
extern void MlPutRxBuffer(ChunkTransportState *transportStates, int motNodeID, int route);
extern void MlPutRxBufferIFC(ChunkTransportState *transportStates, int motNodeID, int route);
#define getChunkTransportState(transportState, motNodeID, ppEntry) \
......@@ -319,21 +279,17 @@ extern ChunkTransportStateEntry *createChunkTransportState(ChunkTransportState *
extern ChunkTransportStateEntry *removeChunkTransportState(ChunkTransportState *transportStates,
int16 motNodeID);
extern void InitMotionTCP(int *listenerSocketFd, uint16 *listenerPort);
extern void InitMotionUDP(int *listenerSocketFd, uint16 *listenerPort);
extern void InitMotionUDPIFC(int *listenerSocketFd, uint16 *listenerPort);
extern TupleChunkListItem RecvTupleChunk(MotionConn *conn, bool inTeardown);
extern void markUDPConnInactive(MotionConn *conn);
extern void InitMotionUDPIFC(int *listenerSocketFd, uint16 *listenerPort);
extern void markUDPConnInactiveIFC(MotionConn *conn);
extern void CleanupMotionTCP(void);
extern void CleanupMotionUDP(void);
extern void CleanupMotionUDPIFC(void);
extern void WaitInterconnectQuitUDPIFC(void);
extern void WaitInterconnectQuitUDP(void);
extern void SetupUDPIFCInterconnect(struct EState *estate);
extern void TeardownUDPIFCInterconnect(ChunkTransportState *transportStates,
MotionLayerState *mlStates,
bool forceEOS);
extern void adjustMasterRouting(Slice *recvSlice);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册