Search in sources :

Example 11 with EntryVersionsList

use of org.apache.geode.internal.cache.DistributedPutAllOperation.EntryVersionsList in project geode by apache.

the class RemoteRemoveAllMessage method fromData.

@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
    super.fromData(in);
    this.eventId = (EventID) DataSerializer.readObject(in);
    this.callbackArg = DataSerializer.readObject(in);
    this.posDup = (flags & POS_DUP) != 0;
    if ((flags & HAS_BRIDGE_CONTEXT) != 0) {
        this.bridgeContext = DataSerializer.readObject(in);
    }
    this.removeAllDataCount = (int) InternalDataSerializer.readUnsignedVL(in);
    this.removeAllData = new RemoveAllEntryData[removeAllDataCount];
    if (this.removeAllDataCount > 0) {
        final Version version = InternalDataSerializer.getVersionForDataStreamOrNull(in);
        final ByteArrayDataInput bytesIn = new ByteArrayDataInput();
        for (int i = 0; i < this.removeAllDataCount; i++) {
            this.removeAllData[i] = new RemoveAllEntryData(in, this.eventId, i, version, bytesIn);
        }
        boolean hasTags = in.readBoolean();
        if (hasTags) {
            EntryVersionsList versionTags = EntryVersionsList.create(in);
            for (int i = 0; i < this.removeAllDataCount; i++) {
                this.removeAllData[i].versionTag = versionTags.get(i);
            }
        }
    }
}
Also used : EntryVersionsList(org.apache.geode.internal.cache.DistributedPutAllOperation.EntryVersionsList) Version(org.apache.geode.internal.Version) RemoveAllEntryData(org.apache.geode.internal.cache.DistributedRemoveAllOperation.RemoveAllEntryData) ByteArrayDataInput(org.apache.geode.internal.ByteArrayDataInput)

Example 12 with EntryVersionsList

use of org.apache.geode.internal.cache.DistributedPutAllOperation.EntryVersionsList in project geode by apache.

the class RemoteRemoveAllMessage method toData.

@Override
public void toData(DataOutput out) throws IOException {
    super.toData(out);
    DataSerializer.writeObject(this.eventId, out);
    DataSerializer.writeObject(this.callbackArg, out);
    if (this.bridgeContext != null) {
        DataSerializer.writeObject(this.bridgeContext, out);
    }
    InternalDataSerializer.writeUnsignedVL(this.removeAllDataCount, out);
    if (this.removeAllDataCount > 0) {
        EntryVersionsList versionTags = new EntryVersionsList(removeAllDataCount);
        boolean hasTags = false;
        for (int i = 0; i < this.removeAllDataCount; i++) {
            if (!hasTags && removeAllData[i].versionTag != null) {
                hasTags = true;
            }
            VersionTag<?> tag = removeAllData[i].versionTag;
            versionTags.add(tag);
            removeAllData[i].versionTag = null;
            this.removeAllData[i].toData(out);
            this.removeAllData[i].versionTag = tag;
        }
        out.writeBoolean(hasTags);
        if (hasTags) {
            InternalDataSerializer.invokeToData(versionTags, out);
        }
    }
}
Also used : EntryVersionsList(org.apache.geode.internal.cache.DistributedPutAllOperation.EntryVersionsList)

Aggregations

EntryVersionsList (org.apache.geode.internal.cache.DistributedPutAllOperation.EntryVersionsList)12 ByteArrayDataInput (org.apache.geode.internal.ByteArrayDataInput)6 Version (org.apache.geode.internal.Version)6 PutAllEntryData (org.apache.geode.internal.cache.DistributedPutAllOperation.PutAllEntryData)4 RemoveAllEntryData (org.apache.geode.internal.cache.DistributedRemoveAllOperation.RemoveAllEntryData)4 EntryEventImpl (org.apache.geode.internal.cache.EntryEventImpl)2 DistributedPutAllOperation (org.apache.geode.internal.cache.DistributedPutAllOperation)1 DistributedRemoveAllOperation (org.apache.geode.internal.cache.DistributedRemoveAllOperation)1