private boolean basicModify(DiskEntry entry,ValueWrapper value,byte userBits,boolean async) throws IOException, InterruptedException {
  DiskId id=entry.getDiskId();
  long startPosForSynchOp=-1L;
  OverflowOplog emptyOplog=null;
synchronized (this.crf) {
    initOpState(entry,value,userBits);
    int adjustment=getOpStateSize();
    assert adjustment > 0;
    int oldOplogId;
    startPosForSynchOp=writeOpLogBytes(async);
    if (startPosForSynchOp == -1) {
      return false;
    }
 else {
      if (logger.isTraceEnabled()) {
        logger.trace("Oplog::basicModify:Released ByteBuffer with data for Disk ID = {}",id);
      }
synchronized (id) {
        oldOplogId=(int)id.setOplogId(getOplogId());
        id.setOffsetInOplog(startPosForSynchOp);
        if (EntryBits.isNeedsValue(userBits)) {
          id.setValueLength(value.getLength());
        }
 else {
          id.setValueLength(0);
        }
        id.setUserBits(userBits);
      }
      if (oldOplogId > 0) {
        OverflowOplog oldOplog=this.getOplogSet().getChild(oldOplogId);
        if (oldOplog != null) {
          if (oldOplog.rmLive(entry)) {
            if (oldOplogId != getOplogId()) {
              emptyOplog=oldOplog;
            }
          }
        }
      }
      addLive(entry);
    }
    clearOpState();
  }
  if (LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER) {
    CacheObserverHolder.getInstance().afterSettingOplogOffSet(startPosForSynchOp);
  }
  if (emptyOplog != null && (!emptyOplog.isCompacting() || emptyOplog.calledByCompactorThread())) {
    if (emptyOplog.calledByCompactorThread() && emptyOplog.hasNoLiveValues()) {
      flushAll();
    }
    emptyOplog.handleNoLiveValues();
  }
  return true;
}

private boolean basicModify ( DiskEntry entry , ValueWrapper value , byte userBits , boolean async ) throws IOException , InterruptedException { DiskId id = entry . getDiskId ( ) ; long startPosForSynchOp = - 1L ; OverflowOplog emptyOplog = null ; synchronized ( this . crf ) { initOpState ( entry , value , userBits ) ; int adjustment = getOpStateSize ( ) ; assert adjustment > 0 ; int oldOplogId ; startPosForSynchOp = writeOpLogBytes ( async ) ; if ( startPosForSynchOp == - 1 ) { return false ; } else { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Oplog::basicModify:Released ByteBuffer with data for Disk ID = {}" , id ) ; } synchronized ( id ) { oldOplogId = ( int ) id . setOplogId ( getOplogId ( ) ) ; id . setOffsetInOplog ( startPosForSynchOp ) ; if ( EntryBits . isNeedsValue ( userBits ) ) { id . setValueLength ( value . getLength ( ) ) ; } else { id . setValueLength ( 0 ) ; } id . setUserBits ( userBits ) ; } if ( oldOplogId > 0 ) { OverflowOplog oldOplog = this . getOplogSet ( ) . getChild ( oldOplogId ) ; if ( oldOplog != null ) { if ( oldOplog . rmLive ( entry ) ) { if ( oldOplogId != getOplogId ( ) ) { emptyOplog = oldOplog ; } } } } addLive ( entry ) ; } clearOpState ( ) ; } if ( LocalRegion . ISSUE_CALLBACKS_TO_CACHE_OBSERVER ) { CacheObserverHolder . getInstance ( ) . afterSettingOplogOffSet ( startPosForSynchOp ) ; } if ( emptyOplog != null && ( ! emptyOplog . isCompacting ( ) || emptyOplog . calledByCompactorThread ( ) ) ) { if ( emptyOplog . calledByCompactorThread ( ) && emptyOplog . hasNoLiveValues ( ) ) { flushAll ( ) ; } emptyOplog . handleNoLiveValues ( ) ; } return true ; }
asif : a helper function which identifies whether to modify the entry in the current oplog or to make the switch to the next oplog . this function enables us to reuse the byte buffer which got created for an oplog which no longer permits us to use itself . it will also take acre of compaction if required
