public void fetchEntries(HashMap<Integer,HashSet> bucketKeys,VersionedObjectList values,ServerConnection servConn) throws IOException {
  int retryAttempts=calcRetry();
  RetryTimeKeeper retryTime=null;
  HashMap<Integer,HashSet> failures=new HashMap<Integer,HashSet>(bucketKeys);
  HashMap<InternalDistributedMember,HashMap<Integer,HashSet>> nodeToBuckets=new HashMap<InternalDistributedMember,HashMap<Integer,HashSet>>();
  while (--retryAttempts >= 0 && !failures.isEmpty()) {
    nodeToBuckets.clear();
    updateNodeToBucketMap(nodeToBuckets,failures);
    failures.clear();
    HashMap<Integer,HashSet> localBuckets=nodeToBuckets.remove(getMyId());
    if (localBuckets != null && !localBuckets.isEmpty()) {
      Set keys=new HashSet();
      for (      Integer id : localBuckets.keySet()) {
        keys.addAll(localBuckets.get(id));
      }
      if (!keys.isEmpty()) {
        BaseCommand.appendNewRegisterInterestResponseChunkFromLocal(this,values,"keyList",keys,servConn);
      }
    }
    Set<Integer> failedSet=handleOldNodes(nodeToBuckets,values,servConn);
    if (!failedSet.isEmpty()) {
      for (      Integer bId : failedSet) {
        failures.put(bId,bucketKeys.get(bId));
      }
      updateNodeToBucketMap(nodeToBuckets,failures);
      failures.clear();
    }
    fetchRemoteEntries(nodeToBuckets,failures,values,servConn);
    if (!failures.isEmpty()) {
      if (retryTime == null) {
        retryTime=new RetryTimeKeeper(this.retryTimeout);
      }
      if (!waitForFetchRemoteEntriesRetry(retryTime)) {
        break;
      }
    }
  }
  if (!failures.isEmpty()) {
    throw new InternalGemFireException("Failed to fetch entries from " + failures.size() + " buckets of region "+ getName()+ " for register interest.");
  }
}

public void fetchEntries ( HashMap < Integer , HashSet > bucketKeys , VersionedObjectList values , ServerConnection servConn ) throws IOException { int retryAttempts = calcRetry ( ) ; RetryTimeKeeper retryTime = null ; HashMap < Integer , HashSet > failures = new HashMap < Integer , HashSet > ( bucketKeys ) ; HashMap < InternalDistributedMember , HashMap < Integer , HashSet > > nodeToBuckets = new HashMap < InternalDistributedMember , HashMap < Integer , HashSet > > ( ) ; while ( -- retryAttempts >= 0 && ! failures . isEmpty ( ) ) { nodeToBuckets . clear ( ) ; updateNodeToBucketMap ( nodeToBuckets , failures ) ; failures . clear ( ) ; HashMap < Integer , HashSet > localBuckets = nodeToBuckets . remove ( getMyId ( ) ) ; if ( localBuckets != null && ! localBuckets . isEmpty ( ) ) { Set keys = new HashSet ( ) ; for ( Integer id : localBuckets . keySet ( ) ) { keys . addAll ( localBuckets . get ( id ) ) ; } if ( ! keys . isEmpty ( ) ) { BaseCommand . appendNewRegisterInterestResponseChunkFromLocal ( this , values , "keyList" , keys , servConn ) ; } } Set < Integer > failedSet = handleOldNodes ( nodeToBuckets , values , servConn ) ; if ( ! failedSet . isEmpty ( ) ) { for ( Integer bId : failedSet ) { failures . put ( bId , bucketKeys . get ( bId ) ) ; } updateNodeToBucketMap ( nodeToBuckets , failures ) ; failures . clear ( ) ; } fetchRemoteEntries ( nodeToBuckets , failures , values , servConn ) ; if ( ! failures . isEmpty ( ) ) { if ( retryTime == null ) { retryTime = new RetryTimeKeeper ( this . retryTimeout ) ; } if ( ! waitForFetchRemoteEntriesRetry ( retryTime ) ) { break ; } } } if ( ! failures . isEmpty ( ) ) { throw new InternalGemFireException ( "Failed to fetch entries from " + failures . size ( ) + " buckets of region " + getName ( ) + " for register interest." ) ; } }
fetches entries from local and remote nodes and appends these to register - interest response .
