/** * Returns the number of archive steps. * * @return Number of archive steps. * @throws java.io.IOException Thrown in case of I/O error. */ public int getSteps() throws IOException { return steps.get(); }
void set(int value) throws IOException { if (!isCachingAllowed()) { writeInt(value); } // caching allowed else if (!cached || cache != value) { // update cache writeInt(cache = value); cached = true; } }
int get() throws IOException { if (!isCachingAllowed()) { return readInt(); } else { if (!cached) { cache = readInt(); cached = true; } return cache; } } }
consolFun = new RrdEnum<>(this, false, ConsolFun.class); // Don't cache, as the enum type should be used instead xff = new RrdDouble<>(this); steps = new RrdInt<>(this, true); // constant, may be cached rows = new RrdInt<>(this, true); // constant, may be cached boolean shouldInitialize = arcDef != null; if (shouldInitialize) { consolFun.set(arcDef.getConsolFun()); xff.set(arcDef.getXff()); steps.set(arcDef.getSteps()); rows.set(arcDef.getRows()); int numRows = rows.get(); states = new ArcState[n]; int version = parentDb.getHeader().getVersion(); robins = new RobinMatrix[n]; for (int i = 0; i < n; i++) { pointers[i] = new RrdInt<>(this); pointers[i].set(0);
public void update(double[] newValues) throws IOException { assert rows == newValues.length: "Invalid number of robin values supplied (" + newValues.length + "), exactly " + rows + " needed"; pointer.set(0); values.writeDouble(0, newValues); }
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 boolean shouldInitialize = arcDef != null; if (shouldInitialize) { consolFun.set(arcDef.getConsolFun().name()); xff.set(arcDef.getXff()); steps.set(arcDef.getSteps()); rows.set(arcDef.getRows()); int numRows = rows.get(); states = new ArcState[n]; int version = parentDb.getHeader().getVersion(); robins = new RobinMatrix[n]; for (int i = 0; i < n; i++) { pointers[i] = new RrdInt(this); states[i] = new ArcState(this, shouldInitialize);
int get() throws IOException { if (!isCachingAllowed()) { return readInt(); } else { if (!cached) { cache = readInt(); cached = true; } return cache; } } }
/** * <p>update.</p> * * @param newValues an array of double. * @throws java.io.IOException if any. */ public void update(double[] newValues) throws IOException { assert rows == newValues.length: "Invalid number of robin values supplied (" + newValues.length + "), exactly " + rows + " needed"; pointer.set(0); values.writeDouble(0, newValues); }
/** * Returns the number of archive rows. * * @return Number of archive rows. * @throws java.io.IOException Thrown in case of I/O error. */ public int getRows() throws IOException { return rows.get(); }
void set(int value) throws IOException { if (!isCachingAllowed()) { writeInt(value); } // caching allowed else if (!cached || cache != value) { // update cache writeInt(cache = value); cached = true; } }
/** * <p>update.</p> * * @param newValues an array of double. * @throws java.io.IOException if any. */ public void update(double[] newValues) throws IOException { assert rows == newValues.length: "Invalid number of robin values supplied (" + newValues.length + "), exactly " + rows + " needed"; pointer.set(0); values.set(column, 0, newValues); }
/** * Returns the number of archive rows. * * @return Number of archive rows. * @throws IOException Thrown in case of I/O error. */ public int getRows() throws IOException { return rows.get(); }
Header(RrdDb parentDb, RrdDef rrdDef) throws IOException { this.parentDb = parentDb; String initSignature = null; if(rrdDef != null) { version = rrdDef.getVersion(); initSignature = SIGNATURE + ", " + VERSIONS[version - 1]; } else { initSignature = DEFAULT_SIGNATURE; } 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()); } }
public void update(double[] newValues) throws IOException { assert rows == newValues.length: "Invalid number of robin values supplied (" + newValues.length + "), exactly " + rows + " needed"; pointer.set(0); values.set(column, 0, newValues); }