Java 类org.apache.hadoop.mapred.StatisticsCollector.Stat.TimeStat 实例源码

项目:hadoop    文件:StatisticsCollector.java   
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;
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
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;
}
项目:big-c    文件:StatisticsCollector.java   
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;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StatisticsCollector.java   
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;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StatisticsCollector.java   
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;
}
项目:hadoop-EAR    文件:StatisticsCollector.java   
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;
}
项目:hadoop-plus    文件:StatisticsCollector.java   
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;
}
项目:FlexMap    文件:StatisticsCollector.java   
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;
}
项目:hops    文件:StatisticsCollector.java   
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;
}
项目:hadoop-TCP    文件:StatisticsCollector.java   
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;
}
项目:hadoop-on-lustre    文件:StatisticsCollector.java   
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;
}
项目:hardfs    文件:StatisticsCollector.java   
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;
}
项目:hadoop-on-lustre2    文件:StatisticsCollector.java   
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;
}
项目:RDFS    文件:StatisticsCollector.java   
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;
}
项目:hanoi-hadoop-2.0.0-cdh    文件:StatisticsCollector.java   
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;
}
项目:mapreduce-fork    文件:StatisticsCollector.java   
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;
}
项目:hortonworks-extension    文件:StatisticsCollector.java   
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;
}
项目:hortonworks-extension    文件:StatisticsCollector.java   
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;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StatisticsCollector.java   
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.updates++;
    if (stat.updates == updatesPerBucket) {
      stat.addBucket();
      stat.updates = 0;
    }
    if (stat.buckets.size() > collectBuckets) {
      stat.removeBucket();
    }
  }
}
项目:hanoi-hadoop-2.0.0-cdh    文件:StatisticsCollector.java   
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.updates++;
    if (stat.updates == updatesPerBucket) {
      stat.addBucket();
      stat.updates = 0;
    }
    if (stat.buckets.size() > collectBuckets) {
      stat.removeBucket();
    }
  }
}
项目:hadoop    文件:StatisticsCollector.java   
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}
项目:hadoop    文件:StatisticsCollector.java   
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}
项目:hadoop    文件:StatisticsCollector.java   
public synchronized Map<TimeWindow, TimeStat> getValues() {
  return Collections.unmodifiableMap(timeStats);
}
项目:hadoop    文件:StatisticsCollector.java   
synchronized void addTimeStat(String name, TimeStat s) {
  statToCollect.put(name, s);
}
项目:hadoop    文件:StatisticsCollector.java   
synchronized TimeStat removeTimeStat(String name) {
  return statToCollect.remove(name);
}
项目:hadoop    文件:StatisticsCollector.java   
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.setValueToCurrent();
  }
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
public synchronized Map<TimeWindow, TimeStat> getValues() {
  return Collections.unmodifiableMap(timeStats);
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
synchronized void addTimeStat(String name, TimeStat s) {
  statToCollect.put(name, s);
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
synchronized TimeStat removeTimeStat(String name) {
  return statToCollect.remove(name);
}
项目:aliyun-oss-hadoop-fs    文件:StatisticsCollector.java   
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.setValueToCurrent();
  }
}
项目:big-c    文件:StatisticsCollector.java   
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}
项目:big-c    文件:StatisticsCollector.java   
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}
项目:big-c    文件:StatisticsCollector.java   
public synchronized Map<TimeWindow, TimeStat> getValues() {
  return Collections.unmodifiableMap(timeStats);
}
项目:big-c    文件:StatisticsCollector.java   
synchronized void addTimeStat(String name, TimeStat s) {
  statToCollect.put(name, s);
}
项目:big-c    文件:StatisticsCollector.java   
synchronized TimeStat removeTimeStat(String name) {
  return statToCollect.remove(name);
}
项目:big-c    文件:StatisticsCollector.java   
synchronized void update() {
  for (TimeStat stat : statToCollect.values()) {
    stat.setValueToCurrent();
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StatisticsCollector.java   
private Stat(String name, Map<TimeWindow, TimeStat> timeStats) {
  this.name = name;
  this.timeStats = timeStats;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StatisticsCollector.java   
public synchronized void inc(int incr) {
  for (TimeStat ts : timeStats.values()) {
    ts.inc(incr);
  }
}