java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.SerializerCache

public final class SerializerCache extends Object
Simple cache object that allows for doing 2-level lookups: first level is by "local" read-only lookup Map (used without locking) and second backup level is by a shared modifiable HashMap. The idea is that after a while, most serializers are found from the local Map (to optimize performance, reduce lock contention), but that during buildup we can use a shared map to reduce both number of distinct read-only maps constructed, and number of serializers constructed.

Cache contains three kinds of entries, based on combination of class pair key. First class in key is for the type to serialize, and second one is type used for determining how to resolve value type. One (but not both) of entries can be null.

  • Field Details

    • DEFAULT_MAX_CACHED

      public static final int DEFAULT_MAX_CACHED
      By default, allow caching of up to 4000 serializer entries (for possibly up to 1000 types; but depending access patterns may be as few as half of that).
      See Also:
  • Constructor Details

    • SerializerCache

      public SerializerCache()
    • SerializerCache

      public SerializerCache(int maxCached)
  • Method Details