public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.startedLocal = false; boolean hasStats = in.readBoolean(); if (hasStats) { this.regionEntry = NonLocalRegionEntryWithStats.newEntry(); } else { this.regionEntry = NonLocalRegionEntry.newEntry(); } this.regionEntry.fromData(in); } }
/** * creates a new Entry that wraps the given RegionEntry object for the given * storage Region * @param allowTombstones TODO */ public EntrySnapshot(RegionEntry regionEntry, LocalRegion dataRegion,LocalRegion region, boolean allowTombstones) { this.region = region; if (regionEntry instanceof NonLocalRegionEntry) { this.regionEntry = (NonLocalRegionEntry)regionEntry; this.startedLocal = false; } else { this.startedLocal = true; // note we always make these non-local now to handle PR buckets moving // out from under this Region.Entry. if (regionEntry.hasStats()) { this.regionEntry = NonLocalRegionEntryWithStats.newEntry(regionEntry, dataRegion, allowTombstones); } else { this.regionEntry = NonLocalRegionEntry.newEntry(regionEntry, dataRegion, allowTombstones); } } }
@Override public void process(DistributionMessage msg) { try { if (msg instanceof FetchEntryReplyMessage) { FetchEntryReplyMessage reply = (FetchEntryReplyMessage)msg; final Object value = reply.getValue(); if (value != null) { this.returnValue = NonLocalRegionEntry.newEntry(this.key, value, this.region, reply.versionTag); } if (DistributionManager.VERBOSE) { getDistributionManager().getLoggerI18n().fine( "FetchEntryResponse return value is " + this.returnValue); } } } finally { super.process(msg); } }
public EntrySnapshot getEntryOnRemote(final KeyInfo keyInfo, final LocalRegion localRegion, boolean allowTombstones) throws DataLocationException { final PartitionedRegion pr = (PartitionedRegion)localRegion; final Object key = keyInfo.getKey(); final Object val = getLocally(key, keyInfo.callbackArg, keyInfo.bucketId, pr, false, true /* localExecution true to avoid RawValue */, null, null, allowTombstones, true); if (val != null) { NonLocalRegionEntry nlre = NonLocalRegionEntry.newEntry(key, val, pr, null); LocalRegion dataReg = localRegion.getDataRegionForRead(keyInfo, Operation.GET_ENTRY); return new EntrySnapshot(nlre, dataReg, pr, allowTombstones); } else { throw new EntryNotFoundException( LocalizedStrings.PartitionedRegionDataStore_ENTRY_NOT_FOUND .toLocalizedString()); } }
returnValue.put(key, value); returnVersions.put(key, versionTag); entries.add(NonLocalRegionEntry.newEntry(key, value, this.pr, versionTag));
@Override public void getValueAndIsObject(Region p_region, Object key, Object callbackArg, LogWriterI18n logger, ServerConnection servConn, TXStateInterface tx, Object[] result) { Object data = null; LocalRegion region = (LocalRegion) p_region; Entry entry = region.getEntry(key, tx); if (logger.fineEnabled()) { logger.fine("GetEntryCommand: for key:"+key+" returning entry:"+entry); } if (entry != null) { EntrySnapshot snap; VersionTag<?> tag = null; if (entry instanceof EntrySnapshot) { snap = (EntrySnapshot)entry; tag = snap.getVersionTag(); } else { snap = new EntrySnapshot(); } NonLocalRegionEntry re = NonLocalRegionEntry.newEntry(key, entry.getValue(), region, tag); snap.setRegionEntry(re); snap.setRegion(region); data = snap; } result[0] = data; result[1] = true; // isObject is true } }
snap = new EntrySnapshot(); NonLocalRegionEntry re = NonLocalRegionEntry.newEntry(key, entry.getValue(), lregion, tag); snap.setRegionEntry(re);
String regionPath = region.getFullPath(); if (re.getVersionStamp().getEntryVersion() <= 1) { RegionEntry oldRegionEntry = NonLocalRegionEntry.newEntry(re.getKeyCopy(), Token.TOMBSTONE, (LocalRegion)region, re.getVersionStamp().asVersionTag()); if (getLoggerI18n().fineEnabled()) { RegionEntry max = NonLocalRegionEntry.newEntry(re.getKeyCopy(), Token.TOMBSTONE, (LocalRegion)region, null); for (RegionEntry entry : oldEntries) {