Skip to content

Commit

Permalink
Merge branch 'develop-1.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxJedi committed Oct 30, 2017
2 parents f6060a2 + 0139ae1 commit a347a8f
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 72 deletions.
76 changes: 38 additions & 38 deletions dbcon/joblist/tupleaggregatestep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ namespace

struct cmpTuple
{
bool operator()(tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> a,
tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> b)
bool operator()(boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> a,
boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> b)
{
if (get<0>(a) < get<0>(b))
if (boost::get<0>(a) < boost::get<0>(b))
return true;

if (get<0>(a) == get<0>(b))
if (boost::get<0>(a) == boost::get<0>(b))
{
if (get<1>(a) < get<1>(b))
if (boost::get<1>(a) < boost::get<1>(b))
return true;

if (get<1>(a) == get<1>(b))
return get<2>(a) < get<2>(b);
if (boost::get<1>(a) == boost::get<1>(b))
return boost::get<2>(a) < boost::get<2>(b);
}

return false;
Expand All @@ -101,7 +101,7 @@ typedef vector<RowBucket> RowBucketVec;
// The AGG_MAP type is used to maintain a list of aggregate functions in order to
// detect duplicates. Since all UDAF have the same op type (ROWAGG_UDAF), we add in
// the function pointer in order to ensure uniqueness.
typedef map<tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*>, uint64_t, cmpTuple> AGG_MAP;
typedef map<boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*>, uint64_t, cmpTuple> AGG_MAP;

inline RowAggFunctionType functionIdMap(int planFuncId)
{
Expand Down Expand Up @@ -1477,7 +1477,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
}

// find if this func is a duplicate
AGG_MAP::iterator iter = aggFuncMap.find(make_tuple(key, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggFuncMap.find(boost::make_tuple(key, aggOp, pUDAFFunc));

if (iter != aggFuncMap.end())
{
Expand All @@ -1494,7 +1494,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
}
else
{
aggFuncMap.insert(make_pair(make_tuple(key, aggOp, pUDAFFunc), funct->fOutputColumnIndex));
aggFuncMap.insert(make_pair(boost::make_tuple(key, aggOp, pUDAFFunc), funct->fOutputColumnIndex));
}
}

Expand Down Expand Up @@ -1704,7 +1704,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
typeAgg.push_back(typeProj[colProj]);
widthAgg.push_back(widthProj[colProj]);

aggFuncMap.insert(make_pair(make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
colAgg++;
}

Expand Down Expand Up @@ -1745,7 +1745,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
typeAgg.push_back(typeProj[colProj]);
widthAgg.push_back(widthProj[colProj]);

aggFuncMap.insert(make_pair(make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
colAgg++;
}

Expand Down Expand Up @@ -1775,7 +1775,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
SP_ROWAGG_FUNC_t funct(new RowAggFunctionCol(
aggOp, stats, colAgg, colAgg, -1));
functionVec1.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
colAgg++;

continue;
Expand Down Expand Up @@ -1831,11 +1831,11 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
}

// skip if this is a duplicate
if (aggFuncMap.find(make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
if (aggFuncMap.find(boost::make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
continue;

functionVec1.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));

switch (aggOp)
{
Expand Down Expand Up @@ -2081,7 +2081,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
{
SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(i, -1));
groupByNoDist.push_back(groupby);
aggFuncMap.insert(make_pair(make_tuple(keysAgg[i], 0, pUDAFFunc), i));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAgg[i], 0, pUDAFFunc), i));
}

// locate the return column position in aggregated rowgroup
Expand All @@ -2096,7 +2096,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) !=
jobInfo.distinctColVec.end() )
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, 0, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, 0, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand Down Expand Up @@ -2208,7 +2208,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
case ROWAGG_BIT_XOR:
default:
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand Down Expand Up @@ -2239,7 +2239,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
// check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME)
{
it = aggFuncMap.find(make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
it = aggFuncMap.find(boost::make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand Down Expand Up @@ -2417,7 +2417,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
functionVec2.push_back(funct);

// find if this func is a duplicate
AGG_MAP::iterator iter = aggDupFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggDupFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));

if (iter != aggDupFuncMap.end())
{
Expand All @@ -2434,7 +2434,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
}
else
{
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc),
aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex));
}

Expand Down Expand Up @@ -2910,7 +2910,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);

aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}

Expand Down Expand Up @@ -2951,7 +2951,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);

aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}

Expand Down Expand Up @@ -3011,11 +3011,11 @@ void TupleAggregateStep::prep2PhasesAggregate(
}

