/** * Modifies existing RRD file, by resizing its chosen archive. The archive to be resized * is identified by its consolidation function and the number of steps. * * @param sourcePath Path to the RRD file (will be modified) * @param consolFun Consolidation function of the archive to be resized * @param numSteps Number of steps of the archive to be resized * @param newRows New archive size (number of archive rows) * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws IOException Thrown in case of I/O error */ public static void resizeArchive(String sourcePath, ConsolFun consolFun, int numSteps, int newRows, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); resizeArchive(sourcePath, destPath, consolFun, numSteps, newRows); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Adds one more archive to a RRD file.</p> * <p>WARNING: This method is potentialy dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to add datasource to. * @param newArchive Archive definition to be added to the RRD file * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws IOException Thrown in case of I/O error */ public static void addArchive(String sourcePath, ArcDef newArchive, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); addArchive(sourcePath, destPath, newArchive); copyFile(destPath, sourcePath, saveBackup); }
/** * Modifies existing RRD file, by resizing its chosen archive. The archive to be resized * is identified by its consolidation function and the number of steps. * * @param sourcePath Path to the RRD file (will be modified) * @param consolFun Consolidation function of the archive to be resized * @param numSteps Number of steps of the archive to be resized * @param newRows New archive size (number of archive rows) * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws java.io.IOException Thrown in case of I/O error */ public static void resizeArchive(String sourcePath, ConsolFun consolFun, int numSteps, int newRows, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); resizeArchive(sourcePath, destPath, consolFun, numSteps, newRows); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Adds datasources to a RRD file.</p> * <p>WARNING: This method is potentially dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to add datasource to. * @param newDatasources Datasource definitions to be added to the RRD file * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws java.io.IOException Thrown in case of I/O error */ public static void addDatasources(String sourcePath, Iterable<DsDef> newDatasources, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); addDatasources(sourcePath, destPath, newDatasources); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Removes single datasource from a RRD file.</p> * <p>WARNING: This method is potentially dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to remove datasource from. * @param dsName Name of the Datasource to be removed from the RRD file * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws java.io.IOException Thrown in case of I/O error */ public static void removeDatasource(String sourcePath, String dsName, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); removeDatasource(sourcePath, destPath, dsName); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Removes single datasource from a RRD file.</p> * <p>WARNING: This method is potentialy dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to remove datasource from. * @param dsName Name of the Datasource to be removed from the RRD file * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws IOException Thrown in case of I/O error */ public static void removeDatasource(String sourcePath, String dsName, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); removeDatasource(sourcePath, destPath, dsName); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Adds one more archive to a RRD file.</p> * <p>WARNING: This method is potentially dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to add datasource to. * @param newArchive Archive definition to be added to the RRD file * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws java.io.IOException Thrown in case of I/O error */ public static void addArchive(String sourcePath, ArcDef newArchive, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); addArchive(sourcePath, destPath, newArchive); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Adds datasources to a RRD file.</p> * <p>WARNING: This method is potentially dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to add datasource to. * @param newDatasources Datasource definitions to be added to the RRD file * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws IOException Thrown in case of I/O error */ public static void addDatasources(String sourcePath, Iterable<DsDef> newDatasources, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); addDatasources(sourcePath, destPath, newDatasources); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Removes one archive from a RRD file.</p> * <p>WARNING: This method is potentially dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to add datasource to. * @param consolFun Consolidation function of Archive which should be removed * @param steps Number of steps for Archive which should be removed * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws java.io.IOException Thrown in case of I/O error */ public static void removeArchive(String sourcePath, ConsolFun consolFun, int steps, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); removeArchive(sourcePath, destPath, consolFun, steps); copyFile(destPath, sourcePath, saveBackup); }
/** * <p>Removes one archive from a RRD file.</p> * <p>WARNING: This method is potentialy dangerous! It will modify your RRD file. * It is highly recommended to preserve the original RRD file (<i>saveBackup</i> * should be set to <code>true</code>). The backup file will be created in the same * directory as the original one with <code>.bak</code> extension added to the * original name.</p> * <p>Before applying this method, be sure that the specified RRD file is not in use * (not open)</p> * * @param sourcePath path to a RRD file to add datasource to. * @param consolFun Consolidation function of Archive which should be removed * @param steps Number of steps for Archive which should be removed * @param saveBackup true, if backup of the original file should be created; * false, otherwise * @throws IOException Thrown in case of I/O error */ public static void removeArchive(String sourcePath, ConsolFun consolFun, int steps, boolean saveBackup) throws IOException { String destPath = Util.getTmpFilename(); removeArchive(sourcePath, destPath, consolFun, steps); copyFile(destPath, sourcePath, saveBackup); }