You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2017/09/07 01:55:14 UTC

[20/30] incubator-trafodion git commit: TRAFODION-2731 CodeCleanup: Remove obsolete, legacy and unused code

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/Int64.h
----------------------------------------------------------------------
diff --git a/core/sql/common/Int64.h b/core/sql/common/Int64.h
index e388afe..6ab56de 100644
--- a/core/sql/common/Int64.h
+++ b/core/sql/common/Int64.h
@@ -38,24 +38,12 @@
 #include <limits.h>
 #include "Platform.h"
 
-#if   defined( __linux__ ) && defined( NA_64BIT )
-
-  #ifndef LLONG_MAX
-    #define LLONG_MAX LONG_MAX
-  #endif
-
-  #ifndef LLONG_MIN
-    #define LLONG_MIN LONG_MIN
-  #endif
-
-
-#else
-
 #ifndef LLONG_MAX
-#define LLONG_MAX _I64_MAX
+#define LLONG_MAX LONG_MAX
 #endif
 
-
+#ifndef LLONG_MIN
+#define LLONG_MIN LONG_MIN
 #endif
 
 // ***********************************************************************
@@ -65,20 +53,17 @@
 // -----------------------------------------------------------------------
 // Convert an unsigned int to Int64.
 // ----------------------------------------------------------------------- 
-NA_EIDPROC
 Int64 uint32ToInt64(UInt32 value);
 
 // -----------------------------------------------------------------------
 // Convert an Int64 to long.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 Int32 int64ToInt32(Int64 value);
 
 // -----------------------------------------------------------------------
 // Convert the integer from array of two longs, most significant first
 // (Guardian-style LARGEINT datatype).
 // -----------------------------------------------------------------------
-NA_EIDPROC
 Int64 uint32ArrayToInt64(const UInt32 array[2]);
 
 // -----------------------------------------------------------------------
@@ -87,43 +72,36 @@ Int64 uint32ArrayToInt64(const UInt32 array[2]);
 // endian and big endian problems.  Parameter tgt must point to
 // an array of two (2) unsigned long elements.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 void convertInt64ToUInt32Array(const Int64 &src, UInt32 *tgt);
 
 // -----------------------------------------------------------------------
 // Convert the integer from ascii.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 Int32 aToInt32(const char* src);
 
 // -----------------------------------------------------------------------
 // Convert the integer from ascii.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 Int64 atoInt64(const char* src);
 
 // -----------------------------------------------------------------------
 // Convert the integer to ascii.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 void convertInt64ToAscii(const Int64 &src, char* tgt);
 
 // -----------------------------------------------------------------------
 // Convert the unsigned integer to ascii.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 void convertUInt64ToAscii(const UInt64 &src, char* tgt);
 
 // -----------------------------------------------------------------------
 // Convert the integer to double.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 double convertInt64ToDouble(const Int64 &src);
 
 // -----------------------------------------------------------------------
 // Convert the integer to double.
 // -----------------------------------------------------------------------
-NA_EIDPROC
 double convertUInt64ToDouble(const UInt64 &src);
 
 #endif /* INT64_H */

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/IntervalType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/IntervalType.cpp b/core/sql/common/IntervalType.cpp
index 8bce05c..bffcc49 100644
--- a/core/sql/common/IntervalType.cpp
+++ b/core/sql/common/IntervalType.cpp
@@ -1029,22 +1029,12 @@ double SQLInterval::encode(void *bufPtr) const
     val = temp;
     break;
   }
-#ifdef NA_64BIT
-  // dg64 - a bit of a guess
   case sizeof(Int32): {
     Int32 temp;
     memcpy((char *) &temp, valPtr, sizeof(Int32));
     val = temp;
     break;
   }
-#else
-  case sizeof(Lng32): {
-    Lng32 temp;
-    memcpy((char *) &temp, valPtr, sizeof(Lng32));
-    val = temp;
-    break;
-  }
-#endif
   case sizeof(Int64): {
     Int64 temp;
     memcpy((char *) &temp, valPtr, sizeof(Int64));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/IntervalType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/IntervalType.h b/core/sql/common/IntervalType.h
index 158ebc1..2be60fb 100644
--- a/core/sql/common/IntervalType.h
+++ b/core/sql/common/IntervalType.h
@@ -44,7 +44,7 @@
 #include "NAType.h"
 #include "DTICommonType.h"
 #include "Int64.h"
-#ifdef NA_DEBUG_C_RUNTIME
+#ifdef _DEBUG
 #include <iostream>
 #endif
 
@@ -128,12 +128,12 @@ public:
       {
 	makeInvalid();
 
-#ifdef NA_DEBUG_C_RUNTIME
+#ifdef _DEBUG
 	// All callers *should be* immediately calling the checkValid() method
 	// and so this debugging info *should be* unnecessary.  Delete it!
 	cerr << "Invalid interval specification " <<
 		getTypeSQLname(TRUE /*terse*/) << endl;
-#endif // NA_DEBUG_C_RUNTIME
+#endif // _DEBUG
       }
   }
 
@@ -152,12 +152,12 @@ public:
       {
 	makeInvalid();
 
-#ifdef NA_DEBUG_C_RUNTIME
+#ifdef _DEBUG
 	// All callers *should be* immediately calling the checkValid() method
 	// and so this debugging info *should be* unnecessary.  Delete it!
 	cerr << "Invalid interval specification " <<
 		getTypeSQLname(TRUE /*terse*/) << endl;
-#endif // NA_DEBUG_C_RUNTIME
+#endif // _DEBUG
       }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/Ipc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/Ipc.cpp b/core/sql/common/Ipc.cpp
index 2d989ee..2645d69 100644
--- a/core/sql/common/Ipc.cpp
+++ b/core/sql/common/Ipc.cpp
@@ -160,7 +160,7 @@ SockIPAddress IpcNodeName::getIPAddress() const
 
 NABoolean GuaProcessHandle::operator == (const GuaProcessHandle &other) const
 {
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   // on NSK, do the right thing and call a system procedure to compare
   return compare(other);
 #else
@@ -177,12 +177,7 @@ void GuaProcessHandle::dumpAndStop(bool doDump, bool doStop) const
   if (doDump)
     msg_mon_dump_process_name(NULL, phandle.getPhandleString(), coreFile);
   if (doStop)
-#ifdef SQ_PHANDLE_VERIFIER
     msg_mon_stop_process_name(phandle.getPhandleString()); 
-#else
-    msg_mon_stop_process(phandle.getPhandleString(), 
-                         phandle.getCpu(), phandle.getPin());
-#endif
 }
 
 // -----------------------------------------------------------------------
