// distribute if required
public void postPutAll(final DistributedPutAllOperation putAllOp,
      final VersionedObjectList successfulPuts, final LocalRegion region) {
    // TODO: TX: add support for batching using performOp as for other
    // update operations; add cacheWrite flag support for proper writer
    // invocation like in other ops; also support for NORMAL/PRELOADED regions?
    markDirty();
    if (isSnapshot()) {
      addAffectedRegion(region);
      region.getSharedDataView().postPutAll(putAllOp, successfulPuts, region);
      return;
    }
    if (region.getPartitionAttributes() != null) {
      // use PutAllPRMessage that already handles transactions
      region.postPutAllSend(putAllOp, this, successfulPuts);
    }
    else {
      try {
        final PutAllEntryData[] data = putAllOp.putAllData;
        final EntryEventImpl event = putAllOp.getBaseEvent();
        final RemotePutAllMessage msg = new RemotePutAllMessage(event, null,
            data, data.length, event.isPossibleDuplicate(), null, this);
        // process on self first
        if (region.getDataPolicy().withStorage()) {
          msg.doLocalPutAll(region, event, putAllOp, successfulPuts,
              region.getMyId(), false /* sendReply */);
        }
        addAffectedRegion(region);
        if (region.getScope().isDistributed()) {
          // distribute if required
          msg.distribute(event);
        }
      } catch (RemoteOperationException roe) {
        throw new TransactionDataNodeHasDepartedException(roe);
      }
    }
  }
addAffectedRegion(region);
if (region.getScope().isDistributed()) {
// distribute if required
msg.distribute(event);
}
final EntryEventImpl event = putAllOp.getBaseEvent();
final RemotePutAllMessage msg = new RemotePutAllMessage(event, null,
data, data.length, event.isPossibleDuplicate(), null, this);
// process on self first
if (region.getDataPolicy().withStorage()) {
msg.doLocalPutAll(region, event, putAllOp, successfulPuts,
region.getMyId(), false /* sendReply */);
}
addAffectedRegion(region);
if (region.getScope().isDistributed()) {
// distribute if required
msg.distribute(event);
}
} catch (RemoteOperationException roe) {
throw new TransactionDataNodeHasDepartedException(roe);
}
}
}
region.getSharedDataView().postPutAll(putAllOp, successfulPuts, region);
return;
}
if (region.getPartitionAttributes() != null) {
// use PutAllPRMessage that already handles transactions
region.postPutAllSend(putAllOp, this, successfulPuts);
}
else {
try {
final PutAllEntryData[] data = putAllOp.putAllData;
final EntryEventImpl event = putAllOp.getBaseEvent();
final RemotePutAllMessage msg = new RemotePutAllMessage(event, null,
data, data.length, event.isPossibleDuplicate(), null, this);
// process on self first
if (region.getDataPolicy().withStorage()) {
msg.doLocalPutAll(region, event, putAllOp, successfulPuts,
region.getMyId(), false /* sendReply */);
}
addAffectedRegion(region);
if (region.getScope().isDistributed()) {
// distribute if required
msg.distribute(event);
}
} catch (RemoteOperationException roe) {
throw new TransactionDataNodeHasDepartedException(roe);
}
}
}