Class OutboxStagingFileSystem

java.lang.Object
at.aimon.memory.postgres.internal.OutboxStagingFileSystem
All Implemented Interfaces:
at.aimon.core.filesystem.VirtualFileSystem, AutoCloseable

public final class OutboxStagingFileSystem extends Object implements at.aimon.core.filesystem.VirtualFileSystem
Internal in-memory VirtualFileSystem used by KnowledgeStoreOutboxRelay to ferry outbox payloads into KnowledgeStore.reindex(at.aimon.core.knowledge.KnowledgeScope, at.aimon.core.knowledge.KnowledgeSource, at.aimon.core.knowledge.IndexOptions) calls.

This is a copy of the design implemented by at.aimon.core.memory.index.StagingFileSystem (which is package-private and therefore not reusable across modules). Only the subset of operations actually invoked by KeywordKnowledgeStore during indexing is implemented (write-string via put(java.lang.String, java.lang.String), read, list, listRecursive, isDirectory). Every other method throws UnsupportedOperationException on purpose — this is not a general-purpose VFS, it is private plumbing.

Each relay uses a fresh instance per row so concurrent reindex calls do not trample each other. The staging directory layout matches KnowledgeStoreObservationIndex: /observations/{subjectKey}/{localId}.txt.

  • Constructor Details

    • OutboxStagingFileSystem

      public OutboxStagingFileSystem()
  • Method Details

    • put

      public void put(String path, String content)
      Stages a UTF-8 encoded payload at the given path.
      Parameters:
      path - absolute VFS path (must not be null)
      content - payload (must not be null)
    • read

      public InputStream read(String path)
      Specified by:
      read in interface at.aimon.core.filesystem.VirtualFileSystem
    • exists

      public boolean exists(String path)
      Specified by:
      exists in interface at.aimon.core.filesystem.VirtualFileSystem
    • isDirectory

      public boolean isDirectory(String path)
      Specified by:
      isDirectory in interface at.aimon.core.filesystem.VirtualFileSystem
    • list

      public List<String> list(String directory)
      Specified by:
      list in interface at.aimon.core.filesystem.VirtualFileSystem
    • listRecursive

      public List<String> listRecursive(String directory)
      Specified by:
      listRecursive in interface at.aimon.core.filesystem.VirtualFileSystem
    • openInputStream

      public InputStream openInputStream(String path)
      Specified by:
      openInputStream in interface at.aimon.core.filesystem.VirtualFileSystem
    • getWorkingDirectory

      public String getWorkingDirectory()
      Specified by:
      getWorkingDirectory in interface at.aimon.core.filesystem.VirtualFileSystem
    • initialize

      public void initialize()
      Specified by:
      initialize in interface at.aimon.core.filesystem.VirtualFileSystem
    • getStatus

      public at.aimon.core.filesystem.BackendStatus getStatus()
      Specified by:
      getStatus in interface at.aimon.core.filesystem.VirtualFileSystem
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface at.aimon.core.filesystem.VirtualFileSystem
    • write

      public void write(String path, InputStream content, long contentLength)
      Specified by:
      write in interface at.aimon.core.filesystem.VirtualFileSystem
    • delete

      public void delete(String path)
      Specified by:
      delete in interface at.aimon.core.filesystem.VirtualFileSystem
    • getMetadata

      public at.aimon.core.filesystem.FileMetadata getMetadata(String path)
      Specified by:
      getMetadata in interface at.aimon.core.filesystem.VirtualFileSystem
    • copy

      public void copy(String sourcePath, String destinationPath, boolean overwrite)
      Specified by:
      copy in interface at.aimon.core.filesystem.VirtualFileSystem
    • move

      public void move(String sourcePath, String destinationPath, boolean overwrite)
      Specified by:
      move in interface at.aimon.core.filesystem.VirtualFileSystem
    • openOutputStream

      public OutputStream openOutputStream(String path)
      Specified by:
      openOutputStream in interface at.aimon.core.filesystem.VirtualFileSystem