def close(self): hadoopy.status('%f-%f' % (self.ftime, self.gtime)) final_canopies = self._random_canopy(self.canopies) uncovered_points = True while uncovered_points: uncovered_points = False valid_canopies = [] for x in self.canopies: nearest_dist = self.nn(x, final_canopies)[1] if nearest_dist > self.soft_dist: uncovered_points = True if nearest_dist > self.hard_dist: valid_canopies.append(x) if uncovered_points: canopy = self._random_canopy(valid_canopies) final_canopies = np.concatenate((final_canopies, canopy)) self.canopies = valid_canopies for canopy in final_canopies: yield random.random(), canopy.tostring() hadoopy.counter('canopy_cluster','run_time', int(time.time() - self.start_time))
def test_status(self): def err(x): self.assertEqual("reporter:status:[test]\n", x) hadoopy.status("[test]", err=err)
def test_status(self): def err(x): self.assertEqual('reporter:status:[test]\n', x) hadoopy.status('[test]', err=err)
def close(self): self.stop_time('total') hadoopy.status(json.dumps(self._times))
def setstatus(msg): print sys.stderr, "Status:", msg hadoopy.status(msg)
def setstatus(msg): print >>sys.stderr, "Status:", msg hadoopy.status(msg)