Class FileBasedSettings


  • public class FileBasedSettings
    extends Settings
    The Settings implementation backed with the file. The keys values are case-sensitive.
    • Constructor Detail

      • FileBasedSettings

        public FileBasedSettings​(File stream)
    • Method Detail

      • getStream

        public File getStream()
      • flush

        public void flush​(boolean metadata)
                   throws IOException
        Flushes file data to stable storage.
        When metadata is true, both file data and metadata (e.g., file size) are forced to disk. When false, only file data is flushed.
        Parameters:
        metadata - whether file metadata should also be flushed
        Throws:
        IOException - if the flush operation fails
      • setLong

        public void setLong​(String key,
                            long value,
                            boolean flush)
                     throws IOException
        Description copied from class: Settings
        Sets the value corresponding to the given key.
        Overrides:
        setLong in class Settings
        Parameters:
        key - key
        value - value
        flush - whether to save to persistent storage immediately
        Throws:
        IOException - if value storing failed