static boolean sendChunk(InternalDistributedMember recipient, int processorId, DM dm, HeapDataOutputStream chunk, int seriesNum, int msgNum, int numSeries, boolean lastInSeries) { FetchKeysReplyMessage reply = new FetchKeysReplyMessage(recipient, processorId, chunk, seriesNum, msgNum, numSeries, lastInSeries); Set failures = dm.putOutgoing(reply); return (failures == null) || (failures.size() == 0); }
boolean finished = chunkSet(recipient, keys, InitialImageOperation.CHUNK_SIZE_IN_BYTES, false, new ObjectIntProcedure() { int msgNum = 0;
if (msg.getException() != null) { process(msg);
() -> new ManageBucketReplyMessage()); registerDSFID(PR_FETCH_KEYS_REPLY_MESSAGE, () -> new FetchKeysReplyMessage()); registerDSFID(PR_DUMP_B2N_REGION_MSG, () -> new DumpB2NRegion()); registerDSFID(PR_DUMP_B2N_REPLY_MESSAGE, () -> new DumpB2NReplyMessage());
if (msg.getException() != null) { process(msg);
boolean finished = chunkSet(recipient, keys, InitialImageOperation.CHUNK_SIZE_IN_BYTES, false, new TObjectIntProcedure() { int msgNum = 0;
FetchKeysReplyMessage.send(getSender(), getProcessorId(), dm, keys, this);
FetchKeysReplyMessage.send(getSender(), getProcessorId(), dm, keys);
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("FetchKeysReplyMessage ") .append("processorid=").append(this.processorId); if (getSender() != null) { sb.append(",sender=").append(this.getSender()); } sb.append(",seriesNum=").append(seriesNum) .append(",msgNum=").append(msgNum) .append(",numSeries=").append(numSeries) .append(",lastInSeries=").append(lastInSeries); if (chunkStream != null) { sb.append(",size=").append(chunkStream.size()); } else if (chunk != null) { sb.append(",size=").append(chunk.length); } final ReplyException exception = getException(); if (exception != null) { sb.append(", exception=").append(exception); } return sb.toString(); } }
@Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("FetchKeysReplyMessage ") .append("processorid=").append(this.processorId); if (getSender() != null) { sb.append(",sender=").append(this.getSender()); } sb.append(",seriesNum=").append(seriesNum) .append(",msgNum=").append(msgNum) .append(",numSeries=").append(numSeries) .append(",lastInSeries=").append(lastInSeries); if (chunkStream != null) { sb.append(",size=").append(chunkStream.size()); } else if (chunk != null) { sb.append(",size=").append(chunk.length); } if (getException() != null) { sb.append(", exception=").append(getException()); } return sb.toString(); } }
/** * Processes this message. This method is invoked by the receiver * of the message. * @param dm the distribution manager that is processing the message. */ @Override public void process(final DM dm, final ReplyProcessor21 p) { final long startTime = getTimestamp(); LogWriterI18n l = dm.getLoggerI18n(); FetchKeysResponse processor = (FetchKeysResponse)p; if (processor == null) { if (DistributionManager.VERBOSE) { l.fine("FetchKeysReplyMessage processor not found"); } return; } processor.processChunk(this); if (DistributionManager.VERBOSE) { l.fine(processor + " processed " + this); } dm.getStats().incReplyMessageTime(DistributionStats.getStatTime() - startTime); }
/** * Processes this message. This method is invoked by the receiver * of the message. * @param dm the distribution manager that is processing the message. */ @Override public void process(final DM dm, final ReplyProcessor21 p) { final long startTime = getTimestamp(); FetchKeysResponse processor = (FetchKeysResponse)p; if (processor == null) { if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "FetchKeysReplyMessage processor not found"); } return; } processor.processChunk(this); if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "{} processed {}", processor, this); } dm.getStats().incReplyMessageTime(DistributionStats.getStatTime() - startTime); }
/** * @param a byte[] chunk * @param b positive if last chunk * @return true to continue to next chunk */ public boolean execute(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, srcMessage); return okay; } catch (CancelException e) { return false; } } }, logger);
/** * @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; } } });
private FetchKeysReplyMessage(InternalDistributedMember recipient, int processorId, HeapDataOutputStream chunk, int seriesNum, int msgNum, int numSeries, boolean lastInSeries) { super(); setRecipient(recipient); setProcessorId(processorId); this.seriesNum = seriesNum; this.msgNum = msgNum; this.numSeries = numSeries; this.lastInSeries = lastInSeries; this.chunkStream = chunk; }
static boolean sendChunk(InternalDistributedMember recipient, int processorId, DM dm, HeapDataOutputStream chunk, int seriesNum, int msgNum, int numSeries, boolean lastInSeries, AbstractOperationMessage srcMessage) { FetchKeysReplyMessage reply = new FetchKeysReplyMessage(recipient, processorId, chunk, seriesNum, msgNum, numSeries, lastInSeries, srcMessage); Set failures = dm.putOutgoing(reply); return (failures == null) || (failures.size() == 0); }
private FetchKeysReplyMessage(InternalDistributedMember recipient, int processorId, HeapDataOutputStream chunk, int seriesNum, int msgNum, int numSeries, boolean lastInSeries, AbstractOperationMessage srcMessage) { super(srcMessage, true, true); setRecipient(recipient); setProcessorId(processorId); this.seriesNum = seriesNum; this.msgNum = msgNum; this.numSeries = numSeries; this.lastInSeries = lastInSeries; this.chunkStream = chunk; }