Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/CacheManager.Core/BaseCacheManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private BaseCacheManager(string name, ICacheManagerConfiguration configuration,
handle.OnCacheSpecificRemove += (sender, args) =>
{
// added sync for using backplane with in-memory caches on cache specific removal
// but commented for now, this is not really needed if all instances use the same expiration etc, would just cause dublicated events
// but commented for now, this is not really needed if all instances use the same expiration etc, would just cause duplicated events
////if (_cacheBackplane != null && handle.Configuration.IsBackplaneSource && !handle.IsDistributedCache)
////{
//// if (string.IsNullOrEmpty(args.Region))
Expand All @@ -125,7 +125,7 @@ private BaseCacheManager(string name, ICacheManagerConfiguration configuration,
EvictFromHandlesAbove(args.Key, args.Region, handleIndex);
}

// moving down below cleanup, optherwise the item could still be in memory
// moving down below cleanup, otherwise the item could still be in memory
TriggerOnRemoveByHandle(args.Key, args.Region, args.Reason, handleIndex + 1, args.Value);
};

Expand Down Expand Up @@ -733,16 +733,16 @@ private void RegisterCacheBackplane(CacheBackplane backplane)
if (_cacheHandles.Any(p => p.Configuration.IsBackplaneSource))
{
// added includeSource param to get the handles which need to be synced.
// in case the backplane source is non-distributed (in-memory), only remotly triggered remove and clear should also
// trigger a sync locally. For distribtued caches, we expect that the distributed cache is already the source and in sync
// as that's the layer which triggered the event. In this case, only other in-memory handles above the distribtued, would be synced.
var handles = new Func<bool, BaseCacheHandle<TCacheValue>[]>((includSource) =>
// in case the backplane source is non-distributed (in-memory), only remotely triggered remove and clear should also
// trigger a sync locally. For distributed caches, we expect that the distributed cache is already the source and in sync
// as that's the layer which triggered the event. In this case, only other in-memory handles above the distributed, would be synced.
var handles = new Func<bool, BaseCacheHandle<TCacheValue>[]>((includeSource) =>
{
var handleList = new List<BaseCacheHandle<TCacheValue>>();
foreach (var handle in _cacheHandles)
{
if (!handle.Configuration.IsBackplaneSource ||
(includSource && handle.Configuration.IsBackplaneSource && !handle.IsDistributedCache))
(includeSource && handle.Configuration.IsBackplaneSource && !handle.IsDistributedCache))
{
handleList.Add(handle);
}
Expand Down
4 changes: 2 additions & 2 deletions src/CacheManager.Core/ExpirationMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public enum ExpirationMode
{
/// <summary>
/// Default value for the expircation mode enum.
/// Default value for the expiration mode enum.
/// CacheManager will default to <c>None</c>. The <code>Default</code> entry in the enum is used as separation from the other values
/// and to make it possible to explicitly set the expiration to <c>None</c>.
/// </summary>
Expand All @@ -28,4 +28,4 @@ public enum ExpirationMode
/// </summary>
Absolute = 3
}
}
}
2 changes: 1 addition & 1 deletion src/CacheManager.Core/ICacheManagerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace CacheManager.Core
{
/// <summary>
/// The writable configuration contract used primarrily internal only
/// The writable configuration contract used primarily internal only
/// </summary>
public interface ICacheManagerConfiguration : IReadOnlyCacheManagerConfiguration
{
Expand Down
2 changes: 1 addition & 1 deletion src/CacheManager.Core/Internal/BackplaneMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public byte[] ReadBytes(int length)
throw new IndexOutOfRangeException("Cannot read bytes, no additional bytes available.");
}

// fix: length check before aloc
// fix: length check before alloc
var result = new byte[length];
Buffer.BlockCopy(_data, pos - length, result, 0, length);
return result;
Expand Down
12 changes: 6 additions & 6 deletions src/CacheManager.Core/Internal/CacheEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public CacheActionEventArgs(string key, string region)
/// </summary>
/// <param name="key">The key.</param>
/// <param name="region">The region.</param>
/// <param name="origin">The origin the event occurred. If remote, the event got triggered by the backplane and was not actually excecuted locally.</param>
/// <param name="origin">The origin the event occurred. If remote, the event got triggered by the backplane and was not actually executed locally.</param>
/// <exception cref="System.ArgumentNullException">If key is null.</exception>
public CacheActionEventArgs(string key, string region, CacheActionEventArgOrigin origin)
: this(key, region)
Expand All @@ -153,7 +153,7 @@ public CacheActionEventArgs(string key, string region, CacheActionEventArgOrigin
public string Region { get; }

/// <summary>
/// Gets the event origin indicating if the event was triggered by a local action or remotly, through the backplane.
/// Gets the event origin indicating if the event was triggered by a local action or remotely, through the backplane.
/// </summary>
public CacheActionEventArgOrigin Origin { get; } = CacheActionEventArgOrigin.Local;

Expand All @@ -172,14 +172,14 @@ public sealed class CacheClearEventArgs : EventArgs
/// <summary>
/// Initializes a new instance of the <see cref="CacheClearEventArgs"/> class.
/// </summary>
/// <param name="origin">The origin the event occurred. If remote, the event got triggered by the backplane and was not actually excecuted locally.</param>
/// <param name="origin">The origin the event occurred. If remote, the event got triggered by the backplane and was not actually executed locally.</param>
public CacheClearEventArgs(CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
{
Origin = origin;
}

/// <summary>
/// Gets the event origin indicating if the event was triggered by a local action or remotly, through the backplane.
/// Gets the event origin indicating if the event was triggered by a local action or remotely, through the backplane.
/// </summary>
public CacheActionEventArgOrigin Origin { get; }

Expand All @@ -199,7 +199,7 @@ public sealed class CacheClearRegionEventArgs : EventArgs
/// Initializes a new instance of the <see cref="CacheClearRegionEventArgs"/> class.
/// </summary>
/// <param name="region">The region.</param>
/// <param name="origin">The origin the event occurred. If remote, the event got triggered by the backplane and was not actually excecuted locally.</param>
/// <param name="origin">The origin the event occurred. If remote, the event got triggered by the backplane and was not actually executed locally.</param>
/// <exception cref="System.ArgumentNullException">If region is null.</exception>
public CacheClearRegionEventArgs(string region, CacheActionEventArgOrigin origin = CacheActionEventArgOrigin.Local)
{
Expand All @@ -216,7 +216,7 @@ public CacheClearRegionEventArgs(string region, CacheActionEventArgOrigin origin
public string Region { get; }

/// <summary>
/// Gets the event origin indicating if the event was triggered by a local action or remotly, through the backplane.
/// Gets the event origin indicating if the event was triggered by a local action or remotely, through the backplane.
/// </summary>
public CacheActionEventArgOrigin Origin { get; }

Expand Down
4 changes: 2 additions & 2 deletions src/CacheManager.Core/Internal/SerializerCacheItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface ICacheItemConverter
{
/// <summary>
/// Converts the current instance to a <see cref="CacheItem{T}"/>.
/// The returned item must return the orignial created and last accessed date!
/// The returned item must return the original created and last accessed date!
/// </summary>
/// <typeparam name="TTarget">The type.</typeparam>
/// <returns>The cache item.</returns>
Expand Down Expand Up @@ -73,7 +73,7 @@ public SerializerCacheItem(ICacheItemProperties properties, object value)

/// <summary>
/// Gets or sets the expiration timeout in milliseconds.
/// Can be coverted from and to <see cref="TimeSpan"/>.
/// Can be converted from and to <see cref="TimeSpan"/>.
/// </summary>
[DataMember]
public abstract double ExpirationTimeout { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CacheManager.Serialization.DataContract
{
/// <summary>
/// The data contract cache item will be used to serialize a <see cref="CacheItem{T}"/>.
/// A <see cref="CacheItem{T}"/> cannot be derserialized by DataContractSerializer because of the private setters.
/// A <see cref="CacheItem{T}"/> cannot be deserialized by DataContractSerializer because of the private setters.
/// </summary>
[DataContract]
internal class DataContractCacheItem<T> : SerializerCacheItem<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace CacheManager.Serialization.Json
{
/// <summary>
/// Implements the <c>ICacheSerializer</c> contract using <c>Newtonsoft.Json</c> and the <see cref="GZipStream "/> loseless compression.
/// Implements the <c>ICacheSerializer</c> contract using <c>Newtonsoft.Json</c> and the <see cref="GZipStream "/> lossless compression.
/// </summary>
public class GzJsonCacheSerializer : JsonCacheSerializer
{
Expand Down
4 changes: 2 additions & 2 deletions src/CacheManager.StackExchange.Redis/RedisCacheBackplane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public RedisCacheBackplane(ICacheManagerConfiguration configuration, ILoggerFact
RetryHelper.Retry(() => Subscribe(), configuration.RetryTimeout, configuration.MaxRetries, _logger);

// adding additional timer based send message invoke (shouldn't do anything if there are no messages,
// but in really rare race conditions, it might happen messages do not get send if SendMEssages only get invoked through "NotifyXyz"
// but in really rare race conditions, it might happen messages do not get send if SendMessages only get invoked through "NotifyXyz"
_timer = new Timer(SendMessages, true, 1000, 1000);
}

Expand Down Expand Up @@ -232,7 +232,7 @@ private void SendMessages(object state)
// clearing up only after successfully sending. Basically retrying...
_messages.Clear();

// reset log limmiter because we just send stuff
// reset log limiter because we just send stuff
loggedLimitWarningOnce = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/CacheManager.StackExchange.Redis/RedisCacheHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ private bool SetNoScript(CacheItem<TCacheValue> item, When when, bool sync = fal

var setResult = _connection.Database.HashSet(fullKey, HashFieldValue, value, when, flags);

// setResult from fire and forget is alwys false, so we have to assume it works...
// setResult from fire and forget is always false, so we have to assume it works...
setResult = flags == CommandFlags.FireAndForget ? true : setResult;

if (setResult)
Expand Down
6 changes: 3 additions & 3 deletions src/CacheManager.StackExchange.Redis/RedisConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public RedisConfiguration()
/// <param name="keyspaceNotificationsEnabled">Enables keyspace notifications to react on eviction/expiration of items.</param>
/// <param name="twemproxyEnabled">Enables Twemproxy mode.</param>
/// <param name="strictCompatibilityModeVersion">
/// Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager.
/// Gets or sets a version number to eventually reduce the available features accessible by cachemanager.
/// </param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "Using it for configuration data only.")]
public RedisConfiguration(
Expand Down Expand Up @@ -101,7 +101,7 @@ public RedisConfiguration(
/// <param name="database">The redis database to use.</param>
/// <param name="keyspaceNotificationsEnabled">Enables keyspace notifications to react on eviction/expiration of items.</param>
/// <param name="strictCompatibilityModeVersion">
/// Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager.
/// Gets or sets a version number to eventually reduce the available features accessible by cachemanager.
/// </param>
public RedisConfiguration(
string key,
Expand Down Expand Up @@ -146,7 +146,7 @@ private ConfigurationOptions CreateConfigurationOptions()
public ConfigurationOptions ConfigurationOptions => _configurationOptions;

/// <summary>
/// Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager.
/// Gets or sets a version number to eventually reduce the available features accessible by cachemanager.
/// E.g. set this to <c>"2.4"</c> to disable LUA support.
/// </summary>
/// <remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class RedisConfigurationBuilderExtensions
/// </summary>
/// <param name="part">The builder instance.</param>
/// <param name="configurationKey">
/// The configuration key which can be used to refernce this configuration by a redis cache handle or backplane.
/// The configuration key which can be used to reference this configuration by a redis cache handle or backplane.
/// </param>
/// <param name="configuration">The redis configuration object.</param>
/// <returns>The configuration builder.</returns>
Expand All @@ -35,7 +35,7 @@ public static ConfigurationBuilderCachePart WithRedisConfiguration(this Configur
/// </summary>
/// <param name="part">The builder instance.</param>
/// <param name="configurationKey">
/// The configuration key which can be used to refernce this configuration by a redis cache handle or backplane.
/// The configuration key which can be used to reference this configuration by a redis cache handle or backplane.
/// </param>
/// <param name="connectionString">The redis connection string.</param>
/// <param name="database">The redis database to be used.</param>
Expand Down Expand Up @@ -63,7 +63,7 @@ public static ConfigurationBuilderCachePart WithRedisConfiguration(this Configur
/// </summary>
/// <param name="part">The builder instance.</param>
/// <param name="configurationKey">
/// The configuration key which can be used to refernce this configuration by a redis cache handle or backplane.
/// The configuration key which can be used to reference this configuration by a redis cache handle or backplane.
/// </param>
/// <param name="redisClient">The connection multiplexer instance.</param>
/// <param name="database">The redis database to use for caching.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public RedisValueConverter(ICacheSerializer serializer)

long IRedisValueConverter<long>.FromRedisValue(RedisValue value, string valueType) => (long)value;

// ulong can exceed the supported lenght of storing integers (which is signed 64bit integer)
// ulong can exceed the supported length of storing integers (which is signed 64bit integer)
// also, even if we do not exceed long.MaxValue, the SA client stores it as double for no aparent reason => cast to long fixes it.
RedisValue IRedisValueConverter<ulong>.ToRedisValue(ulong value) => value > long.MaxValue ? (RedisValue)value.ToString() : checked((long)value);

Expand Down
6 changes: 3 additions & 3 deletions test/CacheManager.Tests/CacheManagerEventsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ public void Events_OnClearRegion<T>(T cache)
cache.OnClear += (sender, args) => data.AddCall(); // this should not trigger
cache.OnGet += (sender, args) => data.AddCall(args, key1, key2); // this should not trigger

// on remove now triggeres per cache handle eventually
// on remove now triggers per cache handle eventually
cache.OnRemove += (sender, args) => data.AddCall(args, key1, key2); // this should not trigger
cache.Put(key1, "something", region1);
cache.Put(key2, "something", region2);
Expand Down Expand Up @@ -1045,7 +1045,7 @@ public void Events_MockedCustomRemove_TestMultiLevelA()
level = args.Level;
};

// tests if triggereing the first one really triggers the correct level
// tests if triggering the first one really triggers the correct level
var handle = cache.CacheHandles.OfType<CustomRemoveEventTestHandle>().First();
handle.TestTrigger("key", null, CacheItemRemovedReason.Expired, null);

Expand All @@ -1070,7 +1070,7 @@ public void Events_MockedCustomRemove_TestMultiLevelB()
level = args.Level;
};

// tests if triggereing the last one really triggers the correct level
// tests if triggering the last one really triggers the correct level
var handle = cache.CacheHandles.OfType<CustomRemoveEventTestHandle>().Last();
handle.TestTrigger("key", null, CacheItemRemovedReason.Expired, null);

Expand Down
2 changes: 1 addition & 1 deletion test/CacheManager.Tests/CacheManagerExpirationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ public void Expiration_DoesNotAcceptExpirationInThePast<T>(T cache)
}
}

// Issue #57 - Verifying diggits will be ignored and stored as proper milliseconds value (integer).
// Issue #57 - Verifying digits will be ignored and stored as proper milliseconds value (integer).
[Theory]
[ClassData(typeof(TestCacheManagers))]
public void Expiration_DoesNotBreak_OnVeryPreciseValue<T>(T cache)
Expand Down
Loading