Class SystemInfoFileImpl

  • All Implemented Interfaces:
    SystemInfo

    public class SystemInfoFileImpl
    extends java.lang.Object
    implements SystemInfo
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int freespaceEntryCount()
      returns the number of entries in the Freespace Manager.
      long freespaceSize()
      returns the freespace size in the database in bytes.
      long totalSize()
      Returns the total size of the database on disk.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • freespaceEntryCount

        public int freespaceEntryCount()
        Description copied from interface: SystemInfo
        returns the number of entries in the Freespace Manager.

        A high value for the number of freespace entries is an indication that the database is fragmented and that defragment should be run.
        Specified by:
        freespaceEntryCount in interface SystemInfo
        Returns:
        the number of entries in the Freespace Manager.
      • freespaceSize

        public long freespaceSize()
        Description copied from interface: SystemInfo
        returns the freespace size in the database in bytes.

        When db4o stores modified objects, it allocates a new slot for it. During commit the old slot is freed. Free slots are collected in the freespace manager, so they can be reused for other objects.

        This method returns a sum of the size of all free slots in the database file.

        To reclaim freespace run defragment.
        Specified by:
        freespaceSize in interface SystemInfo
        Returns:
        the freespace size in the database in bytes.
      • totalSize

        public long totalSize()
        Description copied from interface: SystemInfo
        Returns the total size of the database on disk.
        Specified by:
        totalSize in interface SystemInfo
        Returns:
        total size of database on disk