public synchronized void release() throws CacheException {
  if (LOG.isTraceEnabled())   LOG.trace("Release " + getVarName());
  long t0=DMLScript.STATISTICS ? System.nanoTime() : 0;
  boolean write=false;
  if (isModify()) {
    write=true;
    setDirty(true);
    refreshMetaData();
  }
  _data.compactEmptyBlock();
  release(_isAcquireFromEmpty && !_requiresLocalWrite);
  updateStatusPinned(false);
  if (isCachingActive() && isCached(true) && !isBelowCachingThreshold()) {
    if (write || _requiresLocalWrite) {
      String filePath=getCacheFilePathAndName();
      try {
        LazyWriteBuffer.writeBlock(filePath,_data);
      }
 catch (      Exception e) {
        throw new CacheException("Eviction to local path " + filePath + " ("+ getVarName()+ ") failed.",e);
      }
      _requiresLocalWrite=false;
    }
    createCache();
    _data=null;
  }
 else   if (LOG.isTraceEnabled()) {
    LOG.trace("Var " + getVarName() + " not subject to caching, state="+ getStatusAsString());
  }
  if (DMLScript.STATISTICS) {
    long t1=System.nanoTime();
    CacheStatistics.incrementReleaseTime(t1 - t0);
  }
}

public synchronized void release ( ) throws CacheException { if ( LOG . isTraceEnabled ( ) ) LOG . trace ( "Release " + getVarName ( ) ) ; long t0 = DMLScript . STATISTICS ? System . nanoTime ( ) : 0 ; boolean write = false ; if ( isModify ( ) ) { write = true ; setDirty ( true ) ; refreshMetaData ( ) ; } _data . compactEmptyBlock ( ) ; release ( _isAcquireFromEmpty && ! _requiresLocalWrite ) ; updateStatusPinned ( false ) ; if ( isCachingActive ( ) && isCached ( true ) && ! isBelowCachingThreshold ( ) ) { if ( write || _requiresLocalWrite ) { String filePath = getCacheFilePathAndName ( ) ; try { LazyWriteBuffer . writeBlock ( filePath , _data ) ; } catch ( Exception e ) { throw new CacheException ( "Eviction to local path " + filePath + " (" + getVarName ( ) + ") failed." , e ) ; } _requiresLocalWrite = false ; } createCache ( ) ; _data = null ; } else if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "Var " + getVarName ( ) + " not subject to caching, state=" + getStatusAsString ( ) ) ; } if ( DMLScript . STATISTICS ) { long t1 = System . nanoTime ( ) ; CacheStatistics . incrementReleaseTime ( t1 - t0 ) ; } }
releases the shared ( " read - only " ) or exclusive ( " write " ) lock . updates size information , last - access time , metadata , etc . synchronized because there might be parallel threads ( parfor local ) that access the same object ( in case it was created before the loop ) . in - status : read , modify ; out - status : read ( - 1 ) , evictable , empty .
