/** * Copies object's internal state to another RrdDb object. * * @param other New RrdDb object to copy state to * @throws IOException Thrown in case of I/O error */ public synchronized void copyStateTo(RrdUpdater other) throws IOException { if (!(other instanceof RrdDb)) { throw new IllegalArgumentException("Cannot copy RrdDb object to " + other.getClass().getName()); } RrdDb otherRrd = (RrdDb) other; header.copyStateTo(otherRrd.header); for (int i = 0; i < datasources.length; i++) { int j = Util.getMatchingDatasourceIndex(this, i, otherRrd); if (j >= 0) { datasources[i].copyStateTo(otherRrd.datasources[j]); } } for (int i = 0; i < archives.length; i++) { int j = Util.getMatchingArchiveIndex(this, i, otherRrd); if (j >= 0) { archives[i].copyStateTo(otherRrd.archives[j]); } } }
/** * {@inheritDoc} * <p> * Copies object's internal state to another RrdDb object. */ public synchronized void copyStateTo(RrdDb otherRrd) throws IOException { header.copyStateTo(otherRrd.header); for (int i = 0; i < datasources.length; i++) { int j = Util.getMatchingDatasourceIndex(this, i, otherRrd); if (j >= 0) { datasources[i].copyStateTo(otherRrd.datasources[j]); } } for (int i = 0; i < archives.length; i++) { int j = Util.getMatchingArchiveIndex(this, i, otherRrd); if (j >= 0) { archives[i].copyStateTo(otherRrd.archives[j]); } } }
int dsCount = header.getDsCount(); header.copyStateTo(rrdDest.getHeader()); for(int i = 0; i < dsCount; i++) { Datasource srcDs = rrdSource.getDatasource(i);