test_class.file: code/src/test/java/com/googlecode/cqengine/persistence/disk/DiskPersistenceTest.java
test_class.identifier: DiskPersistenceTest
test_case.body: @Test
      public void testCompact() {
          DiskPersistence<Car, Integer> persistence = DiskPersistence.onPrimaryKey(Car.CAR_ID);
          @SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
          IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>(persistence);
          cars.addAll(CarFactory.createCollectionOfCars(100));
          long bytesUsedWhenFullyPopulated = persistence.getBytesUsed();
          Assert.assertTrue("Bytes used when fully populated should be greater than zero: " + bytesUsedWhenFullyPopulated, bytesUsedWhenFullyPopulated > 0);
          cars.removeAll(CarFactory.createCollectionOfCars(100));
          long bytesUsedWhenObjectsRemoved = persistence.getBytesUsed();
          Assert.assertTrue("Bytes used when objects removed (" + bytesUsedWhenObjectsRemoved + ") should remain the same as when fully populated (" + bytesUsedWhenFullyPopulated + ")", bytesUsedWhenObjectsRemoved == bytesUsedWhenFullyPopulated);
          persistence.compact(); // Truncates size of the database, but not to zero as the tables which were created remain (although empty)
          long bytesUsedAfterCompaction = persistence.getBytesUsed();
          Assert.assertTrue("Bytes used after compaction (" + bytesUsedAfterCompaction + ") should be less than when fully populated (" + bytesUsedWhenFullyPopulated + ")", bytesUsedAfterCompaction < bytesUsedWhenFullyPopulated);
          Assert.assertTrue("Failed to delete temp file:" + persistence.getFile(), persistence.getFile().delete());
      }
