trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zellerh <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #1228: [TRAFODION-2733] Provide an improved...
Date Tue, 12 Sep 2017 19:13:34 GMT
Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1228#discussion_r138435374
  
    --- Diff: core/sql/generator/GenRelSequence.cpp ---
    @@ -1303,23 +1309,32 @@ CostScalar PhysSequence::getEstimatedRunTimeMemoryUsage(NABoolean
perCPU)
       // totalMemory is per CPU at this point of time.
       double totalMemory = historyBufferSizeInBytes;
     
    -  if ( perCPU == FALSE ) {
    -    const PhysicalProperty* const phyProp = getPhysicalProperty();
    -    if (phyProp != NULL)
    -    {
    -      PartitioningFunction * partFunc = phyProp -> getPartitioningFunction() ;
    -
    -      // totalMemory is for all CPUs at this point of time.
    -      totalMemory *= partFunc->getCountOfPartitions();
    -    }
    +  const PhysicalProperty* const phyProp = getPhysicalProperty();
    +  Lng32 numOfStreams = 1;
    +  if (phyProp != NULL)
    +  {
    +     PartitioningFunction * partFunc = phyProp -> getPartitioningFunction() ;
    +     numOfStreams = partFunc->getCountOfPartitions();
    +     if (numOfStreams <= 0)
    +        numOfStreams = 1;
    +     // totalMemory is for all CPUs at this point of time.
    +     totalMemory *= numOfStreams;
       }
    -
    +  if (numStreams != NULL)
    +     *numStreams = numOfStreams;
    +  if ( perNode == TRUE ) 
    +     totalMemory /= MINOF(MAXOF(((NAClusterInfoLinux*)gpClusterInfo)->getTotalNumberOfCPUs(),
1), numOfStreams);
    --- End diff --
    
    deja vu all over again :-)


---

Mime
View raw message