public static void send(final InternalDistributedMember recipient, final int processorId,
        final DM dm, Set keys) throws ForceReattemptException {
      Assert.assertTrue(recipient != null, "FetchKeysReplyMessage NULL reply message");
      final int numSeries = 1;
      final int seriesNum = 0;
      // chunkEntries returns false if didn't finish
      if (logger.isDebugEnabled()) {
        logger.debug("Starting pr keys chunking for {} kets to member {}", keys.size(), recipient);
      }
      try {
        boolean finished = chunkSet(recipient, keys, InitialImageOperation.CHUNK_SIZE_IN_BYTES, false,
          new ObjectIntProcedure() {
            int msgNum = 0;
            boolean last = false;
            /**
              * @param a byte[] chunk
              * @param b positive if last chunk
              * @return true to continue to next chunk
              */
            public boolean executeWith(Object a, int b) {
//              if (this.last)
//                throw new InternalGemFireError(LocalizedStrings.FetchKeysMessage_ALREADY_PROCESSED_LAST_CHUNK.toLocalizedString());
              HeapDataOutputStream chunk = (HeapDataOutputStream)a;
              this.last = b > 0;
              try {
                boolean okay = sendChunk(recipient, processorId, dm, chunk, seriesNum, msgNum++, numSeries, this.last);
                return okay;
              }
              catch (CancelException e) {
                return false;
              }
            }
          });
        if (logger.isDebugEnabled()) {
          logger.debug("{} pr keys chunking", (finished?"Finished" : "DID NOT complete"));
        }
      }
      catch (IOException io) {
        throw new ForceReattemptException(LocalizedStrings.FetchKeysMessage_UNABLE_TO_SEND_RESPONSE_TO_FETCH_KEYS_REQUEST.toLocalizedString(), io);
      }
      // TODO [bruce] pass a reference to the cache or region down here so we can do this test
      //Assert.assertTrue(!cache is closed, "chunking interrupted but cache is still open");
    }
public static void send(final InternalDistributedMember recipient, final int processorId,
        final DM dm, Set keys) throws ForceReattemptException {
      Assert.assertTrue(recipient != null, "FetchKeysReplyMessage NULL reply message");
      final int numSeries = 1;
      final int seriesNum = 0;
     
      if (logger.isDebugEnabled()) {
        logger.debug("Starting pr keys chunking for {} kets to member {}", keys.size(), recipient);
      }
      try {
        boolean finished = chunkSet(recipient, keys, InitialImageOperation.CHUNK_SIZE_IN_BYTES, false,
          new ObjectIntProcedure() {
            int msgNum = 0;
            boolean last = false;
           
            public boolean executeWith(Object a, int b) {
              HeapDataOutputStream chunk = (HeapDataOutputStream)a;
              this.last = b > 0;
              try {
                boolean okay = sendChunk(recipient, processorId, dm, chunk, seriesNum, msgNum++, numSeries, this.last);
                return okay;
              }
              catch (CancelException e) {
                return false;
              }
            }
          });
        if (logger.isDebugEnabled()) {
          logger.debug("{} pr keys chunking", (finished?"Finished" : "DID NOT complete"));
        }
      }
      catch (IOException io) {
        throw new ForceReattemptException(LocalizedStrings.FetchKeysMessage_UNABLE_TO_SEND_RESPONSE_TO_FETCH_KEYS_REQUEST.toLocalizedString(), io);
      }
     
     
    }
public static void send(final internaldistributedmember recipient, final int processorid, final dm dm, set keys) throws forcereattemptexception { assert.asserttrue(recipient != null, "fetchkeysreplymessage null reply message"); final int numseries = 1; final int seriesnum = 0; if (logger.isdebugenabled()) { logger.debug("starting pr keys chunking for {} kets to member {}", keys.size(), recipient); } try { boolean finished = chunkset(recipient, keys, initialimageoperation.chunk_size_in_bytes, false, new objectintprocedure() { int msgnum = 0; boolean last = false; public boolean executewith(object a, int b) { heapdataoutputstream chunk = (heapdataoutputstream)a; this.last = b > 0; try { boolean okay = sendchunk(recipient, processorid, dm, chunk, seriesnum, msgnum++, numseries, this.last); return okay; } catch (cancelexception e) { return false; } } }); if (logger.isdebugenabled()) { logger.debug("{} pr keys chunking", (finished?"finished" : "did not complete")); } } catch (ioexception io) { throw new forcereattemptexception(localizedstrings.fetchkeysmessage_unable_to_send_response_to_fetch_keys_request.tolocalizedstring(), io); } }