hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
main3.cpp
Go to the documentation of this file.
2 #include <iostream>
3 
4 int main(int argc, char** argv)
5 {
6  HCE::reduce::ReducerFunctionalObjectSphinx reducerFunctionalObjectSphinx;
7 
8  std::string jsonReducingInputMessage = "";
9  unsigned long long itemId = 3;
10  int nodesCount = 2;
11 
12  //1 iteratuin
13  reducerFunctionalObjectSphinx.accumulate(jsonReducingInputMessage, itemId);
14  if (reducerFunctionalObjectSphinx.getErrCode() != HCE::reduce::OK){
15  std::cout << "1."<<reducerFunctionalObjectSphinx.getErrMsg() << std::endl;
16  }
17 
18  if (reducerFunctionalObjectSphinx.isCompleteTask(itemId, nodesCount) == true){
19  Poco::SharedPtr<HCE::reduce_types::ReducingOutputMessage>reducingOutputMessage = reducerFunctionalObjectSphinx.reduce(itemId);
20  std::cout << "reduce results\n";
21  std::cout << reducingOutputMessage->getProcessingType() << std::endl;
22  std::cout << reducingOutputMessage->getBody() << std::endl;
23  std::cout << reducingOutputMessage->getProcessingErrorCode() << std::endl;
24  std::cout << reducingOutputMessage->getProcessingErrorMsg() << std::endl;
25  std::cout << reducingOutputMessage->getProcessingElapsedTime() << std::endl;
26  }
27  else{
28  std::cout << "2." << reducerFunctionalObjectSphinx.getErrCode() << reducerFunctionalObjectSphinx.getErrMsg() << std::endl;
29  }
30  //end iteration
31 
32  return 0;
33 }