Package com.alibaba.jstorm.container.cgroup

Examples of com.alibaba.jstorm.container.cgroup.Device


    List<String> strings = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_WEIGHT_DEVICE));
    Map<Device, Integer> result = new HashMap<Device, Integer>();
    for (String string : strings) {
      String[] strArgs = string.split(" ");
      Device device = new Device(strArgs[0]);
      Integer weight = Integer.valueOf(strArgs[1]);
      result.put(device, weight);
    }
    return result;
  }
View Full Code Here


    List<String> strings = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_THROTTLE_READ_BPS_DEVICE));
    Map<Device, Long> result = new HashMap<Device, Long>();
    for (String string : strings) {
      String[] strArgs = string.split(" ");
      Device device = new Device(strArgs[0]);
      Long bps = Long.valueOf(strArgs[1]);
      result.put(device, bps);
    }
    return result;
  }
View Full Code Here

    List<String> strings = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_THROTTLE_WRITE_BPS_DEVICE));
    Map<Device, Long> result = new HashMap<Device, Long>();
    for (String string : strings) {
      String[] strArgs = string.split(" ");
      Device device = new Device(strArgs[0]);
      Long bps = Long.valueOf(strArgs[1]);
      result.put(device, bps);
    }
    return result;
  }
View Full Code Here

    List<String> strings = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_THROTTLE_READ_IOPS_DEVICE));
    Map<Device, Long> result = new HashMap<Device, Long>();
    for (String string : strings) {
      String[] strArgs = string.split(" ");
      Device device = new Device(strArgs[0]);
      Long iops = Long.valueOf(strArgs[1]);
      result.put(device, iops);
    }
    return result;
  }
View Full Code Here

    List<String> strings = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_THROTTLE_WRITE_IOPS_DEVICE));
    Map<Device, Long> result = new HashMap<Device, Long>();
    for (String string : strings) {
      String[] strArgs = string.split(" ");
      Device device = new Device(strArgs[0]);
      Long iops = Long.valueOf(strArgs[1]);
      result.put(device, iops);
    }
    return result;
  }
View Full Code Here

    Map<Device, Long> result = new HashMap<Device, Long>();
    List<String> strs = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_TIME));
    for (String str : strs) {
      String[] strArgs = str.split(" ");
      result.put(new Device(strArgs[0]), Long.parseLong(strArgs[1]));
    }
    return result;
  }
View Full Code Here

    Map<Device, Long> result = new HashMap<Device, Long>();
    List<String> strs = CgroupUtils.readFileByLine(Constants.getDir(
        this.dir, BLKIO_SECTORS));
    for (String str : strs) {
      String[] strArgs = str.split(" ");
      result.put(new Device(strArgs[0]), Long.parseLong(strArgs[1]));
    }
    return result;
  }
View Full Code Here

    Map<Device, Map<RecordType, Long>> result = new HashMap<Device, Map<RecordType, Long>>();
    for (String str : strs) {
      String[] strArgs = str.split(" ");
      if (strArgs.length != 3)
        continue;
      Device device = new Device(strArgs[0]);
      RecordType key = RecordType.getType(strArgs[1]);
      Long value = Long.parseLong(strArgs[2]);
      Map<RecordType, Long> record = result.get(device);
      if (record == null) {
        record = new HashMap<RecordType, Long>();
View Full Code Here

    String output = CgroupUtils.readFileByLine(
        Constants.getDir(this.dir, NET_CLS_CLASSID)).get(0);
    output = Integer.toHexString(Integer.parseInt(output));
    int major = Integer.parseInt(output.substring(0, output.length() - 4));
    int minor = Integer.parseInt(output.substring(output.length() - 4));
    return new Device(major, minor);
  }
View Full Code Here

      }
      String[] splits = output.split("[: ]");
      type = splits[0].charAt(0);
      int major = Integer.parseInt(splits[1]);
      int minor = Integer.parseInt(splits[2]);
      device = new Device(major, minor);
      accesses = 0;
      for (char c : splits[3].toCharArray()) {
        if (c == ACCESS_READ_CH) {
          accesses |= ACCESS_READ;
        }
View Full Code Here

TOP

Related Classes of com.alibaba.jstorm.container.cgroup.Device

Copyright © 2018 www.massapicom. 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.