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); }
/** * <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); }
/** * <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); }
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); }
public void bulkStore(double newValue, int bulkCount) throws IOException { assert bulkCount <= rows: "Invalid number of bulk updates: " + bulkCount + " rows=" + rows; int position = pointer.get(); // update tail int tailUpdateCount = Math.min(rows - position, bulkCount); values.set(position, newValue, tailUpdateCount); pointer.set((position + tailUpdateCount) % rows); // do we need to update from the start? int headUpdateCount = bulkCount - tailUpdateCount; if (headUpdateCount > 0) { values.set(0, newValue, headUpdateCount); pointer.set(headUpdateCount); } }
public void bulkStore(double newValue, int bulkCount) throws IOException { assert bulkCount <= rows: "Invalid number of bulk updates: " + bulkCount + " rows=" + rows; int position = pointer.get(); // update tail int tailUpdateCount = Math.min(rows - position, bulkCount); values.set(column, position, newValue, tailUpdateCount); pointer.set((position + tailUpdateCount) % rows); // do we need to update from the start? int headUpdateCount = bulkCount - tailUpdateCount; if (headUpdateCount > 0) { values.set(column, 0, newValue, headUpdateCount); pointer.set(headUpdateCount); } }
/** {@inheritDoc} */ public void bulkStore(double newValue, int bulkCount) throws IOException { assert bulkCount <= rows: "Invalid number of bulk updates: " + bulkCount + " rows=" + rows; int position = pointer.get(); // update tail int tailUpdateCount = Math.min(rows - position, bulkCount); values.set(position, newValue, tailUpdateCount); pointer.set((position + tailUpdateCount) % rows); // do we need to update from the start? int headUpdateCount = bulkCount - tailUpdateCount; if (headUpdateCount > 0) { values.set(0, newValue, headUpdateCount); pointer.set(headUpdateCount); } }
/** {@inheritDoc} */ public void bulkStore(double newValue, int bulkCount) throws IOException { assert bulkCount <= rows: "Invalid number of bulk updates: " + bulkCount + " rows=" + rows; int position = pointer.get(); // update tail int tailUpdateCount = Math.min(rows - position, bulkCount); values.set(column, position, newValue, tailUpdateCount); pointer.set((position + tailUpdateCount) % rows); // do we need to update from the start? int headUpdateCount = bulkCount - tailUpdateCount; if (headUpdateCount > 0) { values.set(column, 0, newValue, headUpdateCount); pointer.set(headUpdateCount); } }
/** {@inheritDoc} */ public void store(double newValue) throws IOException { int position = pointer.get(); values.set(position, newValue); pointer.set((position + 1) % rows); }
public void store(double newValue) throws IOException { int position = pointer.get(); values.set(column, position, newValue); pointer.set((position + 1) % rows); }
public void store(double newValue) throws IOException { int position = pointer.get(); values.set(position, newValue); pointer.set((position + 1) % rows); }
/** {@inheritDoc} */ public void store(double newValue) throws IOException { int position = pointer.get(); values.set(column, position, newValue); pointer.set((position + 1) % rows); }
RobinArray(Archive parentArc, int rows, boolean shouldInitialize) throws IOException { 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); } }
Header(RrdDb parentDb, DataImporter reader) throws IOException { this(parentDb, (RrdDef) null); String version = reader.getVersion(); if (!RRDTOOL_VERSION.equals(version)) { throw new IllegalArgumentException("Could not unserialize xml version " + version); } signature.set(DEFAULT_SIGNATURE); step.set(reader.getStep()); dsCount.set(reader.getDsCount()); arcCount.set(reader.getArcCount()); lastUpdateTime.set(reader.getLastUpdateTime()); }
RobinArray(Archive parentArc, int rows, boolean shouldInitialize) throws IOException { 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); } }
Header(RrdDb parentDb, DataImporter reader) throws IOException { this(parentDb, (RrdDef) null); String importVersion = reader.getVersion(); switch(importVersion) { case RRDTOOL_VERSION1: version = 1; break; case RRDTOOL_VERSION3: version = 2; break; default: throw new IllegalArgumentException("Could not get version " + version); } signature.set(SIGNATURE + ", " + VERSIONS[version - 1]); step.set(reader.getStep()); dsCount.set(reader.getDsCount()); arcCount.set(reader.getArcCount()); lastUpdateTime.set(reader.getLastUpdateTime()); }
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()); } }
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()); } }