[ 
https://issues.apache.org/jira/browse/GEODE-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15930631#comment-15930631
 ] 

ASF subversion and git services commented on GEODE-2536:
--------------------------------------------------------

Commit 26700b5d0df5468d58acbde6f82ca331544c760f in geode's branch 
refs/heads/feature/GEODE-2420 from [~eshu]
[ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=26700b5 ]

GEODE-2536: Remove the inappropriate implementation of methods in DiskId for 
persistent regions.

markForWriting and unmarkForWriting should not be used for persistent region.
needsToBeWritten always return false now for persistent region, as the 
diskEntry either is being written to disk (sync) or sheduled to be written to 
disk (async)


> DiskId code confusing in how it implements needsToBeWritten
> -----------------------------------------------------------
>
>                 Key: GEODE-2536
>                 URL: https://issues.apache.org/jira/browse/GEODE-2536
>             Project: Geode
>          Issue Type: Improvement
>          Components: persistence
>            Reporter: Darrel Schneider
>            Assignee: Eric Shu
>
> DiskId has an abstract method "needsToBeWritten." It is set to true by 
> "markForWriting" and set to false by "unmarkForWriting." DiskId has two types 
> of implementations: one for overflow only regions and one for persistent 
> regions.
> The needsToBeWritten only makes sense for overflow only. But the persistent 
> DiskIds also implement these methods and do so in a way that can be confused 
> with "isKeyIdNegative."
> Since markForWriting will only be called for overflow only disk ids I 
> recommend that the persistent implementation of this method be changed to 
> always throw an exception.
> unmarkForWriting may be called on any type of disk id but for persistent ones 
> should be changed to do nothing.
> needsToBeWritten should be changed to always return false for persistent 
> DiskIds since they are immediately written to disk (or scheduled to be 
> written if async) by whoever gives them a new value. needsToBeWritten is only 
> called by the overflowToDisk method and for a persistent+overflow region it 
> should never need to write the value to disk; all it needs to do is remove 
> the value from memory since it is written to disk.
> The current implementation of these methods on persistent DiskIds do it by 
> negating the keyId. Unfortunately this is also done to indicate that the 
> value was not recovered from disk.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to