Examples of RrdException


Examples of org.jrobin.core.RrdException

      if (x[i] >= x[i + 1] || Double.isNaN(y[i])) {
        ok = false;
      }
    }
    if (!ok) {
      throw new RrdException("Invalid plottable data supplied");
    }
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

  }

  private RrdDbPool() throws RrdException {
    RrdBackendFactory factory = RrdBackendFactory.getDefaultFactory();
    if (!(factory instanceof RrdFileBackendFactory)) {
      throw new RrdException("Cannot create instance of " + getClass().getName() + " with " +
          "a default backend factory not derived from RrdFileBackendFactory");
    }
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

    while (!rrdMap.containsKey(canonicalPath) && rrdMap.size() >= capacity) {
      try {
        wait();
      }
      catch (InterruptedException e) {
        throw new RrdException(e);
      }
    }
    if (rrdMap.containsKey(canonicalPath)) {
      // already open, just increase usage count
      RrdEntry entry = rrdMap.get(canonicalPath);
View Full Code Here

Examples of org.jrobin.core.RrdException

    while (rrdMap.containsKey(canonicalPath) || rrdMap.size() >= capacity) {
      try {
        wait();
      }
      catch (InterruptedException e) {
        throw new RrdException(e);
      }
    }
    RrdDb rrdDb = new RrdDb(rrdDef);
    rrdMap.put(canonicalPath, new RrdEntry(rrdDb));
    return rrdDb;
View Full Code Here

Examples of org.jrobin.core.RrdException

    while (rrdMap.containsKey(canonicalPath) || rrdMap.size() >= capacity) {
      try {
        wait();
      }
      catch (InterruptedException e) {
        throw new RrdException(e);
      }
    }
    RrdDb rrdDb = new RrdDb(canonicalPath, sourcePath);
    rrdMap.put(canonicalPath, new RrdEntry(rrdDb));
    return rrdDb;
View Full Code Here

Examples of org.jrobin.core.RrdException

    if (rrdDb == null) {
      return;
    }
    String canonicalPath = Util.getCanonicalPath(rrdDb.getPath());
    if (!rrdMap.containsKey(canonicalPath)) {
      throw new RrdException("Could not release [" + canonicalPath + "], the file was never requested");
    }
    RrdEntry entry = rrdMap.get(canonicalPath);
    if (--entry.count <= 0) {
      // no longer used
      rrdMap.remove(canonicalPath);
View Full Code Here

Examples of org.jrobin.core.RrdException

    }
    else if (consolFun.equals(CF_TOTAL)) {
      return total;
    }
    else {
      throw new RrdException("Unknown consolidation function: " + consolFun);
    }
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

            break;
          case TKN_RND:
            push(Math.floor(pop() * Math.random()));
            break;
          default:
            throw new RrdException("Unexpected RPN token encountered, token.id=" + token.id);
        }
      }
      calculatedValues[slot] = pop();
      // check if stack is empty only on the first try
      if (slot == 0 && !isStackEmpty()) {
        throw new RrdException("Stack not empty at the end of calculation. " +
            "Probably bad RPN expression [" + rpnExpression + "]");
      }
    }
    return calculatedValues;
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

  Object execute() throws RrdException, IOException {
    String template = getOptionValue("t", "template");
    String[] dsNames = (template != null) ? new ColonSplitter(template).split() : null;
    String[] words = getRemainingWords();
    if (words.length < 3) {
      throw new RrdException("Insufficent number of parameters for rrdupdate command");
    }
    String path = words[1];
    RrdDb rrdDb = getRrdDbReference(path);
    try {
      if (dsNames != null) {
        // template specified, check datasource names
        for (String dsName : dsNames) {
          if (!rrdDb.containsDs(dsName)) {
            throw new RrdException("Invalid datasource name: " + dsName);
          }
        }
      }
      // parse update strings
      long timestamp = -1;
      for (int i = 2; i < words.length; i++) {
        String[] tokens = new ColonSplitter(words[i]).split();
        if (dsNames != null && dsNames.length + 1 != tokens.length) {
          throw new RrdException("Template requires " + dsNames.length + " values, " +
              (tokens.length - 1) + " value(s) found in: " + words[i]);
        }
        int dsCount = rrdDb.getHeader().getDsCount();
        if (dsNames == null && dsCount + 1 != tokens.length) {
          throw new RrdException("Expected " + dsCount + " values, " +
              (tokens.length - 1) + " value(s) found in: " + words[i]);
        }
        timestamp = Util.getTimestamp(tokens[0]);
        Sample sample = rrdDb.createSample(timestamp);
        for (int j = 1; j < tokens.length; j++) {
View Full Code Here

Examples of org.jrobin.core.RrdException

    for (RrdToolCmd rrdCommand : rrdCommands) {
      if (cmd.startsWith(rrdCommand.getCmdType() + " ")) {
        return rrdCommand.executeCommand(cmd);
      }
    }
    throw new RrdException("Unknown RRDTool command: " + command);
  }
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.