test_case.class_method_signature: DiskPersistenceTest.testCompact()
test_case.full_signature: @Test public void testCompact()
test_case.identifier: testCompact
test_case.invocations: onPrimaryKey addAll createCollectionOfCars getBytesUsed assertTrue removeAll createCollectionOfCars getBytesUsed assertTrue compact getBytesUsed assertTrue assertTrue getFile delete getFile
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCompact()
focal_class.declarator: primaryKeyAttribute
focal_class.modifier: final
focal_class.original_string: final SimpleAttribute<O, A> primaryKeyAttribute;
focal_class.type: SimpleAttribute<O, A>
focal_class.var_name: primaryKeyAttribute
focal_class.declarator: file
focal_class.modifier: final
focal_class.original_string: final File file;
focal_class.type: File
focal_class.var_name: file
focal_class.declarator: sqLiteDataSource
focal_class.modifier: final
focal_class.original_string: final SQLiteDataSource sqLiteDataSource;
focal_class.type: SQLiteDataSource
focal_class.var_name: sqLiteDataSource
focal_class.declarator: useReadWriteLock
focal_class.modifier: final
focal_class.original_string: final boolean useReadWriteLock;
focal_class.type: boolean
focal_class.var_name: useReadWriteLock
focal_class.declarator: readWriteLock = new ReentrantReadWriteLock(true)
focal_class.modifier: final
focal_class.original_string: final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(true);
focal_class.type: ReadWriteLock
focal_class.var_name: readWriteLock
focal_class.declarator: DEFAULT_PROPERTIES = new Properties()
focal_class.modifier: static final
focal_class.original_string: static final Properties DEFAULT_PROPERTIES = new Properties();
focal_class.type: Properties
focal_class.var_name: DEFAULT_PROPERTIES
focal_class.declarator: persistentConnection
focal_class.modifier: volatile
focal_class.original_string: volatile Connection persistentConnection;
focal_class.type: Connection
focal_class.var_name: persistentConnection
focal_class.declarator: closed = false
focal_class.modifier: volatile
focal_class.original_string: volatile boolean closed = false;
focal_class.type: boolean
focal_class.var_name: closed
focal_class.file: code/src/main/java/com/googlecode/cqengine/persistence/disk/DiskPersistence.java
focal_class.identifier: DiskPersistence
focal_class.interfaces: implements SQLitePersistence<O, A>, Closeable
focal_class.class_method_signature: DiskPersistence.DiskPersistence(SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.full_signature: protected  DiskPersistence(SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.identifier: DiskPersistence
focal_class.modifiers: protected
focal_class.parameters: (SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.signature:  DiskPersistence(SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.class_method_signature: DiskPersistence.getPrimaryKeyAttribute()
focal_class.full_signature: @Override public SimpleAttribute<O, A> getPrimaryKeyAttribute()
focal_class.identifier: getPrimaryKeyAttribute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SimpleAttribute<O, A>
focal_class.signature: SimpleAttribute<O, A> getPrimaryKeyAttribute()
focal_class.class_method_signature: DiskPersistence.getFile()
focal_class.full_signature: public File getFile()
focal_class.identifier: getFile
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File getFile()
focal_class.class_method_signature: DiskPersistence.getConnection(Index<?> index, QueryOptions queryOptions)
focal_class.full_signature: @Override public Connection getConnection(Index<?> index, QueryOptions queryOptions)
focal_class.identifier: getConnection
focal_class.modifiers: @Override public
focal_class.parameters: (Index<?> index, QueryOptions queryOptions)
focal_class.return: Connection
focal_class.signature: Connection getConnection(Index<?> index, QueryOptions queryOptions)
focal_class.class_method_signature: DiskPersistence.getConnectionWithRWLock(Index<?> index, QueryOptions queryOptions)
focal_class.full_signature: protected Connection getConnectionWithRWLock(Index<?> index, QueryOptions queryOptions)
focal_class.identifier: getConnectionWithRWLock
focal_class.modifiers: protected
focal_class.parameters: (Index<?> index, QueryOptions queryOptions)
focal_class.return: Connection
focal_class.signature: Connection getConnectionWithRWLock(Index<?> index, QueryOptions queryOptions)
focal_class.class_method_signature: DiskPersistence.getConnectionWithoutRWLock(Index<?> index, QueryOptions queryOptions)
focal_class.full_signature: protected Connection getConnectionWithoutRWLock(Index<?> index, QueryOptions queryOptions)
focal_class.identifier: getConnectionWithoutRWLock
focal_class.modifiers: protected
focal_class.parameters: (Index<?> index, QueryOptions queryOptions)
focal_class.return: Connection
focal_class.signature: Connection getConnectionWithoutRWLock(Index<?> index, QueryOptions queryOptions)
focal_class.class_method_signature: DiskPersistence.supportsIndex(Index<O> index)
focal_class.full_signature: @Override public boolean supportsIndex(Index<O> index)
focal_class.identifier: supportsIndex
focal_class.modifiers: @Override public
focal_class.parameters: (Index<O> index)
focal_class.return: boolean
focal_class.signature: boolean supportsIndex(Index<O> index)
focal_class.class_method_signature: DiskPersistence.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: DiskPersistence.finalize()
focal_class.full_signature: @Override protected void finalize()
focal_class.identifier: finalize
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void finalize()
focal_class.class_method_signature: DiskPersistence.getBytesUsed()
focal_class.full_signature: @Override public long getBytesUsed()
focal_class.identifier: getBytesUsed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getBytesUsed()
focal_class.class_method_signature: DiskPersistence.compact()
focal_class.full_signature: @Override public void compact()
focal_class.identifier: compact
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void compact()
focal_class.class_method_signature: DiskPersistence.expand(long numBytes)
focal_class.full_signature: @Override public void expand(long numBytes)
focal_class.identifier: expand
focal_class.modifiers: @Override public
focal_class.parameters: (long numBytes)
focal_class.return: void
focal_class.signature: void expand(long numBytes)
focal_class.class_method_signature: DiskPersistence.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: DiskPersistence.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: DiskPersistence.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: DiskPersistence.createObjectStore()
focal_class.full_signature: @Override public ObjectStore<O> createObjectStore()
focal_class.identifier: createObjectStore
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ObjectStore<O>
focal_class.signature: ObjectStore<O> createObjectStore()
focal_class.class_method_signature: DiskPersistence.createIdentityIndex()
focal_class.full_signature: @Override public SQLiteDiskIdentityIndex<A, O> createIdentityIndex()
focal_class.identifier: createIdentityIndex
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: SQLiteDiskIdentityIndex<A, O>
focal_class.signature: SQLiteDiskIdentityIndex<A, O> createIdentityIndex()
focal_class.class_method_signature: DiskPersistence.openRequestScopeResources(QueryOptions queryOptions)
focal_class.full_signature: @Override public void openRequestScopeResources(QueryOptions queryOptions)
focal_class.identifier: openRequestScopeResources
focal_class.modifiers: @Override public
focal_class.parameters: (QueryOptions queryOptions)
focal_class.return: void
focal_class.signature: void openRequestScopeResources(QueryOptions queryOptions)
focal_class.class_method_signature: DiskPersistence.closeRequestScopeResources(QueryOptions queryOptions)
focal_class.full_signature: @Override public void closeRequestScopeResources(QueryOptions queryOptions)
focal_class.identifier: closeRequestScopeResources
focal_class.modifiers: @Override public
focal_class.parameters: (QueryOptions queryOptions)
focal_class.return: void
focal_class.signature: void closeRequestScopeResources(QueryOptions queryOptions)
focal_class.class_method_signature: DiskPersistence.createTempFile()
focal_class.full_signature: public static File createTempFile()
focal_class.identifier: createTempFile
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File createTempFile()
focal_class.class_method_signature: DiskPersistence.onPrimaryKey(SimpleAttribute<O, A> primaryKeyAttribute)
focal_class.full_signature: public static DiskPersistence<O, A> onPrimaryKey(SimpleAttribute<O, A> primaryKeyAttribute)
focal_class.identifier: onPrimaryKey
focal_class.modifiers: public static
focal_class.parameters: (SimpleAttribute<O, A> primaryKeyAttribute)
focal_class.return: DiskPersistence<O, A>
focal_class.signature: DiskPersistence<O, A> onPrimaryKey(SimpleAttribute<O, A> primaryKeyAttribute)
focal_class.class_method_signature: DiskPersistence.onPrimaryKeyInFile(SimpleAttribute<O, A> primaryKeyAttribute, File file)
focal_class.full_signature: public static DiskPersistence<O, A> onPrimaryKeyInFile(SimpleAttribute<O, A> primaryKeyAttribute, File file)
focal_class.identifier: onPrimaryKeyInFile
focal_class.modifiers: public static
focal_class.parameters: (SimpleAttribute<O, A> primaryKeyAttribute, File file)
focal_class.return: DiskPersistence<O, A>
focal_class.signature: DiskPersistence<O, A> onPrimaryKeyInFile(SimpleAttribute<O, A> primaryKeyAttribute, File file)
focal_class.class_method_signature: DiskPersistence.onPrimaryKeyInFileWithProperties(SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.full_signature: public static DiskPersistence<O, A> onPrimaryKeyInFileWithProperties(SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.identifier: onPrimaryKeyInFileWithProperties
focal_class.modifiers: public static
focal_class.parameters: (SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_class.return: DiskPersistence<O, A>
focal_class.signature: DiskPersistence<O, A> onPrimaryKeyInFileWithProperties(SimpleAttribute<O, A> primaryKeyAttribute, File file, Properties overrideProperties)
focal_method.body: @Override
      public void compact() {
          Connection connection = null;
          try {
              connection = getConnection(null, noQueryOptions());
              DBQueries.compactDatabase(connection);
          }
          finally {
              DBUtils.closeQuietly(connection);
          }
      }
focal_method.class_method_signature: DiskPersistence.compact()
focal_method.full_signature: @Override public void compact()
focal_method.identifier: compact
focal_method.invocations: getConnection noQueryOptions compactDatabase closeQuietly
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void compact()