[ 
https://issues.apache.org/jira/browse/TRAFODION-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15413655#comment-15413655
 ] 

ASF GitHub Bot commented on TRAFODION-2146:
-------------------------------------------

Github user prashanth-vasudev commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/647#discussion_r74074060
  
    --- Diff: core/sqf/src/stfs/stfs_stub.cpp ---
    @@ -328,63 +332,69 @@ copySTFSLocation(int pv_instnum)
     {
     
       //Directory locations not specified 
    -  if ((STFS_stub::stfsDirsHDD_.numLocations <= 0) && 
(STFS_stub::overflowType_ == STFS_HDD)) {
    +  if ((STFS_stub::stfsDirsHDD_.numLocations <= 0) && 
(STFS_stub::overflowType_ == STFS_HDD)) 
         return;
    -  }
    -  if ((STFS_stub::stfsDirsSSD_.numLocations <= 0) && 
(STFS_stub::overflowType_ == STFS_SSD)) {
    +  
    +  if ((STFS_stub::stfsDirsSSD_.numLocations <= 0) && 
(STFS_stub::overflowType_ == STFS_SSD)) 
         return;
    -  }
    +  
     
     
    -  if(STFS_stub::overflowType_ == STFS_HDD) {
    -    copyLocationHelper(STFS_stub::stfsDirsHDD_, pv_instnum);
    -  }
    -  else if(STFS_stub::overflowType_ == STFS_SSD) {
    +  if(STFS_stub::overflowType_ == STFS_HDD) 
    +    copyLocationHelper(STFS_stub::stfsDirsHDD_, pv_instnum);  
    +  else if(STFS_stub::overflowType_ == STFS_SSD) 
         copyLocationHelper(STFS_stub::stfsDirsSSD_, pv_instnum);
    -  }
    +  
     
    -  if (STFS_stub::stfsLocation_[strlen(STFS_stub::stfsLocation_) - 1] != 
'/') {
    +  if (STFS_stub::stfsLocation_[strlen(STFS_stub::stfsLocation_) - 1] != 
'/') 
         strcat(STFS_stub::stfsLocation_, "/");
    -  }
    -
    +  
     }
     
    +/// \brief Sets the scratchdisks as specified in the CQD SCRATCH_DISKS 
    +///        and avoids looking at envvar
    +void STFS_set_scratch_dirs(char *pv_scratchloc) 
    +{
    +   memset(STFS_stub::scratchCQDLocationString_, 0, 
sizeof(STFS_stub::scratchCQDLocationString_));
    +  strcpy((char *)STFS_stub::scratchCQDLocationString_,pv_scratchloc);
    +}
     /// \brief Checks for the Location Env Variable 
     ///        and processes it
     void STFS_checkLocation(int pv_instnum) 
     {
    +  char *lp_HDDEnvLocation = getenv("STFS_HDD_LOCATION");
    +  char *lp_SSDEnvLocation = getenv("STFS_SSD_LOCATION");
       if (STFS_stub::locationEnvChecked_) {
         copySTFSLocation(pv_instnum);
         return;
       }
    -
    -  char *lp_HDDEnvLocation = getenv("STFS_HDD_LOCATION");
    -  char *lp_SSDEnvLocation = getenv("STFS_SSD_LOCATION");
    -  char *lp_EnvLocation    = getenv("STFS_LOCATION");
    -
    +  if ((strlen(STFS_stub::scratchCQDLocationString_)>0) && 
(STFS_stub::overflowType_ == STFS_HDD)) 
    --- End diff --
    
    In general, in this stfs layer, since we are in linux environment, HDD or 
SSD need not be distinguished. Both will be specified by simple directory path. 
STFS layer need not do separate handling for each.  Code can be simplified.


> Use of CQD to set scratch directory locations
> ---------------------------------------------
>
>                 Key: TRAFODION-2146
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2146
>             Project: Apache Trafodion
>          Issue Type: Improvement
>          Components: foundation, sql-exe
>            Reporter: Sandhya Sundaresan
>            Assignee: Sandhya Sundaresan
>
> Allow a CQD specification to override the env settings for STFS locations.
> Currently the scratch directory locations and set at installtion time . The 
> STFS layer that manages the scratch file creation reads the envvar in ms.env 
> to determine where to create the scratch files.
> Now we allow a CQD to be specified that will override the envvar setting. If 
> the CQD is not set (empty) , the envvar setting will work. This will give the 
> user some flexibility to change scratch directory locations. The requirement 
> is that the directoryies MUST exists on every node and that Trafodion user 
> will need permissions to write to those directories. If not an error will be 
> returned when a query invliving sort/hash overflow is executed. . 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to