Exemple #1
0
 protected function map($key, $value)
 {
     if ($log = \Hadoophp\MapReduce\Util::parseApacheLogLine($value)) {
         $this->emit("LongValueSum:" . $log['datetime']->format('H'), 1);
         // diagnostics
         if (HADOOPHP_DEBUG) {
             $this->emitCounter('com.github.dzuelke.hadoophp.examples.HitsByHour', 'MAP_PARSED_RECORDS');
         }
     } else {
         // diagnostics
         if (HADOOPHP_DEBUG) {
             $this->emitCounter('com.github.dzuelke.hadoophp.examples.HitsByHour', 'MAP_FAILED_RECORDS');
         }
     }
 }
Exemple #2
0
 protected function map($key, $value)
 {
     if ($log = \Hadoophp\MapReduce\Util::parseApacheLogLine($value)) {
         $this->emit($log['request_uri'], 1);
         // diagnostics
         if (HADOOPHP_DEBUG) {
             $this->emitCounter('com.github.dzuelke.hadoophp.examples.HitsByUri', 'MAP_PARSED_RECORDS');
         }
     } else {
         // diagnostics
         if (HADOOPHP_DEBUG) {
             $this->emitCounter('com.github.dzuelke.hadoophp.examples.HitsByUri', 'MAP_FAILED_RECORDS');
         }
     }
 }
Exemple #3
0
 protected function map($key, $value)
 {
     if ($log = \Hadoophp\MapReduce\Util::parseApacheLogLine($value)) {
         $this->emit(sprintf("LongValueSum:%s\t%s", $log['request_uri'], $log['datetime']->format('Y-m-d')), $log['length']);
     }
 }
Exemple #4
0
 protected function map($key, $value)
 {
     if ($log = \Hadoophp\MapReduce\Util::parseApacheLogLine($value)) {
         $this->emit("LongValueSum:" . $log['request_uri'], 1);
     }
 }