Package com.db4o.defragment

Examples of com.db4o.defragment.DefragmentConfig


    return 1;
  }

  @SuppressWarnings("unused")
  private void defragment(Configuration config) {
    DefragmentConfig defragConfig = new DefragmentConfig(getDBFilePath());
    defragConfig.db4oConfig(config);
    try {
      Defragment.defrag(defragConfig);
    } catch (IOException e) {
      throw new PersistenceException("Error creating database", e);
    }
View Full Code Here


    FileUtil.secureDelete(tmpFile);

    /* As opposed to the default, BTreeIDMapping uses an on-disk file instead of in-memory for mapping IDs.
    /* Reduces memory usage during defragmentation while being slower.
    /* However as of db4o 7.4.63.11890, it is bugged and prevents defragmentation from succeeding for my database, so we don't use it for now. */
    final DefragmentConfig config = new DefragmentConfig(databaseFile.getAbsolutePath(),
                                backupFile.getAbsolutePath()
                              //  ,new BTreeIDMapping(tmpFile.getAbsolutePath())
                              );
   
    /* Delete classes which are not known to the classloader anymore - We do NOT do this because:
    /* - It is buggy and causes exceptions often as of db4o 7.4.63.11890
    /* - Freetalk has always had proper database upgrade code (function upgradeDB()) and does not rely on automatic schema evolution.
    /*   If we need to get rid of certain objects we should do it in the database upgrade code, */
    // config.storedClassFilter(new AvailableClassFilter());
   
    config.db4oConfig(getNewDatabaseConfiguration());
   
    try {
      Defragment.defrag(config);
    } catch (Exception e) {
      Logger.error(this, "Defragment failed", e);
View Full Code Here

TOP

Related Classes of com.db4o.defragment.DefragmentConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.