Mesh single-file helpers: delete the second reader, the older catalog layout and the lock-free replace
Deletes CultMesh's ReadSingleFileSnapshot, HasOlderCatalogLayout, ReadLegacySchemaCatalogEntry, WriteFileAtomically and the File.Exists gate, ReadStore's entry-reader delegate, and the three tests of the older catalog layout. This commit does not build: the Mesh read and write sites still name the deleted reader; the next commit routes them through the CultCache single-file store. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
245b0619b4
commit
2e12e9eebb
4 changed files with 4 additions and 193 deletions
|
|
@ -2585,34 +2585,6 @@ public sealed class CultMeshStreamingTests
|
|||
cache.Get<MeshPublicationNoteDocument>(key)!.Text.Should().Be("published-directly");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SingleFileDocumentHelpers_ReadLegacySingleDocumentSnapshots()
|
||||
{
|
||||
using var directory = new TemporaryDirectory();
|
||||
var filePath = Path.Combine(directory.Path, "legacy-single-document.ccmp");
|
||||
var key = new CultRecordKey("mesh-note:legacy-single-document");
|
||||
var descriptor = CultDocumentRegistry.Shared.GetRequired<MeshPublicationNoteDocument>();
|
||||
var payload = CultDocumentMessagePackSerialization.SerializeUntyped(new MeshPublicationNoteDocument
|
||||
{
|
||||
Schema = "tests.mesh_publication_note.v1",
|
||||
Text = "legacy-published",
|
||||
Revision = 4
|
||||
}, typeof(MeshPublicationNoteDocument));
|
||||
|
||||
File.WriteAllBytes(filePath, WriteLegacySingleDocumentSnapshot(
|
||||
key.Value,
|
||||
descriptor.SchemaId,
|
||||
descriptor.SchemaName,
|
||||
descriptor.SchemaVersion,
|
||||
"2026-06-27T12:00:00.0000000Z",
|
||||
payload));
|
||||
|
||||
var document = CultMesh.ReadSingleFileDocument<MeshPublicationNoteDocument>(filePath, key);
|
||||
|
||||
document.Text.Should().Be("legacy-published");
|
||||
document.Revision.Should().Be(4);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task DocumentHandle_ReadsRemotePeerSnapshotsAsTypedDocuments()
|
||||
{
|
||||
|
|
@ -3853,39 +3825,6 @@ public sealed class CultMeshStreamingTests
|
|||
ring.Stats().UnavoidableCopyCount.Should().Be(1);
|
||||
}
|
||||
|
||||
private static byte[] WriteLegacySingleDocumentSnapshot(
|
||||
string key,
|
||||
string schemaId,
|
||||
string schemaName,
|
||||
string schemaVersion,
|
||||
string storedAt,
|
||||
byte[] payload)
|
||||
{
|
||||
var buffer = new ArrayBufferWriter<byte>();
|
||||
var writer = new MessagePackWriter(buffer);
|
||||
|
||||
writer.WriteArrayHeader(3);
|
||||
writer.Write("cultcache.store.v1");
|
||||
writer.WriteArrayHeader(1);
|
||||
writer.WriteArrayHeader(7);
|
||||
writer.Write(schemaId);
|
||||
writer.Write(schemaName);
|
||||
writer.Write(schemaVersion);
|
||||
writer.Write("Legacy Aetheria single document");
|
||||
writer.Write(storedAt);
|
||||
writer.Write("legacy-hash");
|
||||
writer.WriteArrayHeader(0);
|
||||
writer.WriteArrayHeader(1);
|
||||
writer.WriteArrayHeader(4);
|
||||
writer.Write(key);
|
||||
writer.Write(schemaId);
|
||||
writer.Write(storedAt);
|
||||
writer.Write(payload);
|
||||
writer.Flush();
|
||||
|
||||
return buffer.WrittenSpan.ToArray();
|
||||
}
|
||||
|
||||
private static CultMeshStreamCatalog CatalogWithByteStream()
|
||||
{
|
||||
var catalog = CultMesh.CreateStreamCatalog();
|
||||
|
|
|
|||
Loading…
Reference in a new issue