Vixen
02b45cc4
csharp
public sealed class FileOdbBackend

Loose files under a virtual directory, one per chunk. The edit-time backend.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A chunk lands at <root>/ab/cdef… — the first byte of the id as a directory, the rest as the file name. That is git's layout and it is here for git's reason: a project accumulates hundreds of thousands of artefacts, and a directory with all of them in it is slow to enumerate on every filesystem and unusable on some.

Writes are skipped when the file already exists. Content addressing means an existing file with that name holds exactly those bytes, so rewriting it is work with no effect — and at edit time, where most of a reimport produces artefacts identical to the last one, that is most of the writes.

Fields and properties (2)

  • public bool IsReadOnly

    Whether this backend refuses writes.

  • public VirtualPath Root

    Where the chunks live.

Methods (6)

  • public FileOdbBackend(VirtualFileSystem files, VirtualPath root, bool isReadOnly = false)

    Serves chunks from a virtual directory.

  • public bool Exists(ObjectId id)

    Whether a chunk is here.

  • public bool TryRead(ObjectId id, out IOdbBlob? blob)

    Reads a chunk.

  • public bool Write(ObjectId id, ReadOnlySpan<byte> blob)

    Stores a chunk.

  • public bool Delete(ObjectId id)

    Removes a chunk.

  • public IEnumerable<ObjectId> Enumerate()

    Every chunk here, in id order.

Used by (21)

  • ContentAddressablesRemote
  • AssetMaterialSourceTestsVixen.Engine.Renderer.Tests
  • AssetTextureSourceTestsVixen.Engine.Renderer.Tests
  • CompositorContentTestsVixen.Assets.Tests
  • ContentMountVixen.App.Hosting
  • ContentReferenceTestsVixen.Assets.Tests
  • LooseContentSourceVixen.Assets
  • ObjectDatabaseTestsVixen.Core.Serialization.Tests
  • ReferenceWorldVixen.Assets.Tests
  • RemoteWorldVixen.Assets.Tests
  • StreamedContentTestsVixen.Assets.Tests
  • WorldVixen.Assets.Tests
  • WorldRendererTestsVixen.Engine.Renderer.Tests
  • ChunksVixen.Editor.Assets.Tests
  • ContentMountTestsVixen.App.Tests
  • ImportPipelineTestsVixen.Editor.Assets.Tests
  • LooseContentTestsVixen.Editor.Assets.Tests
  • PlannedProjectVixen.Editor.Assets.Tests
  • ProjectWorkspaceVixen.Editor.Assets
  • RemoteContentMountTestsVixen.App.Tests
  • StartupSceneTestsVixen.App.Tests