// skip if this is a duplicate
if (aggFuncMap.find(make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
if (aggFuncMap.find(boost::make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
continue;

functionVecPm.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));

switch (aggOp)
{
Expand Down Expand Up @@ -3269,7 +3269,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
pUDAFFunc = udafc->getContext().getFunction();
}

AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand All @@ -3290,7 +3290,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
// check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME)
{
it = aggFuncMap.find(make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
it = aggFuncMap.find(boost::make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand Down Expand Up @@ -3435,7 +3435,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
functionVecUm.push_back(funct);

// find if this func is a duplicate
AGG_MAP::iterator iter = aggDupFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggDupFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));

if (iter != aggDupFuncMap.end())
{
Expand All @@ -3452,7 +3452,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
}
else
{
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc),
aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex));
}

Expand Down Expand Up @@ -3707,7 +3707,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);

aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}

Expand Down Expand Up @@ -3748,7 +3748,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);

aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}

Expand Down Expand Up @@ -3815,11 +3815,11 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
}

// skip if this is a duplicate
if (aggFuncMap.find(make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
if (aggFuncMap.find(boost::make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
continue;

functionVecPm.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));

switch (aggOp)
{
Expand Down Expand Up @@ -4110,7 +4110,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) !=
jobInfo.distinctColVec.end() )
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, 0, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, 0, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand Down Expand Up @@ -4228,7 +4228,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
case ROWAGG_CONSTANT:
default:
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand All @@ -4249,7 +4249,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
// check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME)
{
it = aggFuncMap.find(make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
it = aggFuncMap.find(boost::make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));

if (it != aggFuncMap.end())
{
Expand Down Expand Up @@ -4384,7 +4384,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
functionVecUm.push_back(funct);

// find if this func is a duplicate
AGG_MAP::iterator iter = aggDupFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggDupFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));

if (iter != aggDupFuncMap.end())
{
Expand All @@ -4401,7 +4401,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
}
else
{
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc),
aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex));
}

Expand Down
1 change: 1 addition & 0 deletions extra/format.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#!/bin/bash
astyle --style=allman --indent=spaces=4 --indent-switches --break-blocks --pad-comma --pad-oper --pad-header --lineend=linux --align-pointer=type --recursive "*.cpp" "*.h"
1 change: 1 addition & 0 deletions oam/etc/Columnstore.xml.singleserver
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@
<JavaHome>unassigned</JavaHome>
<JavaPath>unassigned</JavaPath>
<MySQLPort>3306</MySQLPort>
<DistributedInstall>y</DistributedInstall>
</Installation>
<ExtentMap>
<!--
Expand Down
3 changes: 3 additions & 0 deletions oamapps/postConfigure/installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@ int main(int argc, char* argv[])

cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;

cout << "NOTE: The MariaDB ColumnStore Alias Commands are in /etc/profile.d/columnstoreAlias" << endl << endl;

exit (1);
}

Expand Down
2 changes: 2 additions & 0 deletions oamapps/postConfigure/postConfigure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3990,6 +3990,8 @@ int main(int argc, char* argv[])
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;

cout << "NOTE: The MariaDB ColumnStore Alias Commands are in /etc/profile.d/columnstoreAlias" << endl << endl;

exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion procmgr/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ static void startMgrProcessThread()
}
catch (...)
{
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "ERROR: get DistributedInstall", LOG_TYPE_ERROR);
}

//Send out a start service just to make sure Columnstore is runing on remote nodes
Expand Down
32 changes: 2 additions & 30 deletions procmon/processmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5157,7 +5157,7 @@ int ProcessMonitor::changeMyCnf(std::string type)
{
*/ //get slave id based on ExeMgrx setup
string slaveID = "0";
string slaveModuleName = config.moduleName();
string localModuleName = config.moduleName();

for ( int id = 1 ; ; id++ )
{
Expand All @@ -5170,37 +5170,9 @@ int ProcessMonitor::changeMyCnf(std::string type)
Config* sysConfig = Config::makeConfig();
moduleName = sysConfig->getConfig(Section, "Module");

if ( moduleName == slaveModuleName )
if ( moduleName == localModuleName )
{
slaveID = oam.itoa(id);

// if slave ID from above is 1, then it means this is a former Original master and use the ID of the current Master
if ( slaveID == "1" )
{
string PrimaryUMModuleName;
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);

for ( int mid = 1 ; ; mid++ )
{
string Section = "ExeMgr" + oam.itoa(mid);

string moduleName;

try
{
Config* sysConfig = Config::makeConfig();
moduleName = sysConfig->getConfig(Section, "Module");

if ( moduleName == PrimaryUMModuleName )
{
slaveID = oam.itoa(mid);
break;
}
}
catch (...) {}
}
}

break;
}
}
Expand Down
Loading

0 comments on commit a347a8f

Please sign in to comment.