[
https://issues.apache.org/jira/browse/GEODE-1290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16198220#comment-16198220
]
ASF subversion and git services commented on GEODE-1290:
--------------------------------------------------------
Commit b23abb68b8206ce13aeeccf10b77e577e4f58aaa in geode's branch
refs/heads/develop from [~abarve]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=b23abb6 ]
GEODE-1290: AbstractRegionEntry.prepareValueForCache cache the new serialized
value for off-heap memory. (#822)
* GEODE-1290: AbstractRegionEntry.prepareValueForCache cache the new
serialized value for off-heap memory.
* GEODE-1290: Called event's setCachedSerializedNewValue only once as per
review request. Added a unit test case.
* GEODE-1290: Called event's setCachedSerializedNewValue only once with
additional check of event.getCachedSerializedNewValue() == null as per
review request. Updated unit test case to free OffheapMemory.
* GEODE-1290: Updated unit test case to free OffheapMemory in try-finally
block.
* GEODE-1290: Updated PR with the changes suggested in review.
* GEODE-1290: Updated PR with the changes suggested in the review and
updated the test case.
> AbstractRegionEntry.prepareValueForCache should call
> event.setCachedSerializedNewValue
> --------------------------------------------------------------------------------------
>
> Key: GEODE-1290
> URL: https://issues.apache.org/jira/browse/GEODE-1290
> Project: Geode
> Issue Type: Bug
> Components: offheap
> Reporter: Darrel Schneider
> Assignee: Amey Barve
>
> AbstractRegionEntry.prepareValueForCache has an off-heap part of the code
> that copies the heap value to a byte array for storing it in off-heap memory.
> When it does this it should call EntryEventImpl.setCachedSerializedNewValue
> in case this operation needs to serialized value again.
> The place to do this call is marked in the following code with TODO OFFHEAP:
> byte[] data;
> boolean isSerialized = !(val instanceof byte[]);
> if (isSerialized) {
> if (event != null && event.getCachedSerializedNewValue() != null) {
> data = event.getCachedSerializedNewValue();
> } else if (val instanceof CachedDeserializable) {
> data = ((CachedDeserializable)val).getSerializedValue();
> // TODO OFFHEAP: cache data in event?
> } else if (val instanceof PdxInstance) {
> try {
> data = ((ConvertableToBytes)val).toBytes();
> // TODO OFFHEAP: cache data in event?
> } catch (IOException e) {
> throw new PdxSerializationException("Could not convert " + val
> + " to bytes", e);
> }
> } else {
> data = EntryEventImpl.serialize(val);
> // TODO OFFHEAP: cache data in event?
> }
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)