#include "Vertex.h" #include "Comper.h" #include "Runner.h" #include "Combiner.h" #define PAGERANK_ROUND 10 class PRCombiner:public Combiner { public: virtual void combine(double& old, const double& new_msg) { old += new_msg; } }; //class PRVertex:public Vertex //no combiner class PRVertex:public Vertex //with combiner { public: virtual void compute(vector& msgs, vector& edges) { if(step_num()==1) { value = 1.0; } else { double sum = 0; for(int i=0; i { char buf[100]; public: virtual VertexID parseVertex(char* line, obinstream& file_stream) { char * pch = strtok(line, "\t"); VertexID id = atoll(pch); file_stream << id; //write file_stream << 1.0; //write , init Pr = 1.0 (cannot use 1 as it is not double) file_stream << true; //write pch=strtok(NULL, " "); int num=atoi(pch); file_stream << num; //write numNbs for(int i=0; i } return id; } virtual void to_line(PRVertex& v, ofstream& fout) { fout< runner; string hdfs_inpath = argv[1]; string hdfs_outpath = argv[2]; string local_root = "iopregel_localspace"; bool dump_with_edges = false; runner.runHH(hdfs_inpath, hdfs_outpath, local_root, dump_with_edges, argc, argv); //HDFS Load, HDFS Dump return 0; }