Details

    • Sub-task
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • sprint-2
    • cache
    • None

    Description

      1. Need to introduce interface CacheObject and KeyCacheObject that will hide the implementation details of cached object representation.
        public interface CacheObject {
            public <T> T value(GridCacheContext ctx);
            public <T> T getField(String name);
            public byte[] valueBytes();
        }
        
        public interface KeyCacheObject extends CacheObject {
            public int hashCode();
        }
        

        Implementation of this class must always store serialized form of the object and should be optionally store deserialized form of the object if copyOnGet is false. Cache object must never keep the original reference of the user object.

      2. Internal cache API should use CacheObject exclusively and wrap/unwrap it to/from user objects on the very top-level-proxy level (unwrap is for sure, wrap is subject to discuss).
      3. Inside GridCacheMapEntry fields key, keyBytes, value and valueBytes should be replaced with corresponding CacheObject references for key and value.
      4. Same goes for other cache classes that were using keys, values or thereof bytes implicitly (IgniteTxEntry, GridCacheEntryInfo, etc)
      5. Transformation of user object to a cache object in Ignite should be implemented in GridPortableProcessor which should be renamed to IgniteCacheObjectProcessor. IgniteCacheSerializarionManager should be removed.
      6. Marshalling of CacheObject should take advantage of portable marshalling mechanism and always use only the serialized bytes stored in the CacheObject. In current implementation CacheObjectImpl should extend MessageAdapter (UPDATE WILL FOLLOW).
      7. storeValueBytes flag should be removed from configuration.
      8. binaryEquality flag should be introduced to cache configuration (default true). When true, cache keys should not be deserialized and binary form of the object altogether with the hash code should be used to check key equality. GridCacheConcurrentMap should work explicitly with CacheObject only.
      9. copyOnGet flag should be added to cache configuration (default true). When true, new value should be deserialized and returned to user on each cache operation implying return value. Ignite should maintain a list of known immutable types (such as Integer, String) for which copyOnGet is ignored. New annotation @IgniteImmutable should be introduced to mark immutable types for which this flag is also ignored.
      10. When indexing is enabled, CacheObject should always keep deserialized version of user object. getField() method should be used in indexing to obtain indexed fields via reflection. getField() should maintain necessary reflection cache to keep current performance level. See IgniteH2Indexing for details.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sboikov Semen Boikov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: