Darrel Schneider created GEODE-2536:
---------------------------------------

             Summary: 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


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