You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by anoopsharma00 <gi...@git.apache.org> on 2017/10/11 20:10:52 UTC

[GitHub] incubator-trafodion pull request #1262: TRAFODION-2731 CodeCleanup: Phase 5....

GitHub user anoopsharma00 opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1262

    TRAFODION-2731 CodeCleanup: Phase 5. Cleanup of Platform.h

    Removal of unneeded/unused entries from common/Platform.h and
    their usage from other files.
    
    Removal of some other defines that are no longer used. There
    might be a compilation error if an obsolete define is being used.
    If that happens, those defines need to be removed from the code.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anoopsharma00/incubator-trafodion ansharma_t23cc_br2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1262.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1262
    
----
commit d496f359b0e4f293892c10479059c6db6bf3474d
Author: Anoop Sharma <an...@esgyn.com>
Date:   2017-10-11T20:05:32Z

    TRAFODION-2731 CodeCleanup: Phase 5. Cleanup of Platform.h
    
    Removal of unneeded/unused entries from Platform.h and
    their usage from other files.
    
    Removal of some other defines that are no longer used. There
    might be a compilation error if an obsolete define is being used.
    If that happens, those defines need to be removed.

----


---

[GitHub] incubator-trafodion pull request #1262: TRAFODION-2731 CodeCleanup: Phase 5....

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1262#discussion_r144143139
  
    --- Diff: core/sql/common/Ipc.cpp ---
    @@ -4580,44 +4565,21 @@ IpcServerClass::IpcServerClass(IpcEnvironment *env,
       }
       if (allocationMethod_ == IPC_ALLOC_DONT_CARE)
         {
    -#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
    -	  // variable to override that mechanism.
    -	  if (getenv("SQL_NO_NSK_LITE") == NULL)
    -	  {
    -	   allocationMethod_ = IPC_LAUNCH_GUARDIAN_PROCESS;
    -	  }
    -	  else 
    -	  {
    -	   allocationMethod_ = IPC_LAUNCH_NT_PROCESS;
    -          time_t tp;
    -          time(&tp);
    -	  nextPort_ = IPC_SQLESP_PORTNUMBER + tp % 10000; // arbitrary
    -	  };
    -
    -#else // NA_GUARDIAN_IPC
    -
    -	  // NA_WINNT is set and NA_GUARDIAN_IPC is NOT set
    -	  // The standard method on NT is to create an NT process
    -	  // We use socket based communication but launch the process ourself rather
    -	  // than using INETD.
    -	  // Eventually we will use nsk lite to create new processes and to
    -	  // communicate via the message system.
    -	  // in order to run in an NT only or simulated environment we can set an environment
    -	  // variable to override that mechanism.
    -	  if (getenv("SQL_NO_NSK_LITE") == NULL)
    -	  {allocationMethod_ = IPC_LAUNCH_GUARDIAN_PROCESS;
    -	  }
    -	  else 
    -	  {
    -	  allocationMethod_ = IPC_LAUNCH_NT_PROCESS;
    +      // NA_WINNT is set and NA_GUARDIAN_IPC is set
    --- End diff --
    
    Perhaps delete this one line of the comment since the defines are no longer used?


---

[GitHub] incubator-trafodion pull request #1262: TRAFODION-2731 CodeCleanup: Phase 5....

Posted by anoopsharma00 <gi...@git.apache.org>.
Github user anoopsharma00 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1262#discussion_r144393927
  
    --- Diff: core/sql/common/Ipc.cpp ---
    @@ -4580,44 +4565,21 @@ IpcServerClass::IpcServerClass(IpcEnvironment *env,
       }
       if (allocationMethod_ == IPC_ALLOC_DONT_CARE)
         {
    -#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
    -	  // variable to override that mechanism.
    -	  if (getenv("SQL_NO_NSK_LITE") == NULL)
    -	  {
    -	   allocationMethod_ = IPC_LAUNCH_GUARDIAN_PROCESS;
    -	  }
    -	  else 
    -	  {
    -	   allocationMethod_ = IPC_LAUNCH_NT_PROCESS;
    -          time_t tp;
    -          time(&tp);
    -	  nextPort_ = IPC_SQLESP_PORTNUMBER + tp % 10000; // arbitrary
    -	  };
    -
    -#else // NA_GUARDIAN_IPC
    -
    -	  // NA_WINNT is set and NA_GUARDIAN_IPC is NOT set
    -	  // The standard method on NT is to create an NT process
    -	  // We use socket based communication but launch the process ourself rather
    -	  // than using INETD.
    -	  // Eventually we will use nsk lite to create new processes and to
    -	  // communicate via the message system.
    -	  // in order to run in an NT only or simulated environment we can set an environment
    -	  // variable to override that mechanism.
    -	  if (getenv("SQL_NO_NSK_LITE") == NULL)
    -	  {allocationMethod_ = IPC_LAUNCH_GUARDIAN_PROCESS;
    -	  }
    -	  else 
    -	  {
    -	  allocationMethod_ = IPC_LAUNCH_NT_PROCESS;
    +      // 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
    +      // variable to override that mechanism.
    +      if (getenv("SQL_NO_NSK_LITE") == NULL)
    --- End diff --
    
    There are still some parts of code which use some of the NSK and NT constructs.
    They need to be looked at carefully before removing them.
    
    But yes, obvious obsolete references like the one you pointed out, will be removed
    in a subsequent checkin. 
    
    



---

[GitHub] incubator-trafodion pull request #1262: TRAFODION-2731 CodeCleanup: Phase 5....

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/1262


---

[GitHub] incubator-trafodion pull request #1262: TRAFODION-2731 CodeCleanup: Phase 5....

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1262#discussion_r144143206
  
    --- Diff: core/sql/common/Ipc.cpp ---
    @@ -4580,44 +4565,21 @@ IpcServerClass::IpcServerClass(IpcEnvironment *env,
       }
       if (allocationMethod_ == IPC_ALLOC_DONT_CARE)
         {
    -#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
    -	  // variable to override that mechanism.
    -	  if (getenv("SQL_NO_NSK_LITE") == NULL)
    -	  {
    -	   allocationMethod_ = IPC_LAUNCH_GUARDIAN_PROCESS;
    -	  }
    -	  else 
    -	  {
    -	   allocationMethod_ = IPC_LAUNCH_NT_PROCESS;
    -          time_t tp;
    -          time(&tp);
    -	  nextPort_ = IPC_SQLESP_PORTNUMBER + tp % 10000; // arbitrary
    -	  };
    -
    -#else // NA_GUARDIAN_IPC
    -
    -	  // NA_WINNT is set and NA_GUARDIAN_IPC is NOT set
    -	  // The standard method on NT is to create an NT process
    -	  // We use socket based communication but launch the process ourself rather
    -	  // than using INETD.
    -	  // Eventually we will use nsk lite to create new processes and to
    -	  // communicate via the message system.
    -	  // in order to run in an NT only or simulated environment we can set an environment
    -	  // variable to override that mechanism.
    -	  if (getenv("SQL_NO_NSK_LITE") == NULL)
    -	  {allocationMethod_ = IPC_LAUNCH_GUARDIAN_PROCESS;
    -	  }
    -	  else 
    -	  {
    -	  allocationMethod_ = IPC_LAUNCH_NT_PROCESS;
    +      // 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
    +      // variable to override that mechanism.
    +      if (getenv("SQL_NO_NSK_LITE") == NULL)
    --- End diff --
    
    Do we want to keep the NT code?


---