@@ -222,7 +217,7 @@ IpcProcessId::IpcProcessId(const char *asciiRepresentation) :
 {
   domain_ = IPC_DOM_INVALID;
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   // On NSK, try to interpret the string as a PHANDLE first
   if (phandle_.fromAscii(asciiRepresentation))
     domain_ = IPC_DOM_GUA_PHANDLE;
@@ -358,7 +353,7 @@ IpcNodeName IpcProcessId::getNodeName() const
     {
       return IpcNodeName(SockIPAddress(pid_.ipAddress_)); // LCOV_EXCL_LINE
     }
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   else if (domain_ == IPC_DOM_GUA_PHANDLE)
     {
       return IpcNodeName(phandle_);
@@ -379,7 +374,7 @@ IpcNodeName IpcProcessId::getNodeName() const
 
 IpcCpuNum IpcProcessId::getCpuNum() const
 {
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   if (domain_ == IPC_DOM_GUA_PHANDLE)
     {
       // ask Guardian to get the CPU number out of the phandle
@@ -400,7 +395,7 @@ Int32 IpcProcessId::toAscii(char *outBuf, Int32 outBufLen) const
   char outb[300] = "";	  // Initialize in case this is called
   Int32 outLen = 0;
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   if (domain_ == IPC_DOM_GUA_PHANDLE)
     {
       outLen = phandle_.toAscii(outb,300);
@@ -475,7 +470,7 @@ IpcConnection * IpcProcessId::createConnectionToServer(
       return new(env->getHeap()) SockConnection(env,*this,FALSE);
 // LCOV_EXCL_STOP
     }
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   else if (domain_ == IPC_DOM_GUA_PHANDLE)
     {
 	return new(env->getHeap()) GuaConnectionToServer(env,
@@ -489,7 +484,7 @@ IpcConnection * IpcProcessId::createConnectionToServer(
                                               dataConnectionToEsp
                                               );
     }
-#endif //defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG)
+#endif //defined(NA_GUARDIAN_IPC)
   else
     {
       return NULL;
@@ -500,9 +495,7 @@ IpcMessageObjSize IpcProcessId::packedLength()
 {
   // we pack the domain type and then the phandle or socket process id
   IpcMessageObjSize result = baseClassPackedLength() + sizeof(domain_);
-#ifdef NA_64BIT
   result += sizeof(spare_);
-#endif
 
   if (domain_ == IPC_DOM_GUA_PHANDLE)
     {
@@ -525,10 +518,8 @@ IpcMessageObjSize IpcProcessId::packObjIntoMessage(IpcMessageBufferPtr buffer)
   str_cpy_all(buffer,(const char *) &domain_, sizeof(domain_));
   result += sizeof(domain_);
   buffer += sizeof(domain_);
-#ifdef NA_64BIT
   result += sizeof(spare_);
   buffer += sizeof(spare_);
-#endif
 
   // ---------------------------------------------------------------------
   // NOTE: this code assumes that the OS dependent information (phandle
@@ -566,9 +557,7 @@ void IpcProcessId::unpackObj(IpcMessageObjType objType,
 
   str_cpy_all((char *) &domain_, buffer, sizeof(domain_));
   buffer += sizeof(domain_);
-#ifdef NA_64BIT
   buffer += sizeof(spare_);
-#endif
 
   // check the supplied length
   assert(objSize == packedLength());
@@ -1385,9 +1374,7 @@ Int32 IpcAllConnections::printConnTrace(Int32 lineno, char *buf)
           GuaProcessHandle *otherEnd = (GuaProcessHandle *)&(c->getOtherEnd().getPhandle().phandle_);
           if (otherEnd)
             otherEnd->decompose(cpu, pin, node
-#ifdef SQ_PHANDLE_VERIFIER
                                , seqNum
-#endif
                                );
         }
       rv = sprintf(buf, "%.4d  %8p  %.4s  %.3d,%.8d %" PRId64 " %s\n",
@@ -2126,11 +2113,7 @@ InternalMsgHdrInfoStruct::InternalMsgHdrInfoStruct(
     swapTwoBytes(sockReplyTag_);
     swapFourBytes(eyeCatcher_);
     swapFourBytes(seqNum_);
-#ifdef NA_64BIT
     assert(0); // Need swapEightBytes() to swap msgStreamId_!
-#else
-    swapFourBytes(msgStreamId_);
-#endif // NA_64BIT
     setEndianness(IpcMyEndianness);
     }
   }
@@ -4627,7 +4610,7 @@ IpcServerClass::IpcServerClass(IpcEnvironment *env,
   }
   if (allocationMethod_ == IPC_ALLOC_DONT_CARE)
     {
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 	  // NA_WINNT is set and NA_GUARDIAN_IPC is set
 	  // The standard method on NT is to create a Guardian process
 	  // in order to run in an NT only or simulated environment we can set an environment
@@ -4909,7 +4892,7 @@ IpcServer * IpcServerClass::allocateServerProcess(ComDiagsArea **diags,
   switch (allocationMethod_)
     {
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
     case IPC_LAUNCH_GUARDIAN_PROCESS:
     case IPC_SPAWN_OSS_PROCESS:
     case IPC_USE_PROCESS:
@@ -5357,7 +5340,7 @@ IpcProcessId IpcEnvironment::getMyOwnProcessId(IpcNetworkDomain dom)
     }
   else if (dom == IPC_DOM_GUA_PHANDLE)
     {
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
       // for Guardian, just get the phandle from the operating system
       return IpcProcessId(MyGuaProcessHandle());
 #else
@@ -5814,9 +5797,7 @@ void IpcAllConnections::printConnTraceLine(char *buffer, int *rsp_len, IpcConnec
         GuaProcessHandle *otherEnd = (GuaProcessHandle *)&(conn->getOtherEnd().getPhandle().phandle_);
         if (otherEnd)
           otherEnd->decompose(cpu, pin, node
-#ifdef SQ_PHANDLE_VERIFIER
                              , seqNum
-#endif
                              );
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/Ipc.h
----------------------------------------------------------------------
diff --git a/core/sql/common/Ipc.h b/core/sql/common/Ipc.h
index c8a1e8e..85680b4 100644
--- a/core/sql/common/Ipc.h
+++ b/core/sql/common/Ipc.h
@@ -67,13 +67,7 @@
 #include "ComExeTrace.h"
 #include <time.h>
 
-#if (defined (NA_LINUX) && defined (SQ_NEW_PHANDLE))
 #include "seabed/fs.h"
-#endif // NA_LINUX
-
-#ifdef ERROR_STATE
-#undef ERROR_STATE
-#endif // ERROR_STATE
 
 // -----------------------------------------------------------------------
 // Contents of this file
@@ -185,7 +179,7 @@ public:
   // IpcNodeName(const IpcProcessId &proc);
   // make a node name from an Internet address or from a phandle
   IpcNodeName(const SockIPAddress &iPNode);
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG) || defined(NA_HSC))
+#if (defined(NA_GUARDIAN_IPC))
 // LCOV_EXCL_START
   IpcNodeName(const GuaProcessHandle &phandle);
   // Return the Guardian node name as a character string, without trailing spaces.
@@ -274,39 +268,26 @@ const Int32 NumIpcConnTraces = 8;
 // -----------------------------------------------------------------------
 struct GuaProcessHandle
 {
-#if (defined(NA_LINUX) && defined (SQ_NEW_PHANDLE))
   SB_Phandle_Type phandle_;
-#else
-  // on NSK systems, this is called a PHANDLE
-  short phandle_[10];
-#endif // NA_LINUX
 
   NABoolean operator == (const GuaProcessHandle &other) const;
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   NABoolean compare(const GuaProcessHandle &other) const;
   NABoolean fromAscii(const char *ascii);
   Int32 toAscii(char *ascii, Int32 asciiLen) const;
 #endif
-#if (defined (NA_LINUX) && defined(SQ_NEW_PHANDLE))
   Lng32 decompose(Int32 &cpu, Int32 &pin, Int32 &nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
                   , SB_Int64_Type &seqNum
-#endif
                   ) const;
-#else
-  Lng32 decompose(short &cpu, short &pin, Int32 &nodeNumber) const;
-#endif // NA_LINUX
 
   Int32 decompose2(Int32 &cpu, Int32 &pin, Int32 &node
-#ifdef SQ_PHANDLE_VERIFIER
                   , SB_Int64_Type &seqNum
-#endif
                   ) const;
 
   void dumpAndStop(bool doDump, bool doStop) const;
 };
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 class MyGuaProcessHandle : public GuaProcessHandle
 {
 public:
@@ -477,10 +458,8 @@ private:
 
   // the domain under which this process is addressable
   IpcNetworkDomain domain_;
-#ifdef NA_64BIT
   // to make phandle_ 8-byte aligned
   Int32 spare_;
-#endif
 
   union
     {
@@ -490,7 +469,7 @@ private:
 
   // private methods
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
   IpcCpuNum getCpuNumFromPhandle() const;
 #endif
 };
@@ -1081,7 +1060,7 @@ private:
   SockIPAddress  ipAddr_;
 };
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 // -----------------------------------------------------------------------
 // A Guardian connection on the client side that connects to a server
 // by opening its process file
@@ -1100,10 +1079,6 @@ public:
 			, NABoolean parallelOpen = FALSE
 			, Int32 *openCompletionScheduled = NULL
                         , NABoolean dataConnectionToEsp = FALSE
-#ifndef SQ_PHANDLE_VERIFIER
-                        , time_t childCreationTimeSec = 0
-                        , long childCreationTimenSec = 0
-#endif
                         );
 
   virtual ~GuaConnectionToServer();
@@ -1194,10 +1169,6 @@ private:
   void handleIOErrorForStream(IpcMessageStreamBase *msgStream);
   void handleIOErrorForEntry(ActiveIOQueueEntry &entry);
   void cleanUpActiveIOEntry(ActiveIOQueueEntry &entry);
-#ifndef SQ_PHANDLE_VERIFIER
-  // Fix for CR 7128
-  bool childProcessPidRecycled();
-#endif
 
   // ---------------------------------------------------------------------
   // The send and receive queues of a Guardian connection to a server are
@@ -1288,18 +1259,7 @@ private:
   Int32             openRetries_;
   struct timespec   beginOpenTime_;
   struct timespec   completeOpenTime_;
-#ifndef SQ_PHANDLE_VERIFIER
-                    // Fix for CR 7128
-                    // this childCreationTime_ is non-zero only for
-                    // control connections from master to servers that
-                    // the master created.
-  struct timespec   childCreationTime_;
-#endif
   NABoolean         tscoOpen_;
-#if 0
-  char *sentMsgHdr_;
-  short sentMsgHdrInd_;
-#endif
 };
 
 // -----------------------------------------------------------------------
@@ -1541,7 +1501,7 @@ private:
   SockListnerPort *listnerPort_;
 };
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 // -----------------------------------------------------------------------
 // A control connection for a Guardian server using $RECEIVE
 // -----------------------------------------------------------------------
@@ -2008,21 +1968,13 @@ public:
   InternalMsgHdrInfoStruct(IpcBufferedMsgStream* msgStream);
   
   // get header sequence number (used to preserve send order)
-#ifdef NA_64BIT
-  // dg64 - 32-bit seq number
+  // 32-bit seq number
   UInt32  getSeqNum() const
-#else
-  ULng32 getSeqNum() const
-#endif
     { return(seqNum_); }
 
   // set header sequence number
-#ifdef NA_64BIT
-  // dg64 - 32-bit seq number
+  // 32-bit seq number
   void setSeqNum(UInt32  seqNum)
-#else
-  void setSeqNum(ULng32 seqNum)
-#endif
     { seqNum_ = seqNum; }
 
   short getSockReplyTag() const
@@ -2090,18 +2042,8 @@ public:
   short             flags_;        // enum IpcMessageObjFlags
   short             format_;       // compressed, ...
   short             sockReplyTag_; // spare for Guardian, reply tag for sock.
-#ifdef NA_64BIT
-  // dg64 - 32-bit eye
   Int32               eyeCatcher_;   // bit pattern to detect junk messages
-#else
-  Lng32              eyeCatcher_;   // bit pattern to detect junk messages
-#endif
-#ifdef NA_64BIT
-  // dg64 - 32-bit seq num
   UInt32      seqNum_;       // sequence number to preserve send order 
-#else
-  ULng32     seqNum_;       // sequence number to preserve send order 
-#endif
   // stream id is actually the pointer to the stream
   Long		msgStreamId_;  // stream id for coalescing multi-buf msg
 
@@ -2789,7 +2731,7 @@ protected:
   virtual void stop();
 };
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 // -----------------------------------------------------------------------
 // Specialization for a Guardian server process
 // -----------------------------------------------------------------------
@@ -2946,14 +2888,6 @@ private:
   // when sending messages, don't delete the message until the I/O completed
   char        * activeMessage_;
 
-#ifndef SQ_PHANDLE_VERIFIER
-  // When stopping an ESP by name, check the ESPs creation timestamp 
-  // to see if the ESP was started by this master.  Helps when process
-  // names are reused.  See ALM CR 4528.  When SQF is enhanced to 
-  // handle this problem (see enhancement CR 4780) we can remove this 
-  // work-around logic.
- struct timespec creationTime_;
-#endif
  NABoolean unhooked_;
 };
 #endif /* NA_GUARDIAN_IPC */

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/IpcGuardian.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/IpcGuardian.cpp b/core/sql/common/IpcGuardian.cpp
index 928e822..89e968f 100644
--- a/core/sql/common/IpcGuardian.cpp
+++ b/core/sql/common/IpcGuardian.cpp
@@ -52,7 +52,7 @@
 #include "PortProcessCalls.h"
 #include "logmxevent.h"
 
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 // all of these files are OK in the executor environment (PRIV, no globals)
 #include "MXTraceDef.h"
 #include "seabed/fs.h"
@@ -69,14 +69,9 @@ extern "C" {
 #include "cextdecs/cextdecs.h"
 #include "zsysc.h"
 }
-#ifdef NA_ARKFS
-#   include "fs/feerrors.h"
-#else
-#   include "derror.h"
-#endif
+#include "fs/feerrors.h"
 #endif
 
-
 // Uncomment the next line to debug IPC problems (log of client's I/O)
 // #define LOG_IPC
 
@@ -93,12 +88,6 @@ void IpcGuaLogTimestamp(IpcConnection *conn); // see bottom of file
 void allocateConsole(); // see bottom of file
 #endif
 
-#if ((!defined(NA_GUARDIAN_IPC)) && (!defined(NA_GUARDIAN_MSG)))
-// -----------------------------------------------------------------------
-// On platforms other than NSK, stub out some Guardian-related calls
-// -----------------------------------------------------------------------
-
-#else
 // -----------------------------------------------------------------------
 // The real thing starts here
 // -----------------------------------------------------------------------
@@ -186,17 +175,10 @@ IpcStartupMsg::IpcStartupMsg()
 // Methods for class GuaProcessHandle
 // -----------------------------------------------------------------------
 
-#if (defined (NA_LINUX) && defined (SQ_NEW_PHANDLE))
 Lng32 GuaProcessHandle::decompose(Int32 &cpu, Int32 &pin,
                                   Int32 &nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
-                  , SB_Int64_Type &seqNum
-#endif
-                   ) const
-#else
-Lng32 GuaProcessHandle::decompose(short &cpu, short &pin,
-                                  Int32 &nodeNumber) const
-#endif // NA_LINUX
+                                  , SB_Int64_Type &seqNum
+                                  ) const
 {
   // Phandle wrapper in porting layer
   NAProcessHandle phandle((SB_Phandle_Type *)&phandle_);
@@ -207,36 +189,25 @@ Lng32 GuaProcessHandle::decompose(short &cpu, short &pin,
     cpu = phandle.getCpu();
     pin = phandle.getPin();
     nodeNumber = phandle.getNodeNumber();
-#ifdef SQ_PHANDLE_VERIFIER
     seqNum = phandle.getSeqNum();
-#endif
   }
   
   return result;
 }
 
 Int32 GuaProcessHandle::decompose2(Int32 &cpu, Int32 &pin, Int32 &node
-#ifdef SQ_PHANDLE_VERIFIER
                   , SB_Int64_Type &seqNum
-#endif
                   ) const
 {
   return decompose(cpu, pin, node
-#ifdef SQ_PHANDLE_VERIFIER
                   , seqNum
-#endif
                   );
 }
 
 NABoolean GuaProcessHandle::compare(const GuaProcessHandle &other) const
 {
-#ifdef SQ_NEW_PHANDLE
   Int32 guaRetcode = XPROCESSHANDLE_COMPARE_((SB_Phandle_Type *)&phandle_,
 					   (SB_Phandle_Type *)&(other.phandle_));
-#else
-  Int32 guaRetcode = XPROCESSHANDLE_COMPARE_((short *)phandle_,
-					   (short *)other.phandle_);
-#endif // SQ_NEW_PHANDLE
 
   // 0 means different, 1 means two procs of a process pair (different)
   // 2 means the process handles are the same
@@ -245,22 +216,14 @@ NABoolean GuaProcessHandle::compare(const GuaProcessHandle &other) const
 
 NABoolean GuaProcessHandle::fromAscii(const char *ascii)
 {
-#ifdef SQ_NEW_PHANDLE
  SB_Phandle_Type *tempPhandle;
-#else
- short *tempPhandle; 
-#endif // SQ_NEW_PHANDLE
 
  tempPhandle = get_phandle_with_retry((char *)ascii);
 
  if (!tempPhandle)
     return FALSE;
 
-#ifdef SQ_NEW_PHANDLE
  memcpy ((void *)&phandle_, (void *)tempPhandle, sizeof(SB_Phandle_Type));
-#else
- memcpy (phandle_, tempPhandle, 20);
-#endif // SQ_NEW_PHANDLE
   return TRUE; 
 }
 
@@ -368,10 +331,6 @@ GuaConnectionToServer::GuaConnectionToServer(
      Int32 *openCompletionScheduled
      ,
      NABoolean dataConnectionToEsp
-#ifndef SQ_PHANDLE_VERIFIER
-     , time_t childCreationTimeSec
-     , long childCreationTimenSec
-#endif
      )
      : IpcConnection(env,procId,eye)
 {
@@ -402,10 +361,6 @@ GuaConnectionToServer::GuaConnectionToServer(
   guaErrorInfo_             = GuaOK;
   dataConnectionToEsp_      = dataConnectionToEsp;
   self_                     = FALSE; // Set at openPhandle time
-#ifndef SQ_PHANDLE_VERIFIER
-  childCreationTime_.tv_sec = childCreationTimeSec;
-  childCreationTime_.tv_nsec = childCreationTimenSec;
-#endif
   openRetries_              = 0;
   beginOpenTime_.tv_sec     = 0;
   beginOpenTime_.tv_nsec    = 0;
@@ -911,9 +866,7 @@ WaitReturnStatus GuaConnectionToServer::wait(IpcTimeout timeout, UInt32 *eventCo
         short fsError = BFILE_CLOSE_(openFile_); // Don't retain unopened ACB
         otherEnd = (GuaProcessHandle *)&getOtherEnd().getPhandle().phandle_;
         otherEnd->decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
                            , seqNum
-#endif
                            );
         getEnvironment()->closeTrace(__LINE__, openFile_, cpu, pin, seqNum);
         openFile_ = -1; // Don't leave valid file number in object!
@@ -942,16 +895,6 @@ WaitReturnStatus GuaConnectionToServer::wait(IpcTimeout timeout, UInt32 *eventCo
       *openCompletionScheduled_ = 1;
     fileNumForIOCompletion_ = openFile_;
 
-#ifndef SQ_PHANDLE_VERIFIER
-    // Fix for 7128
-    // this method can set the state to error, if the newly opened 
-    // process' create timestamp differs from the create timestamp
-    // which was recorded when the process was created. When ALM CR
-    // 4780 is addressed, this check can be removed.
-    if (childProcessPidRecycled())
-      return WAIT_OK;
-#endif
-
   // use setmode 74 to turn off the automatic CANCEL upon AWAITIOX timeout
     stat = BSETMODE(openFile_,74,-1);
     if (_status_ne(stat))
@@ -1003,16 +946,6 @@ WaitReturnStatus GuaConnectionToServer::wait(IpcTimeout timeout, UInt32 *eventCo
           }
       }
 
-#ifndef SQ_PHANDLE_VERIFIER
-    // Fix for 7128
-    // this method can set the state to error, if the newly opened
-    // process' create timestamp differs from the create timestamp
-    // which was recorded when the process was created. When ALM CR
-    // 4780 is addressed, this check can be removed.
-    if (childProcessPidRecycled())
-     return WAIT_OK;
-#endif
-
     // the connection is established now
     setState(ESTABLISHED);
     clock_gettime(CLOCK_REALTIME, &completeOpenTime_);
@@ -1029,9 +962,7 @@ void GuaConnectionToServer::openRetryCleanup()
   {
     ((GuaProcessHandle *)&getOtherEnd().getPhandle().phandle_)->
        decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
        , seqNum
-#endif
        );
     str_sprintf(msgBuf,
       "GuaConnectionToServer: BFILE_OPEN %d,%d,%Ld "
@@ -1523,24 +1454,15 @@ void GuaConnectionToServer::openPhandle(char * processName, NABoolean parallelOp
     }
 
 
-#if (defined (NA_LINUX) && defined (SQ_NEW_PHANDLE))
       phandle_template* lp_phandle = (phandle_template *) &(getOtherEnd().getPhandle().phandle_);
-#else
-      phandle_template* lp_phandle = (phandle_template *) getOtherEnd().getPhandle().phandle_;
-#endif // NA_LINUX
       memset(procFileName, 0, IpcMaxGuardianPathNameLength);
       char *srcName = (char *) lp_phandle;
       //    strncpy(procFileName, (char *) lp_phandle->verifierF(), 8);
-#if (defined (NA_LINUX) && defined (SQ_NEW_PHANDLE))
       NAProcessHandle phandle((SB_Phandle_Type *)
                               &(getOtherEnd().getPhandle().phandle_));
       phandle.decompose();
       procFileNameLen = phandle.getPhandleStringLen();
       strncpy(procFileName, phandle.getPhandleString(), procFileNameLen);
-#else
-      strncpy(procFileName, &srcName[8], 8);
-      procFileNameLen = strlen(procFileName);
-#endif
     MXTRC_1("GCTS::openPhandle procFileName=%s\n", procFileName);
 #pragma nowarn(1506)   // warning elimination 
    NABoolean isEsp = getEnvironment()->getAllConnections()->getPendingIOs().isEsp();
@@ -1651,9 +1573,7 @@ void GuaConnectionToServer::openPhandle(char * processName, NABoolean parallelOp
           SB_Int64_Type seqNum = -1;
           GuaProcessHandle *otherEnd = (GuaProcessHandle *)&getOtherEnd().getPhandle().phandle_;
           otherEnd->decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
                              , seqNum
-#endif
                              );
           env->closeTrace(__LINE__, openFile_, cpu, pin, seqNum);
           openFile_ = -1; // Don't leave valid file number in object!
@@ -1805,9 +1725,7 @@ void GuaConnectionToServer::closePhandle()
           SB_Int64_Type seqNum = -1;
           otherEnd = (GuaProcessHandle *)&getOtherEnd().getPhandle().phandle_;
           otherEnd->decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
                              , seqNum
-#endif
                              );
           env->closeTrace(__LINE__, openFile_, cpu, pin, 
                            seqNum); // Persistent open simulated close
@@ -1830,9 +1748,7 @@ void GuaConnectionToServer::closePhandle()
         SB_Int64_Type seqNum = -1;
         GuaProcessHandle *otherEnd = (GuaProcessHandle *)&getOtherEnd().getPhandle().phandle_;
         otherEnd->decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
                            , seqNum
-#endif
         );
         env->closeTrace(__LINE__, openFile_, cpu, pin, nodeNumber);
       }
@@ -2018,109 +1934,6 @@ void GuaConnectionToServer::cleanUpActiveIOEntry(ActiveIOQueueEntry &entry)
   numOutstandingIOs_--;
 }
 
-#ifndef SQ_PHANDLE_VERIFIER
-bool GuaConnectionToServer::childProcessPidRecycled()
-{
-  // Fix for CR 7128 - Guard against this scenario:
-  // An ESP is created but before the master opens it, the 
-  // ESP exits and another process (probably an ESP) is created 
-  // with the same nid, pid and pname. That leads to two masters
-  // opening the same ESP. To prevent the scenario, 
-  // the process creation time is retrieved immediately after
-  // the process is created and stored in the GuaConnectionToServer.
-  // Then after it is opened, the process creation time is retrieved
-  // again from Seabed and checked for a match. If no match, the
-  // open is considered unsuccessful and AQR or other retry schemes
-  // try to handle the error. 
-  // Note that there is no guard against the scenario for the
-  // GuaConnectionToServer objects that are used for SSMP or SSCP
-  // (since we don't care which incarnation of these processes we 
-  // connect to) or for Seabed data connections (since a dying ESP
-  // will be detected with the control connection). Hence, these types
-  // of connections have zero in the childCreationTime_.
-  //
-  // Note that when SQF enhancement ALM CR 4780 is addressed we 
-  // can remove this check. 
-  if (childCreationTime_.tv_sec != 0)
-    {
-      char procName[200];
-      short procNameLen = 200;
-      NAProcessHandle phandle((SB_Phandle_Type *)
-          &(getOtherEnd().getPhandle().phandle_));
-      Int32 retcode = phandle.decompose();
-      assert (!retcode);
-      short pnamelen = phandle.getPhandleStringLen();
-      memcpy(procName, phandle.getPhandleString(), pnamelen);
-      procName[pnamelen] = 0; // null-terminate
-      MS_Mon_Process_Info_Type procInfo;
-      Int32 retrys = 0;
-      const Int32 NumRetries = 10;
-      timespec retryintervals[NumRetries] = {
-                               {  0, 10*1000*1000 }  // 10 ms
-                             , {  0, 100*1000*1000 } // 100 ms
-                             , {  1, 0 } // 1 second
-                             , {  3, 0 } // 3 seconds
-                             , {  6, 0 } // 6 seconds
-                             , { 10, 0 } // 10 seconds
-                             , { 15, 0 } // 15 seconds
-                             , { 15, 0 } // 15 seconds
-                             , { 15, 0 } // 15 seconds
-                             , { 15, 0 } // 15 seconds
-                           } ;
-      for (;;)
-      {
-        retcode = msg_mon_get_process_info_detail(procName, &procInfo);
-        if (retcode == XZFIL_ERR_OK)
-          {
-            if ((procInfo.creation_time.tv_sec  == 
-                 childCreationTime_.tv_sec) &&
-                (procInfo.creation_time.tv_nsec  ==
-                 childCreationTime_.tv_nsec))
-            {
-              break ; // This server is the same incarnation of the pid 
-                      // as the one we started.
-            }
-            else
-            {
-              // The server we started has died, and the pid has
-              // been reused. We cannot use this one. 
-              guaErrorInfo_ = GuaIpcApplicationErr;
-              setErrorInfo(-1);
-              setState(ERROR_STATE);
-              char logMsg[200];
-              str_sprintf(logMsg, "An instance of CR 7128 was avoided "
-                                  "by not opening recycled pname %s.", 
-                          procName);
-              SQLMXLoggingArea::logExecRtInfo(__FILE__, __LINE__,
-                                              logMsg, 0); 
-              return true;
-            }
-          }
-        else if ((retrys < NumRetries) && 
-                 (retcode == FEPATHDOWN ||
-                  retcode == FEOWNERSHIP))
-          {
-            nanosleep(&retryintervals[retrys++], NULL);
-          }
-        else
-          {
-            guaErrorInfo_ = retcode;
-            setErrorInfo(-1);
-            setState(ERROR_STATE);
-            char logMsg[200];
-            str_sprintf(logMsg, "Error %d returned from "
-                                "msg_mon_get_process_info_detail "
-                                "for %s.", retcode,  procName);
-            SQLMXLoggingArea::logExecRtInfo(__FILE__, __LINE__,
-                                            logMsg, 0);
-            return true;
-          }
-      }
-    }
-  return false;
-}
-#endif
-
 void GuaConnectionToServer::dumpAndStopOtherEnd(bool dump, bool stop) const
 {
   getOtherEnd().getPhandle().dumpAndStop(dump, stop);
@@ -2807,19 +2620,13 @@ WaitReturnStatus GuaReceiveControlConnection::wait(IpcTimeout timeout, UInt32 *e
     guaReceiveFastStart_->fileGetReceiveInfo_ = FALSE;
   }
   else
-#ifdef SQ_NEW_PHANDLE
   guaErrorInfo_ = BFILE_GETRECEIVEINFO_((FS_Receiveinfo_Type *)&receiveInfo);
-#else
-  guaErrorInfo_ = BFILE_GETRECEIVEINFO_((short *) &receiveInfo);
-#endif // SQ_NEW_PHANDLE
   if (systemMessageReceived && (msgType == ZSYS_VAL_SMSG_CLOSE))
   {
     Int32 cpu, pin, nodeNumber;
     SB_Int64_Type seqNum = -1;
     receiveInfo.phandle_.decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
        , seqNum
-#endif
        );
 
     env_->closeTrace(__LINE__, receiveInfo.clientFileNumber_, cpu, pin, nodeNumber);
@@ -2920,9 +2727,7 @@ WaitReturnStatus GuaReceiveControlConnection::wait(IpcTimeout timeout, UInt32 *e
       Int32 cpu, pin, nodeNumber;
       SB_Int64_Type seqNum = -1;
       receiveInfo.phandle_.decompose(cpu, pin, nodeNumber
-#ifdef SQ_PHANDLE_VERIFIER
        , seqNum
-#endif
        );
       env_->closeTrace(__LINE__, receiveInfo.clientFileNumber_, 
                        cpu, pin, seqNum); // Persistent open simulated close
@@ -3674,11 +3479,6 @@ IpcGuardianServer::IpcGuardianServer(
   nowaitedEspStartup_.procCreateError_ = &procCreateError_;
   nowaitedEspStartup_.newPhandle_ = &newPhandle_;
   nowaitedEspStartup_.nowaitedStartupCompleted_ = &nowaitedStartupCompleted_;
-#ifndef SQ_PHANDLE_VERIFIER
-  // ALM 4528
-  creationTime_.tv_sec = 0;
-  creationTime_.tv_nsec = 0;
-#endif
   unhooked_ = false;
 }
 
@@ -3716,43 +3516,7 @@ void IpcGuardianServer::stop()
     
     if (!guaRetcode)
     { 
-#ifdef SQ_PHANDLE_VERIFIER
       msg_mon_stop_process_name(phandle.getPhandleString());
-#else
-      memcpy(procName, phandle.getPhandleString(), phandle.getPhandleStringLen() + 1);
-      procName[phandle.getPhandleStringLen()] = 0; // null-terminate
-      msg_mon_get_process_info (procName, &nid, &pid);
-      MS_Mon_Process_Info_Type procInfo;
-      Int32 rc = msg_mon_get_process_info_detail(procName, &procInfo);
-      if (rc == XZFIL_ERR_OK)
-      {
-        // When stopping an ESP by name, check the ESPs creation timestamp
-        // to see if the ESP was started by this master.  Helps when process
-        // names are reused.  See ALM CR 4528.  When SQF is enhanced to
-        // handle this problem (see enhancement CR 4780) we can remove this
-        // work-around logic.
-        if ((procInfo.creation_time.tv_sec  == creationTime_.tv_sec) &&
-            (procInfo.creation_time.tv_nsec == creationTime_.tv_nsec))
-          msg_mon_stop_process(procName, nid, pid);
-        else
-        {
-          // LCOV_EXCL_START
-          if (controlConnection_->getEnvironment() &&
-              controlConnection_->getEnvironment()->getLogReleaseEsp())
-          {
-            char logMsg[200];
-            str_sprintf(logMsg, "Another instance of CR 4528 avoided "
-                                "by not stopping process %s.", procName);
-            SQLMXLoggingArea::logExecRtInfo(__FILE__, __LINE__,
-                                            logMsg, 0);
-          }
-          // LCOV_EXCL_STOP
-
-        }
-      }
-      else
-        ;  // Normal case would be error 14.
-#endif
     }
   }
 }
@@ -3868,25 +3632,6 @@ void IpcGuardianServer::acceptSystemMessage(const char *sysMsg,
 	    // process was successfully created, now create a connection to it
 	    IpcProcessId serverProcId(
 		 (const GuaProcessHandle &) processCreateNowaitMsg->z_phandle);
-#ifndef SQ_PHANDLE_VERIFIER
-           MS_Mon_Process_Info_Type procInfo;
-           char espName[32];
-           Int32 espNameLen = serverProcId.getPhandle().toAscii(
-                                                espName, sizeof(espName));
-           assert(espNameLen < sizeof(espName));
-           espName[espNameLen] = '\0';
-           Int32 rc = msg_mon_get_process_info_detail(espName, &procInfo);
-           if (rc != FEOK)
-           {
-             // Race condition can cause this - server process ended 
-             // very soon after it started. See ALM CR 5360.
-             guardianError_ = 4022;
-             procCreateError_ = rc;
-             serverState_      = ERROR_STATE;
-             return;
-           }
-           creationTime_ = procInfo.creation_time;
-#endif
 	    NABoolean useGuaIpc = TRUE;
 	    if (useGuaIpc)
               {
@@ -3898,10 +3643,6 @@ void IpcGuardianServer::acceptSystemMessage(const char *sysMsg,
                                         nowaitDepth_,
                                         eye_GUA_CONNECTION_TO_SERVER,
                                         parallelOpens_, NULL, FALSE
-#ifndef SQ_PHANDLE_VERIFIER
-                                        , creationTime_.tv_sec
-                                        , creationTime_.tv_nsec
-#endif
                    );
 
                 if (controlConnection_->getState() == IpcConnection::ERROR_STATE)
@@ -4295,11 +4036,7 @@ void IpcGuardianServer::launchNSKLiteProcess(ComDiagsArea **diags,
 			    process_name,   /* output process name */
 			    largc,          /* args */
 			    largv,
-#ifdef SQ_NEW_PHANDLE
 			    &p_phandle,
-#else
-			    (short *) &p_phandle, /* phandle */
-#endif // SQ_NEW_PHANDLE
 			    0,              /* open */
 			    &server_oid,    /* oid */
 			    processType, /* process type */
@@ -4413,12 +4150,8 @@ void IpcGuardianServer::spawnProcess(ComDiagsArea **diags,
 void IpcGuardianServer::useProcess(ComDiagsArea **diags,
 				      CollHeap *diagsHeap)
 {
-#ifdef SQ_NEW_PHANDLE 
   NSK_PORT_HANDLE *procHandle;
   NSK_PORT_HANDLE procHandleCopy;
-#else
-  short *procHandle;
-#endif
   short usedlength;
   char processName[50];
   char *tmpProcessName;
@@ -4535,13 +4268,9 @@ NABoolean IpcGuardianServer::serverDied()
   char pname[PhandleStringLen];
   Int32 pnameLen = ph.toAscii(pname, PhandleStringLen);
   pname[pnameLen] = '\0';
-#ifdef SQ_PHANDLE_VERIFIER
   int nid, pid;
   SB_Verif_Type verifier;
   int rc = msg_mon_get_process_info2(pname, &nid, &pid, &verifier);
-#else
-  int nid, pid; int rc = msg_mon_get_process_info(pname, &nid, &pid);
-#endif
   return rc != 0 ;
 }
 
@@ -4640,6 +4369,5 @@ NABoolean useGuaIpc = TRUE;
 }
 #endif /* LOG_IPC || LOG_RECEIVE */
 
-#endif /* NA_GUARDIAN_IPC || NA_GUARDIAN_MSG*/
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/IpcMessageType.h
----------------------------------------------------------------------
diff --git a/core/sql/common/IpcMessageType.h b/core/sql/common/IpcMessageType.h
index a41ab5c..a6e7af0 100644
--- a/core/sql/common/IpcMessageType.h
+++ b/core/sql/common/IpcMessageType.h
@@ -221,12 +221,7 @@ enum IpcMessageTypeEnum
 
 };
 
-#ifdef NA_64BIT
-// dg64 - 32-bit message type
 typedef Int32  IpcMessageType;
-#else
-typedef Lng32 IpcMessageType;
-#endif
 
 // -----------------------------------------------------------------------
 // Types for objects inside messages (a different space of numbers for
@@ -236,22 +231,12 @@ typedef Lng32 IpcMessageType;
 // allows us to manage the enum types separately per component of the
 // SQL system without forcing global recompiles on small changes.
 // -----------------------------------------------------------------------
-#ifdef NA_64BIT
 typedef Int32  IpcMessageObjType;
-// dg64 - 32-bit message obj type
-#else
-typedef Lng32 IpcMessageObjType;
-#endif
 
 // -----------------------------------------------------------------------
 // Version of a message header or of an object in a message
 // -----------------------------------------------------------------------
-#ifdef NA_64BIT
-// dg64 - 32-bit message obj version type
 typedef Int32  IpcMessageObjVersion;
-#else
-typedef Lng32 IpcMessageObjVersion;
-#endif
 
 // -----------------------------------------------------------------------
 // Reserved numbers for certain common objects in messages, to be
@@ -284,34 +269,19 @@ const IpcMessageObjVersion IpcCurrSqlDiagnosticsAreaVersion = 100;
 const IpcMessageObjVersion IpcCurrSqlStatisticsVersion      = 100;
 const IpcMessageObjVersion IpcCurrProcessIdVersion          = 100;
 
-#ifdef NA_64BIT
-// dg64 - 32-bit message type
 typedef Int32  IpcMessageType;
-#else
-typedef Lng32 IpcMessageType;
-#endif
 
 // -----------------------------------------------------------------------
 // size of objects in bytes
 // -----------------------------------------------------------------------
 
-#ifdef NA_64BIT
-// dg64 - 32-bit message obj size
 typedef UInt32  IpcMessageObjSize;
-#else
-typedef ULng32 IpcMessageObjSize;
-#endif
 
 // -----------------------------------------------------------------------
 // Reference count of a message header or of an object in a message
 // (used mainly when objects are shared across the IPC interface)
 // -----------------------------------------------------------------------
-#ifdef NA_64BIT
-// dg64 - 32-bit message ref count
 typedef Int32   IpcMessageRefCount;
-#else
-typedef Lng32  IpcMessageRefCount;
-#endif
 
 // -----------------------------------------------------------------------
 // A buffer pointer to a raw, byte-adressable  message buffer, used for
@@ -356,23 +326,14 @@ const short IpcMyAlignment = IpcAlignment8;
 // a value of 100 means 1 sec), 0 means return immediately,
 // IpcInfiniteTimeout waits forever
 // -----------------------------------------------------------------------
-#ifdef NA_64BIT
 typedef Int32  IpcTimeout;
-#else
-typedef Lng32 IpcTimeout;
-#endif
 const IpcTimeout IpcImmediately = 0;
 const IpcTimeout IpcInfiniteTimeout = -1;
 
 // -----------------------------------------------------------------------
 // CPU number in a node
 // -----------------------------------------------------------------------
-#ifdef NA_64BIT
-// dg64 - 32-bit cpu num
 typedef Int32  IpcCpuNum;
-#else
-typedef Lng32 IpcCpuNum;
-#endif
 
 // an invalid CPU number in a node
 const IpcCpuNum IPC_CPU_DONT_CARE = -1;
@@ -380,12 +341,7 @@ const IpcCpuNum IPC_CPU_DONT_CARE = -1;
 // -----------------------------------------------------------------------
 // Priority of a started process
 // -----------------------------------------------------------------------
-#ifdef NA_64BIT
-// dg64 - 32-bit priority
 typedef Int32  IpcPriority;
-#else
-typedef Lng32 IpcPriority;
-#endif
 
 const IpcPriority IPC_PRIORITY_DONT_CARE = -1;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/IpcSockets.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/IpcSockets.cpp b/core/sql/common/IpcSockets.cpp
index 70a1858..d075236 100644
--- a/core/sql/common/IpcSockets.cpp
+++ b/core/sql/common/IpcSockets.cpp
@@ -61,12 +61,6 @@ void IpcSockLogTimestamp(Int32 fdesc); // see bottom of file
 const Int32 SOCKET_ERROR = -1;
 typedef size_t length_t;
 
-
-// for system procedure calls (close,dup2,fork,execve)
-#if defined(NA_OSS) || defined(NA_HSC_LINUX) || defined(NA_HSC_HPUX) || defined(NA_HSC_LINUX)
-# include <unistd.h>
-#endif
-
 #include <errno.h>
 #include <sys/time.h>
 
@@ -416,12 +410,7 @@ SockPortNumber SockSocket::bindOrConnect(const SockIPAddress &ipAddr,
 
   // return the port that the socket is now bound to
 
-#ifdef NA_64BIT
-  // dg64 - use 64-bit i/f
   socklen_t namelen = sizeof(targetSockAddr);
-#else
-  length_t namelen = sizeof(targetSockAddr);
-#endif
   retcode = ::getsockname(fdesc_,&targetSockAddr,&namelen);
   if (retcode == SOCKET_ERROR)
     setFromerrno("::getsockname()");
@@ -814,12 +803,7 @@ NABoolean SockSocket::accept(SockFdesc &fdesc, IpcTimeout timeout)
     } // non-infinite timeout
 
   struct sockaddr clientSockAddr;
-#ifdef NA_64BIT
-  // dg64 - use 64-bit i/f
   socklen_t addrlen = sizeof(clientSockAddr);
-#else
-  length_t addrlen = sizeof(clientSockAddr);
-#endif
 
   // call the accept() system call, waiting until a client wants to connect
   Int32 retcode = ::accept(fdesc_,&clientSockAddr,&addrlen);
@@ -1427,8 +1411,6 @@ SockControlConnection::SockControlConnection(
   cout << "Listening to port " << setw(11) << listnerPortNum_ << "\n" << flush;
 }
 
-#ifdef NA_64BIT
-// dg64 - stub
 SockControlConnection::SockControlConnection(
      IpcEnvironment *env, Int32 inheritedSocket, Int32 passedPort, const char *eye)
      : IpcControlConnection(IPC_DOM_INTERNET),
@@ -1436,8 +1418,6 @@ SockControlConnection::SockControlConnection(
 {
     assert(0);
 }
-#endif
-
 
 IpcConnection *SockControlConnection::getConnection() const
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/NAAssert.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAAssert.h b/core/sql/common/NAAssert.h
index deab336..4c37de7 100644
--- a/core/sql/common/NAAssert.h
+++ b/core/sql/common/NAAssert.h
@@ -64,8 +64,6 @@ NAAssert((errMsg), __FILE__, __LINE__); }
 #include "Platform.h"
 #include "NAMemory.h"
 
-#include "SqlExportDllDefines.h"
-
 #include <setjmp.h>
 
 #include <pthread.h>
@@ -76,15 +74,15 @@ NAAssert((errMsg), __FILE__, __LINE__); }
 int NAAssertMutexCreate(); // Function to create mutex to serialize termination
 int NAAssertMutexLock();  // Function to lock mutext when a process terminates of a thread asserts
 
-extern NA_EIDPROC void SQLEXPORT_LIB_FUNC NAAssert(const char *ex, const char *fil, Int32 lin);
+extern void NAAssert(const char *ex, const char *fil, Int32 lin);
 
-extern void SQLEXPORT_LIB_FUNC NABreakPoint();
+extern void NABreakPoint();
 
 extern void NAInlineBreakpointFunc(const char *fil, Int32 lin);
 
-NA_EIDPROC void assert_botch_no_abend( const char *f, Int32 l, const char * m);
+void assert_botch_no_abend( const char *f, Int32 l, const char * m);
 // Add condition pointer (fourth argument) for certain SeaMonster asserts
-NA_EIDPROC void assert_botch_abend( const char *f, Int32 l, const char * m, const char *c = NULL);
+void assert_botch_abend( const char *f, Int32 l, const char * m, const char *c = NULL);
 #ifdef NDEBUG
   #define NAInlineBreakpoint
 #else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/NAError.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAError.h b/core/sql/common/NAError.h
index eefa516..38f0421 100644
--- a/core/sql/common/NAError.h
+++ b/core/sql/common/NAError.h
@@ -81,12 +81,10 @@ public:
   // ---------------------------------------------------------------------
   // Constructor
   // ---------------------------------------------------------------------
-  NA_EIDPROC
   NAErrorParam(Lng32 l) : errParamType_(NAERROR_PARAM_TYPE_INTEGER),
                          longValue_(l)
   { }
 
-  NA_EIDPROC
   NAErrorParam(char * s) : errParamType_(NAERROR_PARAM_TYPE_CHAR_STRING),
                            stringValue_(s)
   { }
@@ -94,7 +92,7 @@ public:
   // ---------------------------------------------------------------------
   // Destructor
   // ---------------------------------------------------------------------
-  NA_EIDPROC virtual ~NAErrorParam() {};
+  virtual ~NAErrorParam() {};
 
   // ---------------------------------------------------------------------
   // Ideally, there should be just one method for returning a string for
@@ -126,13 +124,13 @@ public:
   //       }
   //
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAErrorParamType getNAErrorParamType() const
+  NAErrorParamType getNAErrorParamType() const
   { return errParamType_; }
 
-  NA_EIDPROC Lng32 getIntegerNAErrorParam() const
+  Lng32 getIntegerNAErrorParam() const
   { return longValue_; }
 
-  NA_EIDPROC char * getStringNAErrorParam() const
+  char * getStringNAErrorParam() const
   { return stringValue_; }
 
 protected:
@@ -157,7 +155,7 @@ public:
   // The first argument, numParams, ends up deciding how many of the
   // following parameters are relevant.
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAErrorParamArray(Lng32 numParams = 0,
+  NAErrorParamArray(Lng32 numParams = 0,
             NAErrorParam * errParam0 = 0,
             NAErrorParam * errParam1 = 0,
             NAErrorParam * errParam2 = 0,
@@ -170,17 +168,17 @@ public:
             NAErrorParam * errParam9 = 0
            );
 
-  NA_EIDPROC virtual ~NAErrorParamArray();
+  virtual ~NAErrorParamArray();
 
   // ---------------------------------------------------------------------
   // How many NAErrorParams are contained in the NAErrorParamArray?
   // ---------------------------------------------------------------------
-  NA_EIDPROC Lng32 entries() const { return numParams_; }
+  Lng32 entries() const { return numParams_; }
 
   // ---------------------------------------------------------------------
   // Accessor function.
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAErrorParam * getNAErrorParam(Lng32 paramNo) const
+  NAErrorParam * getNAErrorParam(Lng32 paramNo) const
   {
     if (  (paramNo >= 0) && (paramNo < numParams_ ) )
       return array_[paramNo].errParam_;
@@ -249,7 +247,7 @@ public:
   // ---------------------------------------------------------------------
   // Constructor
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAError(const NAErrorCode errCode = 0,
+  NAError(const NAErrorCode errCode = 0,
           const NAErrorType errType = NAERROR_NONE,
       const NASubsys subsys = NA_UNKNOWN,
       NAErrorParamArray * errParams = 0,
@@ -261,19 +259,19 @@ public:
   // ---------------------------------------------------------------------
   // Destructor
   // ---------------------------------------------------------------------
-  NA_EIDPROC ~NAError();
+  ~NAError();
 
   // ---------------------------------------------------------------------
   // Accessor functions.
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAErrorCode getErrCode() const { return errCode_; }
-  NA_EIDPROC NAErrorType getErrType() const { return errType_; }
-  NA_EIDPROC NASubsys  getSubsys() const { return subsysId_; }
+  NAErrorCode getErrCode() const { return errCode_; }
+  NAErrorType getErrType() const { return errType_; }
+  NASubsys  getSubsys() const { return subsysId_; }
 
   // ---------------------------------------------------------------------
   // Error Parameters.
   // ---------------------------------------------------------------------
-  NA_EIDPROC Lng32 getErrParamCount() const
+  Lng32 getErrParamCount() const
     {
       if (errParams_)
     return errParams_->entries();
@@ -281,7 +279,7 @@ public:
     return 0;
     }
 
-  NA_EIDPROC NAErrorParam * getNAErrorParam(Lng32 paramNo) const
+  NAErrorParam * getNAErrorParam(Lng32 paramNo) const
   {
     if (errParams_)
       return errParams_->getNAErrorParam(paramNo);
@@ -292,22 +290,22 @@ public:
   // ---------------------------------------------------------------------
   // Procedure name and line numbers.
   // ---------------------------------------------------------------------
-  NA_EIDPROC char * getProcName() const { return procName_; }
+  char * getProcName() const { return procName_; }
 
-  NA_EIDPROC Lng32  getLineNumber() const { return lineNumber_; }
+  Lng32  getLineNumber() const { return lineNumber_; }
 
   // ---------------------------------------------------------------------
   // Method for traversing error list
   // ---------------------------------------------------------------------
-  NA_EIDPROC void setNext(NAError * errPtr) { next_ = errPtr; }
-  NA_EIDPROC NAError * getNext() const { return next_; }
+  void setNext(NAError * errPtr) { next_ = errPtr; }
+  NAError * getNext() const { return next_; }
 
   // ---------------------------------------------------------------------
   // Linearization and De-linearization functions to copy SQLDiagArea
   // tree to and from contiguous storage.
   // ---------------------------------------------------------------------
-  NA_EIDPROC Long pack(void * space);
-  NA_EIDPROC Lng32 unpack(Lng32);
+  Long pack(void * space);
+  Lng32 unpack(Lng32);
 
 private:
 
@@ -347,7 +345,7 @@ public:
   // ---------------------------------------------------------------------
   // Constructor
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAErrorStack(Lng32 maxSize)
+  NAErrorStack(Lng32 maxSize)
               : maxEntries_(maxSize), numEntries_(0), errEntry_(0),
         nextEntry_(0), iterEntries_(0)
   {
@@ -356,17 +354,17 @@ public:
   // ---------------------------------------------------------------------
   // Destructor
   // ---------------------------------------------------------------------
-  NA_EIDPROC ~NAErrorStack();
+  ~NAErrorStack();
 
   // ---------------------------------------------------------------------
   // Method for initializing an error stack - once per statement
   // ---------------------------------------------------------------------
-  NA_EIDPROC void clear();
+  void clear();
 
   // ---------------------------------------------------------------------
   // Method for returning the error code for the latest error
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAErrorCode getErrCode()
+  NAErrorCode getErrCode()
   {
     if (errEntry_ != (NAError *)0)
       return errEntry_->getErrCode();
@@ -377,13 +375,13 @@ public:
   // ---------------------------------------------------------------------
   // Method for adding a new Error
   // ---------------------------------------------------------------------
-  NA_EIDPROC void addErrEntry(NAError * errPtr);
+  void addErrEntry(NAError * errPtr);
 
   // ---------------------------------------------------------------------
   // Iterator over all errors
   // ---------------------------------------------------------------------
-  NA_EIDPROC NAError * getFirst(); // initialize the iterator
-  NA_EIDPROC NAError * getNext();  // behaviour undefined unless getFirst() was called
+  NAError * getFirst(); // initialize the iterator
+  NAError * getNext();  // behaviour undefined unless getFirst() was called
 
 private:
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/NAHeap.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAHeap.h b/core/sql/common/NAHeap.h
index 0cf12b5..7c00356 100644
--- a/core/sql/common/NAHeap.h
+++ b/core/sql/common/NAHeap.h
@@ -94,16 +94,12 @@ class NASpace : public CollHeap
 {
 public:
 
-NA_EIDPROC
   NASpace(Space::SpaceType t=Space::SYSTEM_SPACE);
 
-NA_EIDPROC
   virtual ~NASpace();
 
-NA_EIDPROC
   virtual void * allocateMemory(size_t size, NABoolean failureIsFatal = TRUE);
 
-NA_EIDPROC
   virtual void deallocateMemory(void*)
     {
 #ifdef NAHEAP__DEBUG
@@ -111,18 +107,14 @@ NA_EIDPROC
 #endif
     }
 
-#if (defined(_DEBUG) || defined(NSK_MEMDEBUG)) && !defined(__EID)
-NA_EIDPROC
+#if (defined(_DEBUG) || defined(NSK_MEMDEBUG))
   virtual void dump(ostream* outstream, Lng32 indent) {};
 #else
-NA_EIDPROC
   inline void dump(void* outstream, Lng32 indent) {}
 #endif
 
 private:
-NA_EIDPROC
   NASpace(const NASpace&);
-NA_EIDPROC
   NASpace& operator =(const NASpace&);
 
   Space s_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/NAIpc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/NAIpc.cpp b/core/sql/common/NAIpc.cpp
index 231dcfa..b6a20bb 100644
--- a/core/sql/common/NAIpc.cpp
+++ b/core/sql/common/NAIpc.cpp
@@ -107,7 +107,7 @@ NAMessage::NAMessage(IpcNetworkDomain domain) :
     {
       switch (domain)
 	{
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 	case IPC_DOM_GUA_PHANDLE:
 
 	  // open $RECEIVE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1522c8cd/core/sql/common/NAIpc.h
----------------------------------------------------------------------
diff --git a/core/sql/common/NAIpc.h b/core/sql/common/NAIpc.h
index 433b8cb..bb88e4c 100644
--- a/core/sql/common/NAIpc.h
+++ b/core/sql/common/NAIpc.h
@@ -97,7 +97,7 @@ public:
   // stdin and stdout (both Unix and NSK).
   // ---------------------------------------------------------------------
   NAMessage(IpcNetworkDomain domain
-#if (defined(NA_GUARDIAN_IPC) || defined(NA_GUARDIAN_MSG))
+#if (defined(NA_GUARDIAN_IPC))
 	    // when compiling on NSK systems the default is $RECEIVE
 	    = IPC_DOM_GUA_PHANDLE
 #else