use of org.apache.geode.internal.cache.DistributedPutAllOperation.PutAllEntryData in project geode by apache.
the class DistTxEntryEvent method putAllFromData.
/**
* @param in
* @throws IOException
* @throws ClassNotFoundException
*/
private void putAllFromData(DataInput in) throws IOException, ClassNotFoundException {
int putAllSize = DataSerializer.readInteger(in);
PutAllEntryData[] putAllEntries = new PutAllEntryData[putAllSize];
if (putAllSize > 0) {
final Version version = InternalDataSerializer.getVersionForDataStreamOrNull(in);
final ByteArrayDataInput bytesIn = new ByteArrayDataInput();
for (int i = 0; i < putAllSize; i++) {
putAllEntries[i] = new PutAllEntryData(in, this.eventID, i, version, bytesIn);
}
boolean hasTags = in.readBoolean();
if (hasTags) {
EntryVersionsList versionTags = EntryVersionsList.create(in);
for (int i = 0; i < putAllSize; i++) {
putAllEntries[i].versionTag = versionTags.get(i);
}
}
}
// TODO DISTTX: release this event?
EntryEventImpl e = EntryEventImpl.create(this.region, Operation.PUTALL_CREATE, null, null, null, true, this.getDistributedMember(), true, true);
this.putAllOp = new DistributedPutAllOperation(e, putAllSize, false);
this.putAllOp.setPutAllEntryData(putAllEntries);
}
use of org.apache.geode.internal.cache.DistributedPutAllOperation.PutAllEntryData in project geode by apache.
the class PutAllPRMessage method getEventFromEntry.
@Retained
public static EntryEventImpl getEventFromEntry(LocalRegion r, InternalDistributedMember myId, InternalDistributedMember eventSender, int idx, DistributedPutAllOperation.PutAllEntryData[] data, boolean notificationOnly, ClientProxyMembershipID bridgeContext, boolean posDup, boolean skipCallbacks) {
PutAllEntryData prd = data[idx];
// EntryEventImpl ev = EntryEventImpl.create(r,
// prd.getOp(),
// prd.getKey(), null/* value */, null /* callbackArg */,
// false /* originRemote */,
// eventSender,
// true/* generate Callbacks */,
// prd.getEventID());
@Retained EntryEventImpl ev = EntryEventImpl.create(r, prd.getOp(), prd.getKey(), prd.getValue(), null, false, eventSender, !skipCallbacks, prd.getEventID());
boolean evReturned = false;
try {
if (prd.getValue() == null && ev.getRegion().getAttributes().getDataPolicy() == DataPolicy.NORMAL) {
ev.setLocalInvalid(true);
}
ev.setNewValue(prd.getValue());
ev.setOldValue(prd.getOldValue());
if (bridgeContext != null) {
ev.setContext(bridgeContext);
}
ev.setInvokePRCallbacks(!notificationOnly);
ev.setPossibleDuplicate(posDup);
if (prd.filterRouting != null) {
ev.setLocalFilterInfo(prd.filterRouting.getFilterInfo(myId));
}
if (prd.versionTag != null) {
prd.versionTag.replaceNullIDs(eventSender);
ev.setVersionTag(prd.versionTag);
}
// ev.setLocalFilterInfo(r.getFilterProfile().getLocalFilterRouting(ev));
if (notificationOnly) {
ev.setTailKey(-1L);
} else {
ev.setTailKey(prd.getTailKey());
}
evReturned = true;
return ev;
} finally {
if (!evReturned) {
ev.release();
}
}
}
Aggregations