core/src/main/java/com/orientechnologies/orient/core/storage/cache/local/twoq/O2QCache.java
@Override
  public final void closeStorage(final OWriteCache writeCache) throws IOException {
    if (writeCache == null) {
      return;
    }

    cacheLock.acquireWriteLock();
    try {
      final long[] filesToClear = writeCache.close();
      clearFiles(writeCache, filesToClear);
    } finally {
      cacheLock.releaseWriteLock();
    }
  }
@Override
  public final void closeStorage(final OWriteCache writeCache) throws IOException {
    if (writeCache == null) {
      return;
    }

    cacheLock.acquireWriteLock();
    try {
      final long[] filesToClear = writeCache.close();
      clearFiles(writeCache, filesToClear);
    } finally {
      cacheLock.releaseWriteLock();
    }
  }
@ Override public final void closeStorage ( final OWriteCache writeCache ) throws IOException { if ( writeCache == null ) { return ; } cacheLock . acquireWriteLock ( ) ; try { final long [ ] filesToClear = writeCache . close ( ) ; clearFiles ( writeCache , filesToClear ) ; } finally { cacheLock . releaseWriteLock ( ) ; } }
Performs following steps:
<ol>
<li>If flag {@link OGlobalConfiguration#STORAGE_KEEP_DISK_CACHE_STATE} is set to <code>true</code> saves state of all queues of
2Q cache into file {@link #CACHE_STATE_FILE}.The only exception is pinned pages they need to pinned again.</li>
<li>Closes all files and flushes all data associated to them.</li>
</ol>

@param writeCache Write cache all files of which should be closed. In terms of cache write cache = storage.
Performs following steps : <ol > <li > If flag { @link OGlobalConfiguration#STORAGE_KEEP_DISK_CACHE_STATE } is set to <code > true< / code > saves state of all queues of 2Q cache into file { @link #CACHE_STATE_FILE } . The only exception is pinned pages they need to pinned again . < / li > <li > Closes all files and flushes all data associated to them . < / li > < / ol >