Gemfire JavaDocs
Interface Delta
-
- All Known Implementing Classes:
DeltaSession
,DeltaSession10
,DeltaSession8
,DeltaSession9
public interface Delta
This interface defines a contract between the application and GemFire that allows GemFire to determine whether an application object contains a delta, allows GemFire to extract the delta from an application object, and generate a new application object by applying a delta to an existing application object. The difference in object state is contained in theDataOutput
andDataInput
parameters.- Since:
- GemFire 6.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
fromDelta(java.io.DataInput in)
This method is invoked on an existing application object when an update is received as a delta.default boolean
getForceRecalculateSize()
By default, entry sizes are not recalculated when deltas are applied.boolean
hasDelta()
Returns true if this object has pending changes it can write out as a delta.void
toDelta(java.io.DataOutput out)
This method is invoked on an application object at the delta sender, if GemFire determines the presence of a delta by callinghasDelta()
on the object.
-
-
-
Method Detail
-
hasDelta
boolean hasDelta()
Returns true if this object has pending changes it can write out as a delta. Returns false if this object must be transmitted in its entirety.- Returns:
- whether this object has pending changes it can write out as a delta
-
toDelta
void toDelta(java.io.DataOutput out) throws java.io.IOException
This method is invoked on an application object at the delta sender, if GemFire determines the presence of a delta by callinghasDelta()
on the object. The delta is written to theDataOutput
object provided by GemFire.Any delta state should be reset in this method.
- Parameters:
out
- theDataOutput
to write to- Throws:
java.io.IOException
- if a problem occurs while writing toout
-
fromDelta
void fromDelta(java.io.DataInput in) throws java.io.IOException, InvalidDeltaException
This method is invoked on an existing application object when an update is received as a delta. This method throws anInvalidDeltaException
when the delta in theDataInput
cannot be applied to the object. GemFire automatically handles anInvalidDeltaException
by reattempting the update by sending the full application object.- Parameters:
in
- theDataInput
to read from- Throws:
java.io.IOException
- if a problem occurs while reading fromin
InvalidDeltaException
-
getForceRecalculateSize
default boolean getForceRecalculateSize()
By default, entry sizes are not recalculated when deltas are applied. This optimizes for the case where the size of an entry does not change. However, if an entry size does increase or decrease, this default behavior can result in the memory usage statistics becoming inaccurate. These are used to monitor the health of Geode instances, and for balancing memory usage across partitioned regions.There is a system property, gemfire.DELTAS_RECALCULATE_SIZE, which can be used to cause all deltas to trigger entry size recalculation when deltas are applied. By default, this is set to 'false' because of potential performance impacts when every delta triggers a recalculation.
To allow entry size recalculation on a per-delta basis, classes that extend the Delta interface should override this method to return 'true'. This may impact performance of specific delta types, but will not globally affect the performance of other Geode delta operations.
- Returns:
- whether entry sizes should be recalculated when deltas are applied
- Since:
- 1.14
-
-