An assembly cache manages a list of readable environments and a single writable environment. The first ones represent the recalled assemblies which form the cache. Any write attempt to the cache will fill in the current writable environment and its assembly, and as soon as this is full it will be encrypted and extracted to chunks. A fresh assembly is then created in the writable environment.
The AssemblyCache has access to KeyListStore, FileinformationStore, and FBlockListStore for requesting encryption keys or depositing new ones, or adding file information and blocks as they are written or read.
Internally, the AssemblyCache manages two queues, one for writing blocks and one for reading blocks.
- initialisation of the assembly cache
- repeating enqueueing of write requests
- when the assembly is full, then it's encrypted and extracted to chunks
- at the end, the assembly cache is flushed and the currently open EnvironmentWritable's assembly encrypted and extracted to chunks.
- initialisation of the assembly cache
- repeating enqueueing of read requests
- when the queue is full, then the requests are executed in batches
- ensure the assembly is loaded: either in the cache, or needs recall from chunks
- read the requested blocks from the assembly, probably in parallel
- at the end, the assembly cache is simply closed and its resources released