Class AtomicFilesystemStore

  • All Implemented Interfaces:
    dev.zarr.zarrjava.store.Store, dev.zarr.zarrjava.store.Store.ListableStore

    public final class AtomicFilesystemStore
    extends Object
    implements dev.zarr.zarrjava.store.Store.ListableStore
    A zarr-java Store that writes every key atomically: data is written to a temporary sibling file and then renamed into place (ATOMIC_MOVE where supported). This ensures an out-of-process reader concurrently scanning the dataset never observes a half-written chunk or zarr.json — a requirement for graceful read-while-write.

    Reads, listing and deletion are delegated to a plain FilesystemStore rooted at the same path, so file-layout semantics are identical. Only set is made atomic.

    • Constructor Detail

      • AtomicFilesystemStore

        public AtomicFilesystemStore​(Path root)
    • Method Detail

      • exists

        public boolean exists​(String[] keys)
        Specified by:
        exists in interface dev.zarr.zarrjava.store.Store
      • get

        public ByteBuffer get​(String[] keys)
        Specified by:
        get in interface dev.zarr.zarrjava.store.Store
      • get

        public ByteBuffer get​(String[] keys,
                              long start)
        Specified by:
        get in interface dev.zarr.zarrjava.store.Store
      • get

        public ByteBuffer get​(String[] keys,
                              long start,
                              long end)
        Specified by:
        get in interface dev.zarr.zarrjava.store.Store
      • delete

        public void delete​(String[] keys)
        Specified by:
        delete in interface dev.zarr.zarrjava.store.Store
      • list

        public Stream<String> list​(String[] keys)
        Specified by:
        list in interface dev.zarr.zarrjava.store.Store.ListableStore
      • resolve

        public dev.zarr.zarrjava.store.StoreHandle resolve​(String... keys)
        Specified by:
        resolve in interface dev.zarr.zarrjava.store.Store
      • set

        public void set​(String[] keys,
                        ByteBuffer value)
        Specified by:
        set in interface dev.zarr.zarrjava.store.Store