anton-vinogradov commented on code in PR #13447:
URL: https://github.com/apache/ignite/pull/13447#discussion_r3753940822
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java:
##########
@@ -64,58 +68,70 @@ public class GridCacheEntryInfo implements
SelfMarshallingMessage, CacheIdAware
/** Deleted flag. */
private boolean deleted;
- /** {@inheritDoc} */
- @Override public int cacheId() {
- return cacheId;
- }
-
/**
- * @param cacheId Cache ID.
+ * Empty constructor for serialization purposes.
+ * see {@link #expireTimeDelta}.
*/
- public void cacheId(int cacheId) {
+ public GridCacheEntryInfo() {
+ initTime = U.currentTimeMillis();
Review Comment:
For a cache without an expiry policy the constructor skips the branch that
sets initTime, so expireTime() hits assert initTime > 0 before the check that
would return 0, and GridNearCacheAdapter.entryEx reaches it through
GridNearCacheEntry.initializeFromDht on every near entry lookup. Please set
initTime unconditionally.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java:
##########
@@ -190,30 +192,6 @@ public int marshalledSize(CacheObjectContext ctx) throws
IgniteCheckedException
return SIZE_OVERHEAD + size;
}
- // TODO IGNITE-28920: the rebase still runs inside the message; move it to
the code filling and reading the entry.
- /** {@inheritDoc} */
- @Override public void selfMarshal() {
- if (expireTime == 0)
- expireTime = -1;
- else {
- expireTime -= U.currentTimeMillis();
-
- if (expireTime < 0)
- expireTime = 0;
- }
- }
-
- /** {@inheritDoc} */
- @Override public void selfUnmarshal() {
- long remaining = expireTime;
-
- expireTime = remaining < 0 ? 0 : U.currentTimeMillis() + remaining;
-
- // Account for overflow.
- if (expireTime < 0)
- expireTime = 0;
- }
-
/** {@inheritDoc} */
@Override public String toString() {
Review Comment:
initTime is not transferred and the wire still carries two longs, so the
count is unchanged. The constant itself is worth a separate ticket: its terms
are Java object sizes, while both users of marshalledSize(), the supply batch
cut-off in GridDhtPartitionSupplyMessage.addEntry0 and the rebalance bytes
metric in GridDhtPartitionDemander, treat the result as bytes on the wire.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]