/** * Returns the last stored value for the given datasource. * * @param dsName Datasource name * @return Last stored value for the given datasource * @throws java.io.IOException Thrown in case of I/O error * @throws java.lang.IllegalArgumentException Thrown if no datasource in this RrdDb matches the given datasource name */ public synchronized double getLastDatasourceValue(String dsName) throws IOException { int dsIndex = getDsIndex(dsName); return datasources[dsIndex].getLastValue(); }
/** * Returns the last stored value for the given datasource. * * @param dsName Datasource name * @return Last stored value for the given datasource * @throws IOException Thrown in case of I/O error * @throws IllegalArgumentException Thrown if no datasource in this RrdDb matches the given datasource name */ public synchronized double getLastDatasourceValue(String dsName) throws IOException { int dsIndex = getDsIndex(dsName); return datasources[dsIndex].getLastValue(); }
/** * Returns index of this Datasource object in the RRD. * * @return Datasource index in the RRD. * @throws java.io.IOException Thrown in case of I/O error */ public int getDsIndex() throws IOException { try { return parentDb.getDsIndex(dsName.get()); } catch (IllegalArgumentException e) { return -1; } }
/** * Returns Datasource object corresponding to the given datasource name. * * @param dsName Datasource name * @return Datasource object corresponding to the give datasource name or null if not found. * @throws java.io.IOException Thrown in case of I/O error */ public Datasource getDatasource(String dsName) throws IOException { try { return getDatasource(getDsIndex(dsName)); } catch (IllegalArgumentException e) { return null; } }
/** * Returns index of this Datasource object in the RRD. * * @return Datasource index in the RRD. * @throws IOException Thrown in case of I/O error */ public int getDsIndex() throws IOException { try { return parentDb.getDsIndex(dsName.get()); } catch (IllegalArgumentException e) { return -1; } }
/** * Returns Datasource object corresponding to the given datasource name. * * @param dsName Datasource name * @return Datasource object corresponding to the give datasource name or null * if not found. * @throws IOException Thrown in case of I/O error */ public Datasource getDatasource(String dsName) throws IOException { try { return getDatasource(getDsIndex(dsName)); } catch (IllegalArgumentException e) { return null; } }
static int getMatchingDatasourceIndex(RrdDb rrd1, int dsIndex, RrdDb rrd2) throws IOException { String dsName = rrd1.getDatasource(dsIndex).getName(); try { return rrd2.getDsIndex(dsName); } catch (IllegalArgumentException e) { return -1; } }
static int getMatchingDatasourceIndex(RrdDb rrd1, int dsIndex, RrdDb rrd2) throws IOException { String dsName = rrd1.getDatasource(dsIndex).getName(); try { return rrd2.getDsIndex(dsName); } catch (IllegalArgumentException e) { return -1; } }
final void archive(Datasource datasource, double value, long numUpdates) throws IOException { int dsIndex = getDsIndex(datasource.getName()); for (Archive archive : archives) { archive.archive(dsIndex, value, numUpdates); } }
final void archive(Datasource datasource, double value, double lastValue, long numUpdates) throws IOException { int dsIndex = getDsIndex(datasource.getName()); for (Archive archive : archives) { if (ConsolFun.AVERAGE.equals(archive.getConsolFun())) { archive.archive(dsIndex, value, numUpdates); } else { archive.archive(dsIndex, lastValue, numUpdates); } } }
public void setDsType(DsType newDsType) throws IOException { // set datasource type this.dsType.set(newDsType.name()); // reset datasource status lastValue.set(Double.NaN); accumValue.set(0.0); // reset archive status int dsIndex = parentDb.getDsIndex(dsName.get()); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getArcState(dsIndex).setAccumValue(Double.NaN); } }
/** * <p>Setter for the field <code>dsType</code>.</p> * * @param newDsType a {@link org.rrd4j.DsType} object. * @throws java.io.IOException if any. */ public void setDsType(DsType newDsType) throws IOException { // set datasource type dsType.set(newDsType); // reset datasource status lastValue.set(Double.NaN); accumValue.set(0.0); // reset archive status int dsIndex = parentDb.getDsIndex(dsName.get()); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getArcState(dsIndex).setAccumValue(Double.NaN); } }
robinValues = new double[dsCount][]; for (int i = 0; i < dsCount; i++) { int dsIndex = parentDb.getDsIndex(dsToFetch[i]); robinValues[i] = robins[dsIndex].getValues(matchStartIndex, matchCount);
robinValues = new double[dsCount][]; for (int i = 0; i < dsCount; i++) { int dsIndex = parentDb.getDsIndex(dsToFetch[i]); robinValues[i] = robins[dsIndex].getValues(matchStartIndex, matchCount);
String dsName = srcDs.getName(); try { int j = rrdDest.getDsIndex(dsName); if(j >= 0 && !badDs.contains(dsName)) { log(Level.TRACE, "Upgrade of %s from %s", dsName, srcArchive);