Package org.apache.hadoop.mapred.StatisticsCollector

Examples of org.apache.hadoop.mapred.StatisticsCollector.Stat.inc()


    TimeWindow[] windows = {window};
    Stat stat1 = collector.createStat("TaskTracker A", windows);

    // TT A starts out with 0 buckets
    assertEquals(0, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(0, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
View Full Code Here


    // TT A starts out with 0 buckets
    assertEquals(0, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(0, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
View Full Code Here

    collector.update();
    assertEquals(0, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
    stat1.inc(2);
    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
View Full Code Here

    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
    stat1.inc(2);
    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
    stat1.inc(0);
    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
View Full Code Here

    collector.update();
    assertEquals(2, stat1.getValues().get(window).getValue());
    stat1.inc(2);
    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
    stat1.inc(0);
    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    // At the next update, we now have 3 buckets for TT 1
    collector.update();
View Full Code Here

    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
    stat1.inc(0);
    collector.update();
    assertEquals(2+3, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    // At the next update, we now have 3 buckets for TT 1
    collector.update();
    assertEquals(2+3+1, stat1.getValues().get(window).getValue());
    stat1.inc(4);
    collector.update();
View Full Code Here

    assertEquals(2+3, stat1.getValues().get(window).getValue());
    stat1.inc(1);
    // At the next update, we now have 3 buckets for TT 1
    collector.update();
    assertEquals(2+3+1, stat1.getValues().get(window).getValue());
    stat1.inc(4);
    collector.update();
    assertEquals(2+3+1, stat1.getValues().get(window).getValue());
    // At the next update, we're going to drop the earliest bucket for TT A and
    // keep a max of 3 buckets forever
    collector.update();
View Full Code Here

    // A new TaskTracker connects and gets a Stat allocated for it
    Stat stat2 = collector.createStat("TaskTracker B", windows);

    // TT B starts out with 0 buckets even though TT A already has 3
    assertEquals(0, stat2.getValues().get(window).getValue());
    stat2.inc(10);
    collector.update();
    assertEquals(3+1+4, stat1.getValues().get(window).getValue());
    assertEquals(0, stat2.getValues().get(window).getValue());
    stat1.inc(3);
    stat2.inc(2);
View Full Code Here

    stat2.inc(10);
    collector.update();
    assertEquals(3+1+4, stat1.getValues().get(window).getValue());
    assertEquals(0, stat2.getValues().get(window).getValue());
    stat1.inc(3);
    stat2.inc(2);
    // At the next update, we're going to drop the earliest bucket for TT A
    // but we shouldn't drop the earliest bucket for TT B because it only
    // has one bucket so far (which would result in a value of 0 instead of 12)
    collector.update();
    assertEquals(1+4+3, stat1.getValues().get(window).getValue());
View Full Code Here

    TimeWindow sincStart = StatisticsCollector.SINCE_START;
    TimeWindow[] windows = {sincStart, window};
   
    Stat stat = collector.createStat("m1", windows);
   
    stat.inc(3);
    collector.update();
    assertEquals(0, stat.getValues().get(window).getValue());
    assertEquals(3, stat.getValues().get(sincStart).getValue());
   
    stat.inc(3);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.