/// <summary> /// Gets or creates near cache. /// </summary> private ICache <TK, TV> GetOrCreateNearCache0 <TK, TV>(string name, NearCacheConfiguration configuration, PlatformCacheConfiguration platformConfiguration, Op op) { IgniteArgumentCheck.NotNull(configuration, "configuration"); var cacheTarget = DoOutOpObject((int)op, w => { w.WriteString(name); configuration.Write(w); if (platformConfiguration != null) { w.WriteBoolean(true); platformConfiguration.Write(w); } else { w.WriteBoolean(false); } }); return(GetCache <TK, TV>(cacheTarget)); }
/** <inheritdoc /> */ public ICache <TK, TV> GetOrCreateNearCache <TK, TV>(string name, NearCacheConfiguration configuration, PlatformCacheConfiguration platformConfiguration) { return(GetOrCreateNearCache0 <TK, TV>(name, configuration, platformConfiguration, Op.GetOrCreateNearCache)); }
/// <summary> /// Gets or creates the cache. /// </summary> private ICache <TK, TV> GetOrCreateCache <TK, TV>(CacheConfiguration configuration, NearCacheConfiguration nearConfiguration, PlatformCacheConfiguration platformCacheConfiguration, Op op) { IgniteArgumentCheck.NotNull(configuration, "configuration"); IgniteArgumentCheck.NotNull(configuration.Name, "CacheConfiguration.Name"); configuration.Validate(Logger); var cacheTarget = DoOutOpObject((int)op, s => { var w = BinaryUtils.Marshaller.StartMarshal(s); configuration.Write(w); if (nearConfiguration != null) { w.WriteBoolean(true); nearConfiguration.Write(w); } else { w.WriteBoolean(false); } if (platformCacheConfiguration != null) { w.WriteBoolean(true); platformCacheConfiguration.Write(w); } else { w.WriteBoolean(false); } }); return(GetCache <TK, TV>(cacheTarget)); }
/** <inheritdoc /> */ public ICache <TK, TV> CreateCache <TK, TV>(CacheConfiguration configuration, NearCacheConfiguration nearConfiguration, PlatformCacheConfiguration platformCacheConfiguration) { return(GetOrCreateCache <TK, TV>(configuration, nearConfiguration, platformCacheConfiguration, Op.CreateCacheFromConfig)); }
public Caches(PlatformCacheConfiguration platformCacheConfiguration, CacheInitializerFacade cacheInitializer) { this.platformCacheConfiguration = platformCacheConfiguration; this.cacheInitializer = cacheInitializer; }