13 if (hasKeyInData(key)){
14 saveBestWeight(key, value);
17 addNewResource(key, value);
22 Poco::SharedPtr<HCE::reduce::core::ReduceResultIf> reduceResult)
24 for (_reduceDataIterator = _reduceData.begin(); _reduceDataIterator != _reduceData.end();
25 _reduceDataIterator++){
26 reduceResult->addKeyValue(_reduceDataIterator->first, _reduceDataIterator->second);
30 bool SphinxReduceTask::hasKeyInData(
const std::string& mapKey)
32 _reduceDataIterator = _reduceData.find(mapKey);
33 if (_reduceDataIterator != _reduceData.end()){
39 void SphinxReduceTask::saveBestWeight(
const std::string& key,
const std::string& value)
41 if (_reduceData[key] < value){
42 _reduceData[key] = value;
46 void SphinxReduceTask::addNewResource(
const std::string& key,
const std::string& value)
48 _reduceData.insert(std::pair<std::string, std::string>(key, value));