Commit 9488c852 authored by Carla Guillen Carias's avatar Carla Guillen Carias
Browse files

Vector read from cassandra.

parent e353afe1
...@@ -147,6 +147,7 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) { ...@@ -147,6 +147,7 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
uint64_t jobEnd = jobData.endTime != 0 && my_timestamp > jobData.endTime ? jobData.endTime : my_timestamp; uint64_t jobEnd = jobData.endTime != 0 && my_timestamp > jobData.endTime ? jobData.endTime : my_timestamp;
uint64_t jobStart = jobEnd - my_timestamp < jobData.startTime ? jobData.startTime : jobEnd - my_timestamp; uint64_t jobStart = jobEnd - my_timestamp < jobData.startTime ? jobData.startTime : jobEnd - my_timestamp;
// Job units are hierarchical, and thus we iterate over all sub-units associated to each single node // Job units are hierarchical, and thus we iterate over all sub-units associated to each single node
std::vector<std::string> vectorOfSensorNames;
for (const auto& subUnit : unit->getSubUnits()) { for (const auto& subUnit : unit->getSubUnits()) {
// Since we do not clear the internal buffer, all sensor readings will be accumulated in the same vector // Since we do not clear the internal buffer, all sensor readings will be accumulated in the same vector
for (const auto& in : subUnit->getInputs()) { for (const auto& in : subUnit->getInputs()) {
...@@ -157,11 +158,19 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) { ...@@ -157,11 +158,19 @@ void PerSystSqlOperator::compute(U_Ptr unit, qeJobData& jobData) {
LOG(debug) << "PerSystSql Operator " << _name << " using scaling factor of " << _scaling_factor; LOG(debug) << "PerSystSql Operator " << _name << " using scaling factor of " << _scaling_factor;
} }
} }
if (!_queryEngine.querySensor(in->getName(), my_timestamp, my_timestamp, _buffer, false)) { /*if (!_queryEngine.querySensor(in->getName(), my_timestamp, my_timestamp, _buffer, false)) {
//LOG(debug)<< "PerSystSql Operator " << _name << " cannot read from sensor " << in->getName() << "!"; //LOG(debug)<< "PerSystSql Operator " << _name << " cannot read from sensor " << in->getName() << "!";
} }*/
vectorOfSensorNames.push_back(in->getName());
} }
} }
if(vectorOfSensorNames.size() == 0 ){
LOG(debug) << "PerSystSql Operator: No names found for vectorOfSensorNames ";
return;
}
if (!_queryEngine.querySensor(vectorOfSensorNames, my_timestamp, my_timestamp, _buffer, false)) {
LOG(debug)<< "PerSystSql Operator " << _name << " cannot read vector sensor " << (*vectorOfSensorNames.begin()) << "!";
}
uint64_t measurement_ts = 0; uint64_t measurement_ts = 0;
if(_buffer.size() == 0){ if(_buffer.size() == 0){
LOG(error) << "PerSystSql Operator " << _name << ": no data in queryEngine found!"; LOG(error) << "PerSystSql Operator " << _name << ": no data in queryEngine found!";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment