public Archive(RrdDb parentDb, ArcDef arcDef) { bool shouldInitialize = arcDef != null; this.parentDb = parentDb; consolFun = new RrdString(this, true); // constant, may be cached xff = new RrdDouble(this); steps = new RrdInt(this, true); // constant, may be cached rows = new RrdInt(this, true); // constant, may be cached if (shouldInitialize) { consolFun.set(arcDef.getConsolFun().Name); xff.set(arcDef.getXff()); steps.set(arcDef.getSteps()); rows.set(arcDef.getRows()); } int n = parentDb.getHeader().getDsCount(); states = new ArcState[n]; robins = new Robin[n]; for (int i = 0; i < n; i++) { states[i] = new ArcState(this, shouldInitialize); int numRows = rows.get(); robins[i] = new Robin(this, numRows, shouldInitialize); } }
public Robin(Archive parentArc, int rows, bool shouldInitialize) { this.parentArc = parentArc; this.pointer = new RrdInt(this); this.values = new RrdDoubleArray(this, rows); this.rows = rows; if (shouldInitialize) { pointer.set(0); values.set(0, Double.NaN, rows); } }
public Header(RrdDb parentDb, RrdDef rrdDef, String initSignature) { this.parentDb = parentDb; signature = new RrdString(this); // NOT constant, may be cached step = new RrdLong(this, true); // constant, may be cached dsCount = new RrdInt(this, true); // constant, may be cached arcCount = new RrdInt(this, true); // constant, may be cached lastUpdateTime = new RrdLong(this); if (rrdDef != null) { signature.set(initSignature); step.set(rrdDef.getStep()); dsCount.set(rrdDef.getDsCount()); arcCount.set(rrdDef.getArcCount()); lastUpdateTime.set(rrdDef.getStartTime()); } }