use of org.apache.geode.internal.offheap.annotations.Retained in project geode by apache.
the class DummyQRegion method getValues.
@Override
public SelectResults getValues() {
if (values == null) {
values = new ResultsBag(((HasCachePerfStats) getRegion().getCache()).getCachePerfStats());
values.setElementType(valueType);
}
values.clear();
Object val = this.entry.getValueOffHeapOrDiskWithoutFaultIn((LocalRegion) getRegion());
if (val instanceof StoredObject) {
@Retained @Released StoredObject ohval = (StoredObject) val;
try {
val = ohval.getDeserializedValue(getRegion(), this.entry);
} finally {
ohval.release();
}
} else if (val instanceof CachedDeserializable) {
val = ((CachedDeserializable) val).getDeserializedValue(getRegion(), this.entry);
}
values.add(val);
return values;
}
use of org.apache.geode.internal.offheap.annotations.Retained in project geode by apache.
the class DummyQRegion method toArray.
@Override
public Object[] toArray() {
if (valueInArray == null) {
valueInArray = new Object[1];
}
Object val = this.entry.getValueOffHeapOrDiskWithoutFaultIn((LocalRegion) getRegion());
if (val instanceof StoredObject) {
@Retained @Released StoredObject ohval = (StoredObject) val;
try {
val = ohval.getDeserializedValue(getRegion(), this.entry);
} finally {
ohval.release();
}
} else if (val instanceof CachedDeserializable) {
val = ((CachedDeserializable) val).getDeserializedValue(getRegion(), this.entry);
}
valueInArray[0] = val;
return valueInArray;
}
use of org.apache.geode.internal.offheap.annotations.Retained in project geode by apache.
the class EntryEventImpl method putExistingEntry.
/**
* Put a newValue into the given, write synced, existing, region entry. Sets oldValue in event if
* hasn't been set yet.
*
* @param oldValueForDelta Used by Delta Propagation feature
*/
void putExistingEntry(final LocalRegion owner, final RegionEntry reentry, boolean requireOldValue, Object oldValueForDelta) throws RegionClearedException {
makeUpdate();
// only set oldValue if it hasn't already been set to something
if (this.oldValue == null) {
if (!reentry.isInvalidOrRemoved()) {
if (// fix for bug
requireOldValue || EVENT_OLD_VALUE || this.region instanceof HARegion) // 37909
{
@Retained Object ov;
if (ReferenceCountHelper.trackReferenceCounts()) {
ReferenceCountHelper.setReferenceCountOwner(new OldValueOwner());
ov = reentry._getValueRetain(owner, true);
ReferenceCountHelper.setReferenceCountOwner(null);
} else {
ov = reentry._getValueRetain(owner, true);
}
if (ov == null)
ov = Token.NOT_AVAILABLE;
// ov has already been retained so call basicSetOldValue instead of retainAndSetOldValue
basicSetOldValue(ov);
} else {
basicSetOldValue(Token.NOT_AVAILABLE);
}
}
}
if (this.oldValue == Token.NOT_AVAILABLE) {
FilterProfile fp = this.region.getFilterProfile();
if (this.op.guaranteesOldValue() || (fp != null && /* #41532 */
fp.entryRequiresOldValue(this.getKey()))) {
setOldValueForQueryProcessing();
}
}
// setNewValueInRegion(null);
setNewValueInRegion(owner, reentry, oldValueForDelta);
}
use of org.apache.geode.internal.offheap.annotations.Retained in project geode by apache.
the class PutMessage method createListenerEvent.
// public final boolean needsDirectAck()
// {
// return this.directAck;
// }
// final public int getProcessorType() {
// return DistributionManager.PARTITIONED_REGION_EXECUTOR;
// }
/**
* create a new EntryEvent to be used in notifying listeners, bridge servers, etc. Caller must
* release result if it is != to sourceEvent
*/
@Retained
EntryEventImpl createListenerEvent(EntryEventImpl sourceEvent, PartitionedRegion r, InternalDistributedMember member) {
final EntryEventImpl e2;
if (this.notificationOnly && this.bridgeContext == null) {
e2 = sourceEvent;
} else {
e2 = new EntryEventImpl(sourceEvent);
if (this.bridgeContext != null) {
e2.setContext(this.bridgeContext);
}
}
e2.setRegion(r);
e2.setOriginRemote(true);
e2.setInvokePRCallbacks(!notificationOnly);
if (!sourceEvent.hasOldValue()) {
e2.oldValueNotAvailable();
}
if (this.filterInfo != null) {
e2.setLocalFilterInfo(this.filterInfo.getFilterInfo(member));
}
if (this.versionTag != null) {
this.versionTag.replaceNullIDs(getSender());
e2.setVersionTag(this.versionTag);
}
return e2;
}
use of org.apache.geode.internal.offheap.annotations.Retained in project geode by apache.
the class DestroyMessage method createListenerEvent.
/**
* create a new EntryEvent to be used in notifying listeners, bridge servers, etc. Caller must
* release result if it is != to sourceEvent
*/
@Retained
EntryEventImpl createListenerEvent(EntryEventImpl sourceEvent, PartitionedRegion r, InternalDistributedMember member) {
final EntryEventImpl e2;
if (this.notificationOnly && this.bridgeContext == null) {
e2 = sourceEvent;
} else {
e2 = new EntryEventImpl(sourceEvent);
if (this.bridgeContext != null) {
e2.setContext(this.bridgeContext);
}
}
e2.setRegion(r);
e2.setOriginRemote(true);
e2.setInvokePRCallbacks(!notificationOnly);
if (this.filterInfo != null) {
e2.setLocalFilterInfo(this.filterInfo.getFilterInfo(member));
}
if (this.versionTag != null) {
this.versionTag.replaceNullIDs(getSender());
e2.setVersionTag(this.versionTag);
}
return e2;
}
Aggregations