public function __construct($output) { // parse the output as path name (just in case someone called // the constructor with an absolute path instead of a relative path) $path = new Yothalot\Path($output); // store $this->output = $path->relative(); }
* system. To find out what the absolute path name of this file is on this * machine, we make use of the Yothalot\Path class to turn the relative name * into an absolute path (GlusterFS must be mounted on this machine) * * @var Yothalot\Path */ $path = new Yothalot\Path("linecount-results.txt"); /** * Unlink the result upon start, to make sure that we don't display the previous result. */ unlink($path->absolute()); /** * Create an instance of the WordCount algorithm * @var WordCount */ $wordcount = new LineCount($path->relative()); /** * We want to send this WordCount instance to the Yothalot master. To do this, * we need an instance of this master object. * * (Under the hood, you do not connect with the Yothalot master process, but to * a RabbitMQ message queue, the login details are therefore the RabbitMQ * details) * * @var Yothalot\Master */ $master = new Yothalot\Connection(); /** * Now that we have access to the master, we can tell the master to create a * new MapReduce job, using our WordCount implementation. The return value * is a Yothalot\Job object, that has many methods to feed data to the job,
* system. To find out what the absolute path name of this file is on this * machine, we make use of the Yothalot\Path class to turn the relative name * into an absolute path (GlusterFS must be mounted on this machine) * * @var Yothalot\Path */ $path = new Yothalot\Path("wordcount-results.txt"); /** * Unlink the result upon start, to make sure that we don't display the previous result. */ unlink($path->absolute()); /** * Create an instance of the WordCount algorithm * @var WordCount */ $wordcount = new WordCount($path->relative()); /** * We want to send this WordCount instance to the Yothalot connection. To do this, * we need an instance of the connection to Yothalot. * * (Under the hood, you do not connect with the Yothalot master process, but to * a RabbitMQ message queue, the login details are therefore the RabbitMQ * details) * * @var Yothalot\Connect */ $connection = new Yothalot\Connection(); /** * Now that we have access to a connection, we can create a * new MapReduce job object, using this connection and our WordCount * implementation. The job object has many methods to feed data to the job,
/** * This should be 3x the linecount-results by definition, because * multiple inputs are being used. * * @var Yothalot\Path */ $path = new Yothalot\Path("linecount-results-3.txt"); /** * Unlink the result upon start, to make sure that we don't display the previous result. */ unlink($path->absolute()); /** * Create an instance of the merger * @var Merger */ $merger = new Merger($path->relative()); /** * We want to send this WordCount instance to the Yothalot connection. To do this, * we need an instance of the connection to Yothalot. * * (Under the hood, you do not connect with the Yothalot master process, but to * a RabbitMQ message queue, the login details are therefore the RabbitMQ * details) * * @var Yothalot\Connect */ $connection = new Yothalot\Connection(); /** * Create the merging job * @var Job */