Example #1
0
 @Override
 public void close() throws IOException {
   if (_refcount.decrementAndGet() == 0) {
     super.close();
     PrivilegedAccessor.unsafeSetField(this, PagedStringChunk.class, "_cache", null);
     _paged.close();
     this._paged = null;
   }
 }
Example #2
0
 @Override
 protected void enlarge(final int pages) {
   ++enlarged;
   if (enlarged >= paging_threshold) {
     try {
       pagedOut();
     } catch (IOException e) {
       throw new IllegalStateException("page out failed", e);
     }
     paging_threshold = Math.max(2, (int) (paging_threshold * 0.8));
     enlarged = 0;
   }
   super.enlarge(pages);
 }