Java 类org.apache.hadoop.mapred.gridmix.Progressive 实例源码

项目:hadoop    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:aliyun-oss-hadoop-fs    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:big-c    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hadoop-plus    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hops    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hadoop-TCP    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hardfs    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hadoop-on-lustre2    文件:CumulativeCpuUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.monitor = monitor;
  this.progress = progress;

  // get the target CPU usage
  targetCpuUsage = metrics.getCumulativeCpuUsage();
  if (targetCpuUsage <= 0 ) {
    enabled = false;
    return;
  } else {
    enabled = true;
  }

  emulationInterval =  conf.getFloat(CPU_EMULATION_PROGRESS_INTERVAL, 
                                     DEFAULT_EMULATION_FREQUENCY);

  // calibrate the core cpu-usage utility
  emulatorCore.calibrate(monitor, targetCpuUsage);

  // initialize the states
  lastSeenProgress = 0;
  lastSeenCpuUsage = 0;
}
项目:hadoop    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hadoop    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:aliyun-oss-hadoop-fs    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:big-c    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:big-c    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hadoop-plus    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hadoop-plus    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hops    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hops    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hadoop-TCP    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hadoop-TCP    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hardfs    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hardfs    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hadoop-on-lustre2    文件:TotalHeapUsageEmulatorPlugin.java   
@Override
public void initialize(Configuration conf, ResourceUsageMetrics metrics,
                       ResourceCalculatorPlugin monitor,
                       Progressive progress) {
  this.progress = progress;

  // get the target heap usage
  targetHeapUsageInMB = metrics.getHeapUsage() / ONE_MB;
  if (targetHeapUsageInMB <= 0 ) {
    enabled = false;
    return;
  } else {
    // calibrate the core heap-usage utility
    emulatorCore.initialize(monitor, targetHeapUsageInMB);
    enabled = true;
  }

  emulationInterval = 
    conf.getFloat(HEAP_EMULATION_PROGRESS_INTERVAL, 
                  DEFAULT_EMULATION_PROGRESS_INTERVAL);

  minFreeHeapRatio = conf.getFloat(MIN_HEAP_FREE_RATIO, 
                                   DEFAULT_MIN_FREE_HEAP_RATIO);

  heapLoadRatio = conf.getFloat(HEAP_LOAD_RATIO, DEFAULT_HEAP_LOAD_RATIO);

  prevEmulationProgress = 0;
}
项目:hadoop-on-lustre2    文件:ResourceUsageMatcher.java   
/**
 * Configure the {@link ResourceUsageMatcher} to load the configured plugins
 * and initialize them.
 */
@SuppressWarnings("unchecked")
public void configure(Configuration conf, ResourceCalculatorPlugin monitor, 
                      ResourceUsageMetrics metrics, Progressive progress) {
  Class[] plugins = conf.getClasses(RESOURCE_USAGE_EMULATION_PLUGINS);
  if (plugins == null) {
    System.out.println("No resource usage emulator plugins configured.");
  } else {
    for (Class clazz : plugins) {
      if (clazz != null) {
        if (ResourceUsageEmulatorPlugin.class.isAssignableFrom(clazz)) {
          ResourceUsageEmulatorPlugin plugin = 
            (ResourceUsageEmulatorPlugin) ReflectionUtils.newInstance(clazz, 
                                                                      conf);
          emulationPlugins.add(plugin);
        } else {
          throw new RuntimeException("Misconfigured resource usage plugins. " 
              + "Class " + clazz.getClass().getName() + " is not a resource "
              + "usage plugin as it does not extend "
              + ResourceUsageEmulatorPlugin.class.getName());
        }
      }
    }
  }

  // initialize the emulators once all the configured emulator plugins are
  // loaded
  for (ResourceUsageEmulatorPlugin emulator : emulationPlugins) {
    emulator.initialize(conf, metrics, monitor, progress);
  }
}
项目:hadoop    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:aliyun-oss-hadoop-fs    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:big-c    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:hadoop-2.6.0-cdh5.4.3    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:hadoop-plus    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:hops    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:hadoop-TCP    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:hardfs    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);
项目:hadoop-on-lustre2    文件:ResourceUsageEmulatorPlugin.java   
/**
 * Initialize the plugin. This might involve
 *   - initializing the variables
 *   - calibrating the plugin
 */
void initialize(Configuration conf, ResourceUsageMetrics metrics, 
                ResourceCalculatorPlugin monitor,
                Progressive progress);