Examples of RrdException


Examples of org.jrobin.core.RrdException

  }

  Object execute() throws RrdException, IOException {
    String[] words = getRemainingWords();
    if (words.length != 2) {
      throw new RrdException("Invalid rrdlast syntax");
    }
    String path = words[1];
    RrdDb rrdDb = getRrdDbReference(path);
    try {
      long lastUpdateTime = rrdDb.getLastUpdateTime();
View Full Code Here

Examples of org.jrobin.core.RrdException

    long start = Util.getTimestamp(startStr);
    String stepStr = getOptionValue("s", "step", DEFAULT_STEP);
    long step = parseLong(stepStr);
    String[] words = getRemainingWords();
    if (words.length < 2) {
      throw new RrdException("RRD file path not specified");
    }
    String path = words[1];
    rrdDef = new RrdDef(path, start, step);
    for (int i = 2; i < words.length; i++) {
      if (words[i].startsWith("DS:")) {
        parseDef(words[i]);
      }
      else if (words[i].startsWith("RRA:")) {
        parseRra(words[i]);
      }
      else {
        throw new RrdException("Invalid rrdcreate syntax: " + words[i]);
      }
    }
    return createRrdDb();
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

  private void parseDef(String word) throws RrdException {
    // DEF:name:type:heratbeat:min:max
    String[] tokens = new ColonSplitter(word).split();
    if (tokens.length < 6) {
      throw new RrdException("Invalid DS definition: " + word);
    }
    String dsName = tokens[1];
    String dsType = tokens[2];
    long heartbeat = parseLong(tokens[3]);
    double min = parseDouble(tokens[4]);
View Full Code Here

Examples of org.jrobin.core.RrdException

  private void parseRra(String word) throws RrdException {
    // RRA:cfun:xff:steps:rows
    String[] tokens = new ColonSplitter(word).split();
    if (tokens.length < 5) {
      throw new RrdException("Invalid RRA definition: " + word);
    }
    String cf = tokens[1];
    double xff = parseDouble(tokens[2]);
    int steps = parseInt(tokens[3]);
    int rows = parseInt(tokens[4]);
View Full Code Here

Examples of org.jrobin.core.RrdException

  Object execute() throws RrdException, IOException, RrdException {
    boolean check = getBooleanOption("r", "range-check");
    String[] words = getRemainingWords();
    if (words.length != 3) {
      throw new RrdException("Invalid rrdrestore syntax");
    }
    String xmlPath = words[1];
    String rrdPath = words[2];
    RrdDb rrdDb = getRrdDbReference(rrdPath, xmlPath);
    try {
View Full Code Here

Examples of org.jrobin.core.RrdException

      }
      // ordinary character
      appendWord(c);
    }
    if (activeQuote != 0) {
      throw new RrdException("End of command reached but " + activeQuote + " expected");
    }
    finishWord();
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

          String value = iter.next();
          iter.remove();
          return value;
        }
        else {
          throw new RrdException("Value for option " + fullForm + " expected but not found");
        }
      }
      if (word.startsWith(fullForm)) {
        int pos = fullForm.length();
        if (word.charAt(pos) == '=') {
View Full Code Here

Examples of org.jrobin.core.RrdException

    long minStep = (long) Math.ceil((span[1] - span[0]) / (double) (maxRows - 1));
    step = Math.max(step, minStep);
    dproc.setStep(step);
    String[] words = getRemainingWords();
    if (words.length < 2) {
      throw new RrdException("Incomplete XPORT command");
    }
    for (int i = 1; i < words.length; i++) {
      if (words[i].startsWith("DEF:")) {
        parseDef(words[i]);
      }
      else if (words[i].startsWith("CDEF:")) {
        parseCDef(words[i]);
      }
      else if (words[i].startsWith("XPORT:")) {
        parseXport(words[i]);
      }
      else {
        throw new RrdException("Invalid XPORT syntax: " + words[i]);
      }
    }
    String result = xports.size() == 0 ? null : xport();
    println(xports.size() == 0 ? "No XPORT statement found, nothing done" : result);
    return result;
View Full Code Here

Examples of org.jrobin.core.RrdException

  private void parseDef(String word) throws RrdException {
    // DEF:vname=rrd:ds-name:CF
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length != 4) {
      throw new RrdException("Invalid DEF syntax: " + word);
    }
    String[] tokens2 = tokens1[1].split("=");
    if (tokens2.length != 2) {
      throw new RrdException("Invalid DEF syntax: " + word);
    }
    dproc.addDatasource(tokens2[0], tokens2[1], tokens1[2], tokens1[3]);
  }
View Full Code Here

Examples of org.jrobin.core.RrdException

  private void parseCDef(String word) throws RrdException {
    // CDEF:vname=rpn-expression
    String[] tokens1 = new ColonSplitter(word).split();
    if (tokens1.length != 2) {
      throw new RrdException("Invalid CDEF syntax: " + word);
    }
    String[] tokens2 = tokens1[1].split("=");
    if (tokens2.length != 2) {
      throw new RrdException("Invalid CDEF syntax: " + word);
    }
    dproc.addDatasource(tokens2[0], tokens2[1]);
  }
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.