org.apache.hadoop.mapred.StatisticsCollector.Stat.TimeStat Java Examples

The following examples show how to use org.apache.hadoop.mapred.StatisticsCollector.Stat.TimeStat. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 6 votes vote down vote up
synchronized Stat createStat(String name, TimeWindow[] windows) {
  if (statistics.get(name) != null) {
    throw new RuntimeException("Stat with name "+ name + 
        " is already defined");
  }
  Map<TimeWindow, TimeStat> timeStats = 
    new LinkedHashMap<TimeWindow, TimeStat>();
  for (TimeWindow window : windows) {
    StatUpdater collector = updaters.get(window);
    if (collector == null) {
      if(SINCE_START.equals(window)) {
        collector = new StatUpdater();
      } else {
        collector = new TimeWindowStatUpdater(window, period);
      }
      updaters.put(window, collector);
    }
    TimeStat timeStat = new TimeStat();
    collector.addTimeStat(name, timeStat);
    timeStats.put(window, timeStat);
  }

  Stat stat = new Stat(name, timeStats);
  statistics.put(name, stat);
  return stat;
}
 
Example #2
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 6 votes vote down vote up
synchronized Stat createStat(String name, TimeWindow[] windows) {
  if (statistics.get(name) != null) {
    throw new RuntimeException("Stat with name "+ name + 
        " is already defined");
  }
  Map<TimeWindow, TimeStat> timeStats = 
    new LinkedHashMap<TimeWindow, TimeStat>();
  for (TimeWindow window : windows) {
    StatUpdater collector = updaters.get(window);
    if (collector == null) {
      if(SINCE_START.equals(window)) {
        collector = new StatUpdater();
      } else {
        collector = new TimeWindowStatUpdater(window, period);
      }
      updaters.put(window, collector);
    }
    TimeStat timeStat = new TimeStat();
    collector.addTimeStat(name, timeStat);
    timeStats.put(window, timeStat);
  }

  Stat stat = new Stat(name, timeStats);
  statistics.put(name, stat);
  return stat;
}
 
Example #3
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 6 votes vote down vote up
synchronized Stat createStat(String name, TimeWindow[] windows) {
  if (statistics.get(name) != null) {
    throw new RuntimeException("Stat with name "+ name + 
        " is already defined");
  }
  Map<TimeWindow, TimeStat> timeStats = 
    new LinkedHashMap<TimeWindow, TimeStat>();
  for (TimeWindow window : windows) {
    StatUpdater collector = updaters.get(window);
    if (collector == null) {
      if(SINCE_START.equals(window)) {
        collector = new StatUpdater();
      } else {
        collector = new TimeWindowStatUpdater(window, period);
      }
      updaters.put(window, collector);
    }
    TimeStat timeStat = new TimeStat();
    collector.addTimeStat(name, timeStat);
    timeStats.put(window, timeStat);
  }

  Stat stat = new Stat(name, timeStats);
  statistics.put(name, stat);
  return stat;
}
 
Example #4
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 4 votes vote down vote up
public synchronized Map<TimeWindow, TimeStat> getValues() {
  return Collections.unmodifiableMap(timeStats);
}
 
Example #5
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.setValueToCurrent();
  }
}
 
Example #6
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
synchronized TimeStat removeTimeStat(String name) {
  return statToCollect.remove(name);
}
 
Example #7
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
synchronized void addTimeStat(String name, TimeStat s) {
  statToCollect.put(name, s);
}
 
Example #8
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public synchronized Map<TimeWindow, TimeStat> getValues() {
  return Collections.unmodifiableMap(timeStats);
}
 
Example #9
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}
 
Example #10
Source File: StatisticsCollector.java    From RDFS with Apache License 2.0 4 votes vote down vote up
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}
 
Example #11
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 4 votes vote down vote up
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.setValueToCurrent();
  }
}
 
Example #12
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 4 votes vote down vote up
synchronized TimeStat removeTimeStat(String name) {
  return statToCollect.remove(name);
}
 
Example #13
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 4 votes vote down vote up
synchronized void addTimeStat(String name, TimeStat s) {
  statToCollect.put(name, s);
}
 
Example #14
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 4 votes vote down vote up
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}
 
Example #15
Source File: StatisticsCollector.java    From big-c with Apache License 2.0 4 votes vote down vote up
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}
 
Example #16
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 4 votes vote down vote up
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.setValueToCurrent();
  }
}
 
Example #17
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 4 votes vote down vote up
synchronized TimeStat removeTimeStat(String name) {
  return statToCollect.remove(name);
}
 
Example #18
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 4 votes vote down vote up
synchronized void addTimeStat(String name, TimeStat s) {
  statToCollect.put(name, s);
}
 
Example #19
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public synchronized Map<TimeWindow, TimeStat> getValues() {
  return Collections.unmodifiableMap(timeStats);
}
 
Example #20
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}
 
Example #21
Source File: StatisticsCollector.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}