question: public void refreshEntriesFromServerKeys ( Connection con , List serverKeys , InterestResultPolicy pol ) { if ( serverKeys == null ) { return ; } ServerRegionProxy proxy = getServerProxy ( ) ; if ( logger . isDebugEnabled ( ) ) { logKeys ( serverKeys , pol ) ; } if ( pol == InterestResultPolicy . NONE ) { return ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "refreshEntries region={}" , getFullPath ( ) ) ; } for ( Iterator it = serverKeys . iterator ( ) ; it . hasNext ( ) ; ) { ArrayList keysList = ( ArrayList ) it . next ( ) ; if ( keysList == null ) { continue ; } if ( EntryLogger . isEnabled ( ) ) { if ( con != null ) { Endpoint endpoint = con . getEndpoint ( ) ; if ( endpoint != null ) { EntryLogger . setSource ( endpoint . getMemberId ( ) , "RIGII" ) ; } } } try { ArrayList list = new ArrayList ( keysList ) ; if ( pol != InterestResultPolicy . KEYS_VALUES ) { for ( Iterator it2 = keysList . iterator ( ) ; it2 . hasNext ( ) ; ) { Object currentKey = it2 . next ( ) ; if ( currentKey == null || getImageState ( ) . hasDestroyedEntry ( currentKey ) ) { list . remove ( currentKey ) ; } } } if ( pol == InterestResultPolicy . KEYS ) { if ( ! isProxy ( ) ) { for ( Iterator it2 = list . iterator ( ) ; it2 . hasNext ( ) ; ) { Object currentKey = it2 . next ( ) ; entries . initialImagePut ( currentKey , 0 , Token . LOCAL_INVALID , false , false , null , null , false ) ; } } } else if ( ! list . isEmpty ( ) ) { Assert . assertTrue ( pol == InterestResultPolicy . KEYS_VALUES ) ; VersionedObjectList values = ( VersionedObjectList ) list . get ( 0 ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "processing interest response: {}" , values . size ( ) ) ; } VersionedObjectList . Iterator listIt = values . iterator ( ) ; while ( listIt . hasNext ( ) ) { VersionedObjectList . Entry entry = listIt . next ( ) ; Object currentKey = entry . getKey ( ) ; if ( currentKey == null || getImageState ( ) . hasDestroyedEntry ( currentKey ) ) { continue ; } Object val = entry . getObject ( ) ; boolean isBytes = entry . isBytes ( ) ; boolean isKeyOnServer = ! entry . isKeyNotOnServer ( ) ; boolean isTombstone = this . concurrencyChecksEnabled && entry . isKeyNotOnServer ( ) && ( entry . getVersionTag ( ) != null ) ; final VersionTag tag = entry . getVersionTag ( ) ; if ( val instanceof Throwable ) { logger . warn ( LocalizedMessage . create ( LocalizedStrings . LocalRegion_CAUGHT_THE_FOLLOWING_EXCEPTION_FOR_KEY_0_WHILE_PERFORMING_A_REMOTE_GETALL , currentKey ) , ( Throwable ) val ) ; localDestroyNoCallbacks ( currentKey ) ; continue ; } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "refreshEntries key={} value={} version={}" , currentKey , entry , tag ) ; } if ( tag == null ) { localDestroyNoCallbacks ( currentKey ) ; } } if ( val instanceof byte [ ] && ! isBytes ) { val = CachedDeserializableFactory . create ( ( byte [ ] ) val ) ; } if ( isTombstone ) { assert val == null : "server returned a value for a destroyed entry" ; val = Token . TOMBSTONE ; } if ( val != null || isTombstone ) { if ( ! isProxy ( ) ) { entries . initialImagePut ( currentKey , 0 , val , false , false , tag , null , false ) ; } } else { RegionEntry re = entries . getEntry ( currentKey ) ; if ( ! isProxy ( ) && isKeyOnServer ) { entries . initialImagePut ( currentKey , 0 , Token . LOCAL_INVALID , false , false , tag , null , false ) ; } else { if ( re != null ) { synchronized ( re ) { if ( re . isDestroyedOrRemovedButNotTombstone ( ) ) { entries . removeEntry ( currentKey , re , false ) ; } } } } } } } } catch ( DiskAccessException dae ) { this . handleDiskAccessException ( dae ) ; throw dae ; } finally { EntryLogger . clearSource ( ) ; } } }
target:  Refresh local entries based on server's list of keys