Tabnine Logo
FileStorage.sync
Code IndexAdd Tabnine to your IDE (free)

How to use
sync
method
in
org.lealone.storage.fs.FileStorage

Best Java code snippets using org.lealone.storage.fs.FileStorage.sync (Showing top 2 results out of 315)

origin: lealone/Lealone

c.fileStorage.sync();
origin: lealone/Lealone

synchronized void save() {
  LinkedTransferQueue<RedoLogRecord> oldQueue = getAndResetRedoLogRecords();
  if (!oldQueue.isEmpty()) {
    try (DataBuffer buff = DataBuffer.create()) {
      for (RedoLogRecord r : oldQueue) {
        if (r.isCheckpoint()) {
          deleteOldChunkFiles();
          fileStorage.truncate(0);
          buff.reset();
          pos = 0;
        }
        r.write(buff);
      }
      int chunkLength = buff.position();
      if (chunkLength > 0) {
        buff.limit(chunkLength);
        buff.position(0);
        fileStorage.writeFully(pos, buff.getBuffer());
        pos += chunkLength;
        fileStorage.sync();
      }
      for (RedoLogRecord r : oldQueue) {
        r.setSynced(true);
      }
    }
  }
}
org.lealone.storage.fsFileStoragesync

Javadoc

Flush all changes.

Popular methods of FileStorage

  • open
    Open an encrypted file store with the given settings.
  • <init>
    Create a new file using the given settings.
  • closeSilently
    Close the file without throwing any exceptions. Exceptions are simply ignored.
  • readFully
    Read a number of bytes.
  • close
    Close this file.
  • init
    Initialize the file. This method will write or check the file header if required.
  • setCheckedWriting
  • autoDelete
    Automatically delete the file once it is no longer in use.
  • getFilePointer
    Get the current location of the file pointer.
  • seek
    Go to the specified file location.
  • write
    Write a number of bytes.
  • writeFully
    Write to the file.
  • write,
  • writeFully,
  • addNewFile,
  • checkPowerOff,
  • checkWritingAllowed,
  • closeAndDeleteSilently,
  • closeFile,
  • closeFileSilently,
  • delete

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now