Class MemoryStore

  • All Implemented Interfaces:
    Store

    public class MemoryStore
    extends Object
    implements Store
    An in-memory storage backend for the tree store.
    • Constructor Detail

      • MemoryStore

        public MemoryStore()
      • MemoryStore

        public MemoryStore​(Properties config)
    • Method Detail

      • setWriteCompression

        public void setWriteCompression​(Compression compression)
        Description copied from interface: Store
        Set the compression algorithm used for writing from now on.
        Specified by:
        setWriteCompression in interface Store
        Parameters:
        compression - the compression algorithm
      • getIfExists

        public PageFile getIfExists​(String key)
        Description copied from interface: Store
        Get a file if it exists
        Specified by:
        getIfExists in interface Store
        Parameters:
        key - the file name
        Returns:
        the file, or null
      • put

        public void put​(String key,
                        PageFile file)
        Description copied from interface: Store
        Storage a file.
        Specified by:
        put in interface Store
        Parameters:
        key - the file name
        file - the file
      • newFileName

        public String newFileName()
        Description copied from interface: Store
        Generate a new file name.
        Specified by:
        newFileName in interface Store
        Returns:
      • keySet

        public Set<String> keySet()
        Description copied from interface: Store
        Get the list of files.
        Specified by:
        keySet in interface Store
        Returns:
        the result
      • remove

        public void remove​(Set<String> set)
        Description copied from interface: Store
        Remove a number of files.
        Specified by:
        remove in interface Store
        Parameters:
        set - the result
      • removeAll

        public void removeAll()
        Description copied from interface: Store
        Remove all files.
        Specified by:
        removeAll in interface Store
      • getWriteCount

        public long getWriteCount()
        Description copied from interface: Store
        Get the number of files written.
        Specified by:
        getWriteCount in interface Store
        Returns:
        the result
      • getReadCount

        public long getReadCount()
        Description copied from interface: Store
        Get the number of files read.
        Specified by:
        getReadCount in interface Store
        Returns:
        the result
      • close

        public void close()
        Description copied from interface: Store
        Close the store
        Specified by:
        close in interface Store
      • getMaxFileSizeBytes

        public long getMaxFileSizeBytes()
        Description copied from interface: Store
        Get the maximum file size configured.
        Specified by:
        getMaxFileSizeBytes in interface Store
        Returns:
        the file size, in bytes