Enum CacheMode

    • Enum Constant Detail

      • REPLICATED

        public static final CacheMode REPLICATED
        Specifies fully replicated cache behavior. In this mode all the keys are distributed to all participating nodes. User still has affinity control over subset of nodes for any given key via AffinityFunction configuration.
      • PARTITIONED

        public static final CacheMode PARTITIONED
        Specifies partitioned cache behaviour. In this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes. User has affinity control over key assignment via AffinityFunction configuration.

        Note that partitioned cache is always fronted by local 'near' cache which stores most recent data. You can configure the size of near cache via NearCacheConfiguration.getNearEvictionPolicyFactory() configuration property.

    • Method Detail

      • values

        public static CacheMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CacheMode c : CacheMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CacheMode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • code

        public byte code()
        Returns:
        Cache mode code.
      • fromCode

        @Nullable
        public static @Nullable CacheMode fromCode​(int code)
        Efficiently gets enumerated value from its code.
        Parameters:
        code - Code.
        Returns:
        Enumerated value or null if an out of range.
      • toCode

        public static byte toCode​(@Nullable
                                  @Nullable CacheMode mode)
        Parameters:
        mode - Cache mode.
        Returns:
        Cache mode code.