Device that maintains a strong reference to the Accumulator when it contains updates and needs to be checkpointed, and a weak reference otherwise. The Persistit instance contains a collection of AccumulatorRef
instances; these are used when determining which accumulators to include in the checkpoint operation. Once an Accumulator
's checkpoint has been written, the strong reference is removed until there is a subsequent update.
Scenario: a process creates a new Tree, creates an Accumulator and then releases all references to the Tree. Eventually the Tree and the new Accumulator should be garbage collected; however, the Accumulator must be retained until any values it has accumulated have been written as part of a checkpoint. The dual references in this class are intended to support this behavior; the _checkpointRef field is null whenever there are no changes to checkpoint; the _weakRef is used to detect when it is permissible to remove the AccumulatorRef
from the Persistit instance's accumulator set.
|
|
|
|