Package org.jrobin.core

Examples of org.jrobin.core.RrdException


  }

  private void tuneHeartbeat(RrdDb rrd, String heartbeatStr) throws RrdException, IOException {
    String[] tokens = new ColonSplitter(heartbeatStr).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid suntax in: " + heartbeatStr);
    }
    String dsName = tokens[0];
    long heartbeat = Long.parseLong(tokens[1]);
    Datasource ds = rrd.getDatasource(dsName);
    ds.setHeartbeat(heartbeat);
View Full Code Here


  }

  private void tuneMinimum(RrdDb rrd, String minimumStr) throws RrdException, IOException {
    String[] tokens = new ColonSplitter(minimumStr).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid suntax in: " + minimumStr);
    }
    String dsName = tokens[0];
    double minValue = Util.parseDouble(tokens[1]);
    Datasource ds = rrd.getDatasource(dsName);
    ds.setMinValue(minValue, false);
View Full Code Here

  }

  private void tuneMaximum(RrdDb rrd, String maximumStr) throws RrdException, IOException {
    String[] tokens = new ColonSplitter(maximumStr).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid suntax in: " + maximumStr);
    }
    String dsName = tokens[0];
    double maxValue = Util.parseDouble(tokens[1]);
    Datasource ds = rrd.getDatasource(dsName);
    ds.setMaxValue(maxValue, false);
View Full Code Here

  }

  private void tuneName(RrdDb rrd, String nameStr) throws RrdException, IOException {
    String[] tokens = new ColonSplitter(nameStr).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid suntax in: " + nameStr);
    }
    String oldName = tokens[0], newName = tokens[1];
    Datasource ds = rrd.getDatasource(oldName);
    ds.setDsName(newName);
  }
View Full Code Here

  }

  private void tuneType(RrdDb rrd, String typeStr) throws RrdException, IOException {
    String[] tokens = new ColonSplitter(typeStr).split();
    if (tokens.length != 2) {
      throw new RrdException("Invalid suntax in: " + typeStr);
    }
    String dsName = tokens[0];
    String dsType = tokens[1];
    Datasource ds = rrd.getDatasource(dsName);
    ds.setDsType(dsType);
View Full Code Here

    private double[] stack = new double[MAX_STACK_SIZE];
    private int pos = 0;

    void push(final double x) throws RrdException {
      if (pos >= MAX_STACK_SIZE) {
        throw new RrdException("PUSH failed, RPN stack full [" + MAX_STACK_SIZE + "]");
      }
      stack[pos++] = x;
    }
View Full Code Here

      stack[pos++] = x;
    }

    double pop() throws RrdException {
      if (pos <= 0) {
        throw new RrdException("POP failed, RPN stack is empty ");
      }
      return stack[--pos];
    }
View Full Code Here

      return stack[--pos];
    }

    double peek() throws RrdException {
      if (pos <= 0) {
        throw new RrdException("PEEK failed, RPN stack is empty ");
      }
      return stack[pos - 1];
    }
View Full Code Here

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

  private void initDataLayout(File file) throws IOException, RrdException {

    if (file.exists()) {  // Load the data formats from the file
      int bytes = ras.read(buffer, 0, 24);
      if (bytes < 24) {
        throw new RrdException("Invalid RRD file");
      }

      int index;

      if ((index = indexOf(FLOAT_COOKIE_BIG_ENDIAN, buffer)) != -1) {
        bigEndian = true;
      }
      else if ((index = indexOf(FLOAT_COOKIE_LITTLE_ENDIAN, buffer))
          != -1) {
        bigEndian = false;
      }
      else {
        throw new RrdException("Invalid RRD file");
      }

      switch (index) {

        case 12:
View Full Code Here

TOP

Related Classes of org.jrobin.core.RrdException

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.