core/src/main/java/com/orientechnologies/common/collection/closabledictionary/OClosableLinkedContainer.java
private void emptyReadBuffers() {
    for (int n = 0; n < NUMBER_OF_READ_BUFFERS; n++) {
      AtomicReference<OClosableEntry<K, V>>[] buffer = readBuffers[n];

      long writeCount = readBufferDrainAtWriteCount[n].get();
      long counter = readBufferReadCount[n];

      while (true) {
        final int bufferIndex = (int) (counter & READ_BUFFER_INDEX_MASK);
        final AtomicReference<OClosableEntry<K, V>> eref = buffer[bufferIndex];
        final OClosableEntry<K, V> entry = eref.get();

        if (entry == null)
          break;

        applyRead(entry);
        counter++;

        eref.lazySet(null);
      }

      readBufferReadCount[n] = counter;
      readBufferDrainAtWriteCount[n].lazySet(writeCount);
    }
  }
private void emptyReadBuffers() {
    for (int n = 0; n < NUMBER_OF_READ_BUFFERS; n++) {
      AtomicReference<OClosableEntry<K, V>>[] buffer = readBuffers[n];

      long writeCount = readBufferDrainAtWriteCount[n].get();
      long counter = readBufferReadCount[n];

      while (true) {
        final int bufferIndex = (int) (counter & READ_BUFFER_INDEX_MASK);
        final AtomicReference<OClosableEntry<K, V>> eref = buffer[bufferIndex];
        final OClosableEntry<K, V> entry = eref.get();

        if (entry == null)
          break;

        applyRead(entry);
        counter++;

        eref.lazySet(null);
      }

      readBufferReadCount[n] = counter;
      readBufferDrainAtWriteCount[n].lazySet(writeCount);
    }
  }
private void emptyReadBuffers ( ) { for ( int n = 0 ; n < NUMBER_OF_READ_BUFFERS ; n ++ ) { AtomicReference < OClosableEntry < K , V > > [ ] buffer = readBuffers [ n ] ; long writeCount = readBufferDrainAtWriteCount [ n ] . get ( ) ; long counter = readBufferReadCount [ n ] ; while ( true ) { final int bufferIndex = ( int ) ( counter & READ_BUFFER_INDEX_MASK ) ; final AtomicReference < OClosableEntry < K , V > > eref = buffer [ bufferIndex ] ; final OClosableEntry < K , V > entry = eref . get ( ) ; if ( entry == null ) break ; applyRead ( entry ) ; counter ++ ; eref . lazySet ( null ) ; } readBufferReadCount [ n ] = counter ; readBufferDrainAtWriteCount [ n ] . lazySet ( writeCount ) ; } }
Read content of all read buffers and reorder elements inside of LRU list to update internal statistic.
Method has to be wrapped by LRU lock.
Read content of all read buffers and reorder elements inside of LRU list to update internal statistic . Method has to be wrapped by LRU lock .