@JsonIgnore ArcDef getDef() { Objects.requireNonNull(consolFun, "The consolFun property is required"); Objects.requireNonNull(xff, "The xff property is required"); Objects.requireNonNull(steps, "The steps property is required"); Objects.requireNonNull(rows, "The rows property is required"); return new ArcDef(consolFun, xff, steps, rows); } }
/** * Adds single archive definition by specifying its consolidation function, X-files factor, * number of steps and rows. For the complete explanation of all archive * definition parameters see RRDTool's * <a href="../../../../man/rrdcreate.html" target="man">rrdcreate man page</a>.</p> * * @param consolFun Consolidation function. * @param xff X-files factor. Valid values are between 0 and 1. * @param steps Number of archive steps * @param rows Number of archive rows * @throws IllegalArgumentException Thrown if archive with the same consolidation function * and the same number of steps is already added. */ public void addArchive(ConsolFun consolFun, double xff, int steps, int rows) { addArchive(new ArcDef(consolFun, xff, steps, rows)); }
/** * Adds single archive definition by specifying its consolidation function, X-files factor, * number of steps and rows. For the complete explanation of all archive * definition parameters see RRDTool's * <a href="../../../../man/rrdcreate.html" target="man">rrdcreate man page</a>. * * @param consolFun Consolidation function. * @param xff X-files factor. Valid values are between 0 and 1. * @param steps Number of archive steps * @param rows Number of archive rows * @throws java.lang.IllegalArgumentException Thrown if archive with the same consolidation function * and the same number of steps is already added. */ public void addArchive(ConsolFun consolFun, double xff, int steps, int rows) { addArchive(new ArcDef(consolFun, xff, steps, rows)); }
throw illArgException; addArchive(new ArcDef(consolFun, xff, steps, rows));
throw illArgException; addArchive(new ArcDef(consolFun, xff, steps, rows));
return new ArcDef(consolFun, xff, steps, rows);
private ArcDef getArchDef(JrdsElement archiveElement) { String cfName = archiveElement.getElementbyName("consolFun").getTextContent(); ConsolFun consolFun = null; if(cfName != null && !"".equals(cfName.trim())) { consolFun = ConsolFun.valueOf(cfName.trim().toUpperCase()); } double xff = Util.parseStringNumber(archiveElement.getElementbyName("xff").getTextContent(), Double.NaN); int steps = Util.parseStringNumber(archiveElement.getElementbyName("steps").getTextContent(), 0); int rows = Util.parseStringNumber(archiveElement.getElementbyName("rows").getTextContent(), 0); return new ArcDef(consolFun, xff, steps, rows); }
Archive(RrdDb parentDb, DataImporter reader, int arcIndex) throws IOException { this(parentDb, new ArcDef( reader.getConsolFun(arcIndex), reader.getXff(arcIndex), reader.getSteps(arcIndex), reader.getRows(arcIndex))); int n = parentDb.getHeader().getDsCount(); for (int i = 0; i < n; i++) { // restore state states[i].setAccumValue(reader.getStateAccumValue(arcIndex, i)); states[i].setNanSteps(reader.getStateNanSteps(arcIndex, i)); // restore robins double[] values = reader.getValues(arcIndex, i); robins[i].update(values); } }
Archive(RrdDb parentDb, DataImporter reader, int arcIndex) throws IOException { this(parentDb, new ArcDef( reader.getConsolFun(arcIndex), reader.getXff(arcIndex), reader.getSteps(arcIndex), reader.getRows(arcIndex))); int n = parentDb.getHeader().getDsCount(); for (int i = 0; i < n; i++) { // restore state states[i].setAccumValue(reader.getStateAccumValue(arcIndex, i)); states[i].setNanSteps(reader.getStateNanSteps(arcIndex, i)); // restore robins double[] values = reader.getValues(arcIndex, i); robins[i].update(values); } }
ArcDef arcDef = new ArcDef(archive.getConsolFun(), archive.getXff(), archive.getSteps(), archive.getRows()); rrdDef.addArchive(arcDef);
ArcDef arcDef = new ArcDef(archive.getConsolFun(), archive.getXff(), archive.getSteps(), archive.getRows()); rrdDef.addArchive(arcDef);