/** Adds a new phase. Caller needs to set progress weightage */ private synchronized Progress addNewPhase() { Progress phase = new Progress(); phases.add(phase); phase.setParent(this); return phase; }
/** Adds a node with a specified progress weightage to the tree. */ public synchronized Progress addPhase(float weightage) { Progress phase = new Progress(); progressWeightagesForPhases.add(weightage); phases.add(phase); phase.setParent(this); // Ensure that the sum of weightages does not cross 1.0 float sum = 0; for (int i = 0; i < phases.size(); i++) { sum += progressWeightagesForPhases.get(i); } if (sum > 1.0) { LOG.warn("Sum of weightages can not be more than 1.0; But sum = " + sum); } return phase; }
public Progress getProgress() { return new Progress(); }
public Progress getProgress() { // TODO return new Progress(); }
doReturn(mof).when(mockTask).getMapOutputFile(); doReturn(attemptId).when(mockTask).getTaskID(); doReturn(new Progress()).when(mockTask).getSortPhase(); TaskReporter mockReporter = mock(TaskReporter.class); doReturn(new Counter()).when(mockReporter).getCounter(
/** Adds a node to the tree. */ public synchronized Progress addPhase() { Progress phase = new Progress(); phases.add(phase); phase.parent = this; progressPerPhase = 1.0f / (float)phases.size(); return phase; }
/** Adds a node to the tree. */ public synchronized Progress addPhase() { Progress phase = new Progress(); phases.add(phase); phase.parent = this; progressPerPhase = 1.0f / (float)phases.size(); return phase; }
Progress progress = new Progress(); ShuffleSchedulerImpl<K, V> scheduler = new ShuffleSchedulerImpl<K, V>(job, status, null, null, progress, context.getShuffledMapsCounter(),
Progress progress = new Progress(); ShuffleSchedulerImpl<K, V> scheduler = new ShuffleSchedulerImpl<K, V>(job, status, null, null, progress, context.getShuffledMapsCounter(),
/** Adds a new phase. Caller needs to set progress weightage */ private synchronized Progress addNewPhase() { Progress phase = new Progress(); phases.add(phase); phase.setParent(this); return phase; }
/** Adds a new phase. Caller needs to set progress weightage */ private synchronized Progress addNewPhase() { Progress phase = new Progress(); phases.add(phase); phase.setParent(this); return phase; }
/** Adds a new phase. Caller needs to set progress weightage */ private synchronized Progress addNewPhase() { Progress phase = new Progress(); phases.add(phase); phase.setParent(this); return phase; }
/** Adds a new phase. Caller needs to set progress weightage */ private synchronized Progress addNewPhase() { Progress phase = new Progress(); phases.add(phase); phase.setParent(this); return phase; }
/** Adds a node with a specified progress weightage to the tree. */ public synchronized Progress addPhase(float weightage) { Progress phase = new Progress(); progressWeightagesForPhases.add(weightage); phases.add(phase); phase.setParent(this); // Ensure that the sum of weightages does not cross 1.0 float sum = 0; for (int i = 0; i < phases.size(); i++) { sum += progressWeightagesForPhases.get(i); } if (sum > 1.0) { LOG.warn("Sum of weightages can not be more than 1.0; But sum = " + sum); } return phase; }
Progress progress = new Progress();
Progress progress = new Progress(); ShuffleSchedulerImpl<K, V> scheduler = new ShuffleSchedulerImpl<K, V>(job, status, null, null, progress, context.getShuffledMapsCounter(),
Counter readsCounter = new Counter(); Counter writesCounter = new Counter(); Progress mergePhase = new Progress(); RawKeyValueIterator mergeQueue = Merger.merge(conf, fs, keyClass, valueClass, segments, 2, tmpDir, comparator, getReporter(),
@Test public void testSet(){ Progress progress = new Progress(); progress.set(Float.NaN); Assert.assertEquals(0, progress.getProgress(), 0.0); progress.set(Float.NEGATIVE_INFINITY); Assert.assertEquals(0,progress.getProgress(),0.0); progress.set(-1); Assert.assertEquals(0,progress.getProgress(),0.0); progress.set((float) 1.1); Assert.assertEquals(1,progress.getProgress(),0.0); progress.set(Float.POSITIVE_INFINITY); Assert.assertEquals(1,progress.getProgress(),0.0); } }
@Test public void testSet(){ Progress progress = new Progress(); progress.set(Float.NaN); Assert.assertEquals(0, progress.getProgress(), 0.0); progress.set(Float.NEGATIVE_INFINITY); Assert.assertEquals(0,progress.getProgress(),0.0); progress.set(-1); Assert.assertEquals(0,progress.getProgress(),0.0); progress.set((float) 1.1); Assert.assertEquals(1,progress.getProgress(),0.0); progress.set(Float.POSITIVE_INFINITY); Assert.assertEquals(1,progress.getProgress(),0.0); } }