public synchronized T acquireModify() throws CacheException {
  if (LOG.isTraceEnabled())   LOG.trace("Acquire modify " + getVarName());
  long t0=DMLScript.STATISTICS ? System.nanoTime() : 0;
  if (!isAvailableToModify())   throw new CacheException("MatrixObject not available to modify.");
  if (_data == null)   getCache();
  if (isEmpty(true) && _data == null) {
    if (_hdfsFileName == null)     throw new CacheException("Cannot read matrix for empty filename.");
    try {
      _data=readBlobFromHDFS(_hdfsFileName);
    }
 catch (    IOException e) {
      throw new CacheException("Reading of " + _hdfsFileName + " ("+ getVarName()+ ") failed.",e);
    }
  }
  acquire(true,_data == null);
  updateStatusPinned(true);
  setDirty(true);
  _isAcquireFromEmpty=false;
  if (DMLScript.STATISTICS) {
    long t1=System.nanoTime();
    CacheStatistics.incrementAcquireMTime(t1 - t0);
  }
  return _data;
}

public synchronized T acquireModify ( ) throws CacheException { if ( LOG . isTraceEnabled ( ) ) LOG . trace ( "Acquire modify " + getVarName ( ) ) ; long t0 = DMLScript . STATISTICS ? System . nanoTime ( ) : 0 ; if ( ! isAvailableToModify ( ) ) throw new CacheException ( "MatrixObject not available to modify." ) ; if ( _data == null ) getCache ( ) ; if ( isEmpty ( true ) && _data == null ) { if ( _hdfsFileName == null ) throw new CacheException ( "Cannot read matrix for empty filename." ) ; try { _data = readBlobFromHDFS ( _hdfsFileName ) ; } catch ( IOException e ) { throw new CacheException ( "Reading of " + _hdfsFileName + " (" + getVarName ( ) + ") failed." , e ) ; } } acquire ( true , _data == null ) ; updateStatusPinned ( true ) ; setDirty ( true ) ; _isAcquireFromEmpty = false ; if ( DMLScript . STATISTICS ) { long t1 = System . nanoTime ( ) ; CacheStatistics . incrementAcquireMTime ( t1 - t0 ) ; } return _data ; }
acquires the exclusive " write " lock for a thread that wants to change cache block cell values . produces the reference to the cache block , restores the cache block to main memory , reads from hdfs if needed . in - status : empty , evictable , evicted ; out - status : modify .
