Class FileDataStore

  • All Implemented Interfaces:
    DataStore

    public class FileDataStore
    extends Object
    implements DataStore
    DataStore backed by single filesystem file.
    • Method Detail

      • deleteRecord

        public void deleteRecord​(int id)
                          throws IOException
        Description copied from interface: DataStore
        Delete record identified by given ID. DataStore will mark given ID as unused, and could reuse this ID later for another newly created record.
        Specified by:
        deleteRecord in interface DataStore
        Throws:
        IOException
      • getDefragmentationStartAddress

        public long getDefragmentationStartAddress​(int allowedFragmentationPercent,
                                                   List<eu.svjatoslav.sixth.data.store.file.EntryRecord> allEntryRecords)
      • initializeFromExistingFile

        public void initializeFromExistingFile​(File backingFile)
                                        throws IOException
        Throws:
        IOException
      • relocateEntry

        public long relocateEntry​(eu.svjatoslav.sixth.data.store.file.EntryRecord record,
                                  long newLocation)
                           throws IOException
        Throws:
        IOException
      • vacuum

        public void vacuum​(int allowedFragmentationPercent)
                    throws IOException
        Defragment empty space.
        Parameters:
        allowedFragmentationPercent - allowed maximum percentage of free space, relative to total used space.
        Throws:
        IOException