# ignite-51
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b93f7a3c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b93f7a3c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b93f7a3c Branch: refs/heads/ignite-51-v2 Commit: b93f7a3ceefa9ad9326cb636ca183ed7bc6f8139 Parents: 065b81e Author: sboikov <sboi...@gridgain.com> Authored: Thu Mar 5 00:13:00 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Thu Mar 5 00:13:33 2015 +0300 ---------------------------------------------------------------------- .../processors/cache/GridCacheMapEntry.java | 47 +++++++++++++++----- 1 file changed, 37 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b93f7a3c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java index 8b7106c..dc48cf7 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java @@ -56,9 +56,6 @@ import static org.apache.ignite.transactions.TransactionState.*; "NonPrivateFieldAccessedInSynchronizedContext", "TooBroadScope", "FieldAccessedSynchronizedAndUnsynchronized"}) public abstract class GridCacheMapEntry implements GridCacheEntryEx { /** */ - private static final sun.misc.Unsafe UNSAFE = GridUnsafe.unsafe(); - - /** */ private static final byte IS_DELETED_MASK = 0x01; /** */ @@ -292,13 +289,43 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx { /** {@inheritDoc} */ @Override public int memorySize() throws IgniteCheckedException { - int extrasSize; - - synchronized (this) { - extrasSize = extrasSize(); - } - - return SIZE_OVERHEAD + extrasSize; +// TODO IGNITE-51 +// byte[] kb; +// GridCacheValueBytes vb; +// +// CacheObject v; +// +// int extrasSize; +// +// synchronized (this) { +// kb = keyBytes; +// vb = valueBytesUnlocked(); +// +// v = val; +// +// extrasSize = extrasSize(); +// } +// +// if (kb == null || (vb.isNull() && v != null)) { +// if (kb == null) +// kb = CU.marshal(cctx.shared(), key); +// +// if (vb.isNull()) +// vb = (v != null && v instanceof byte[]) ? GridCacheValueBytes.plain(v) : +// GridCacheValueBytes.marshaled(CU.marshal(cctx.shared(), v)); +// +// synchronized (this) { +// if (keyBytes == null) +// keyBytes = kb; +// +// // If value didn't change. +// if (!isOffHeapValuesOnly() && valBytes == null && val == v && cctx.config().isStoreValueBytes()) +// valBytes = vb.isPlain() ? null : vb.get(); +// } +// } +// +// return SIZE_OVERHEAD + extrasSize + kb.length + (vb.isNull() ? 0 : vb.get().length); + return 0; } /** {@inheritDoc} */