Delete CultCache wrappers and unused members
Removes FlushBackingStore, both PrepareForReloadOrShutdown overloads, PullBackingStoreRecordsAsync, TryGet<T>, TryGetByName, TryGetByIndex, Resolve<T>, the cache and store Logger, and LastSuccessfulFlushAtUtc on the cache and stores. GetStoredDocuments<T> folds into GetAll<T>. The soft flag goes from FlushAllBackingStores, ExecuteTransactionAsync, CommitBatch and PushAll. It stays on FlushAsync(bool) because CultCacheStudioWindow reflects on that signature until Cut 6. CultMesh.FlushAsync and CultNetLocal.FlushAsync keep their parameter and stop forwarding it. The store's EntryAdded/EntryUpdated/EntryDeleted subjects become protected internal Loaded/Unloaded callbacks set by the cache at attach. AddStoredDocumentInternal is synchronous, so the GetAwaiter().GetResult() bridges on the store subscriptions and the global materializer are gone. Tests: drop the LastSuccessfulFlushAtUtc asserts; OpenAsync and GetAll tests read through Get/GetAll; the persisted-global test proves the durable global loads without staging a default instead of going through selective hydration; the lease-before-observers test observes through CultCache.Watch; the PullSelected selective-hydration test is deleted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
1982d73e44
commit
85f2089f0e
5 changed files with 55 additions and 316 deletions
|
|
@ -201,10 +201,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
}
|
||||
|
||||
Entries[pair.Key] = pair.Value;
|
||||
if (existing == null)
|
||||
EntryAdded.OnNext(pair.Value);
|
||||
else
|
||||
EntryUpdated.OnNext(pair.Value);
|
||||
Loaded?.Invoke(pair.Value);
|
||||
}
|
||||
|
||||
foreach (var removedKey in _hydratedKeys.Where(key => !loaded.ContainsKey(key)).ToArray())
|
||||
|
|
@ -213,7 +210,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
continue;
|
||||
|
||||
if (Entries.TryRemove(removedKey, out var removed))
|
||||
EntryDeleted.OnNext(removed);
|
||||
Unloaded?.Invoke(removed);
|
||||
_hydratedKeys.Remove(removedKey);
|
||||
}
|
||||
|
||||
|
|
@ -307,8 +304,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
/// <inheritdoc />
|
||||
public override void CommitBatch(
|
||||
IReadOnlyCollection<CultStoredDocument> upserts,
|
||||
IReadOnlyCollection<CultStoredDocument> deletes,
|
||||
bool soft)
|
||||
IReadOnlyCollection<CultStoredDocument> deletes)
|
||||
{
|
||||
lock (_mutationGate)
|
||||
{
|
||||
|
|
@ -331,7 +327,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
_deletedKeys.TryRemove(entry.Key.Value, out _);
|
||||
}
|
||||
IsDirty = true;
|
||||
PushAllCore(soft);
|
||||
PushAllCore();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -351,13 +347,13 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PushAll(bool soft = false)
|
||||
public override void PushAll()
|
||||
{
|
||||
lock (_mutationGate)
|
||||
PushAllCore(soft);
|
||||
PushAllCore();
|
||||
}
|
||||
|
||||
private void PushAllCore(bool soft)
|
||||
private void PushAllCore()
|
||||
{
|
||||
if (!IsDirty && !_needsIndexUpgrade)
|
||||
{
|
||||
|
|
@ -652,10 +648,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
continue;
|
||||
|
||||
Entries[pair.Key] = pair.Value;
|
||||
if (existing == null)
|
||||
EntryAdded.OnNext(pair.Value);
|
||||
else
|
||||
EntryUpdated.OnNext(pair.Value);
|
||||
Loaded?.Invoke(pair.Value);
|
||||
}
|
||||
|
||||
foreach (var missingKey in selectedKeys.Where(key => !loaded.ContainsKey(key)).ToArray())
|
||||
|
|
@ -663,7 +656,7 @@ public sealed class DirectoryMessagePackBackingStore : CacheBackingStore
|
|||
if (_dirtyKeys.ContainsKey(missingKey) || _deletedKeys.ContainsKey(missingKey))
|
||||
continue;
|
||||
if (Entries.TryRemove(missingKey, out var removed))
|
||||
EntryDeleted.OnNext(removed);
|
||||
Unloaded?.Invoke(removed);
|
||||
_hydratedKeys.Remove(missingKey);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue