Class CacheBuilder<TKey, TValue>
Provides custom construction of a ScaleOut Cache<TKey, TValue> instance.
public class CacheBuilder<TKey, TValue>
Type Parameters
TKey
TValue
- Inheritance
-
CacheBuilder<TKey, TValue>
- Inherited Members
Constructors
- CacheBuilder(string, GridConnection)
Initializes a new instance of the CacheBuilder class with default policies.
- CacheBuilder(string, GridConnection, IConfiguration)
Initializes a new instance of the CacheBuilder class, with initial settings provided by the supplied IConfiguration section. Pass a LegacyXmlConfiguration instance to signal the builder to use a legacy web.config/app.config file.
- CacheBuilder(uint, GridConnection)
Initializes a new instance of the CacheBuilder class with default policies.
- CacheBuilder(uint, GridConnection, IConfiguration)
Initializes a new instance of the CacheBuilder class, with initial settings provided by the supplied IConfiguration section. Pass a LegacyXmlConfiguration instance to signal the builder to use a legacy web.config/app.config file.
Properties
- BackingStoreEventInterval
Gets the default interval between backing store events (refresh-ahead, write-behind).
- BackingStoreMode
Gets the default policy for the objects' backing store event behavior. Default is None.
- CoherencyInterval
Gets the coherency interval for the cache.
- Deserializer
Gets the method used to deserialize objects in the cache.
- GeoServerCoherencyInterval
Gets how often GeoServer remote stores should refresh their proxies to objects in the cache if Poll is used with GeoServer pull replication.
- GeoServerCoherencyPolicy
Get the policy for how GeoServer remote stores should refresh their proxies to objects in the cache when GeoServer Pull replication is being used.
- GeoServerPullPolicy
Gets whether the cache should participate in GeoServer replication if the ScaleOut service is configured to use GeoServer pull replication. Default is Disabled.
- GeoServerPushPolicy
Gets whether the cache should participate in GeoServer replication if the ScaleOut service is configured to use GeoServer push replication. Default is AllowReplication.
- InvocationGridName
Gets the name of the invocation grid that can be used to handle Invoke and PostEventAsync(TKey, string, byte[], TimeSpan?) operations.
- KeyEncoder
Gets the custom KeyEncoder used to encode keys in the cache.
- KeystringCacheSize
Gets this size of the internal keystring cache for caches that use System.String as the
TKey
type parameter. Default is 10,000 items.
- LockRetryInterval
Gets the amount of time between polling attempts to acquire an exclusive lock on a cached object.
- LoggerFactory
Gets the ILoggerFactory to be used by the cache for logging
- Name
Gets the name of the cache being built.
- NetworkCacheSize
Gets the size (in bytes) of the in-process network cache that is used to return deep copies of objects. A value of zero indicates that the network cache is disabled.
- PreemptionPriority
Gets the PreemptionPriority for objects in the cache. Default is Normal.
- RemoteStores
Gets the list of remote store names that the cache will use to access remote objects using GeoServer Pro replication.
- Serializer
Gets the method used to serialize objects in the cache.
- Timeout
Gets the lifetime for the cache's objects in the ScaleOut service. A value of Zero indicates an infinite timeout.
- TimeoutType
Gets the timeout policy for the cache's objects in the ScaleOut service.
- UseServiceEventForReadThrough
Gets whether the cache will raise a read-through event in remote event-handling application when there's a cache miss.
- WriteThroughCallback
Gets a callback used to persist cache updates to a backing store.
Methods
- Build()
Builds a Cache<TKey, TValue> as specified by this CacheBuilder<TKey, TValue> instance.
- RaiseServiceEventForReadThrough()
Configures the cache to raise a read-through event in a remote event-handling application to populate the cache with an object in the event of a cache miss.
- SetBackingStoreEvent(TimeSpan, BackingStoreMode)
Sets the cache's default type of backing store event (refresh-ahead, write-behind) and the interval between events, with a minimum granularity of one second. Overrides the config file's setting for this cache.
- SetClientCache(ClientCache<TValue>)
Sets an in-process client cache implementation to be used by the cache. The config file's clientCacheEviction and clientCacheCapacity settings are ignored if a client cache instance is provided to this call. Pass null to disable the client cache.
- SetClientCache(string, int)
Sets in-process client cache policies for this cache. Overrides the config file's clientCacheEviction, clientCacheCapacity, and partitionCount settings for this cache. A single partition is used.
- SetClientCache(string, int, int)
Sets in-process client cache policies for this cache. Overrides the config file's clientCacheEviction, clientCacheCapacity, and partitionCount settings for this cache.
- SetCoherencyInterval(TimeSpan)
Sets the coherency interval for the client cache.
- SetGeoServerCoherencyInterval(TimeSpan)
Sets how often GeoServer remote stores should refresh their proxies to objects in the cache if Poll is used with GeoServer pull replication.
- SetGeoServerCoherencyPolicy(GeoServerCoherencyPolicy)
Set the policy for how GeoServer remote stores should refresh their proxies to objects in the cache when GeoServer Pull replication is being used. Default is NoAutoRefresh.
- SetGeoServerPullPolicy(GeoServerPullPolicy)
Configures whether the cache should participate in GeoServer replication if the ScaleOut service is configured to use GeoServer pull replication. Default is Disabled.
- SetGeoServerPushPolicy(GeoServerPushPolicy)
Configures whether the cache should participate in GeoServer replication if the ScaleOut service is configured to use GeoServer push replication. Default is AllowReplication.
- SetInvocationGridName(string)
Sets the name of the invocation grid to be used for handling Invoke and PostEventAsync(TKey, string, byte[], TimeSpan?) operations.
- SetKeyEncoder(KeyEncoder<TKey>)
Sets the class used by the cache for encoding keys.
- SetKeystringCacheSize(int)
Sets this size of the internal keystring cache for caches that use System.String as the
TKey
type parameter.
- SetLockRetryInterval(TimeSpan)
Sets the amount of time between polling attempts to acquire an exclusive lock on a cached object. Overrides the config file's exclusiveLockRetryIntervalMS setting for this cache.
- SetLoggerFactory(ILoggerFactory)
Sets an ILoggerFactory to be used by the cache instance for logging. Overrides the ILoggerFactory set via SetLoggerFactory(ILoggerFactory).
- SetNetworkCacheSize(long)
Sets the size (in bytes) of the in-process network cache that is used to return deep copies of objects, or zero to disable the network cache. Overrides the config file's networkCacheSizeBytes setting for this cache.
- SetObjectTimeout(TimeSpan, TimeoutType)
Sets the lifetime for the cache's objects in the ScaleOut service, with a minimum granularity of one second. Use Zero for an infinite timeout. Overrides the config file's timeout setting for this cache.
- SetPreemptionPriority(PreemptionPriority)
Sets the preemption priority for objects in the cache, which specifies whether the least recently accessed objects may be evicted when the ScaleOut service runs low on memory.
- SetRemoteStoreAccess(IList<string>)
Configures a list of remote stores that this cache should use to look for objects that are not found in the local store. Read calls will check remote stores in the order that they are listed. If a missing object is found in one of the specified remote stores then it will be replicated to the local store using GeoServer Pro replication.
- SetSerialization(Action<TValue, Stream>, Func<Stream, TValue>)
Sets the callbacks used to perform serialization/deserialization of objects in the cache.
- SetSerialization(Func<TValue, Stream, int>, Func<Stream, (TValue, int)>)
Sets the callbacks used to perform serialization/deserialization of objects in the cache. The methods return a user-defined memory usage estimate (in bytes) to improve the accuracy of memory usage in the in-process client cache.
- SetWriteThroughCallback(Action<TKey, TValue>)
Sets a callback used to persist cache updates to a backing store.