Skip to main content

A FUSE filesystem that mounts an Apache ZooKeeper tree as a local directory.

Project description

fusedzoo

A FUSE filesystem that mounts an Apache ZooKeeper tree as a local directory, backed by kazoo.

The dual znode model

ZooKeeper znodes are simultaneously containers (they have children) and data holders (they carry a byte payload). fusedzoo exposes both facets at once:

  • Every znode /a/b/c maps to a directory at the mountpoint.
  • The znode's data payload is exposed through a virtual file named .zk-data inside that directory.
/mnt/zk/
  my/
    favorite/          <- znode /my/favorite (ls to see children)
      .zk-data         <- read/write the node's raw byte payload
      node/            <- child znode /my/favorite/node
        .zk-data
Filesystem operation ZooKeeper operation
ls /mnt/zk/a/b get_children(/a/b)
cat /mnt/zk/a/b/.zk-data get(/a/b)
echo foo > /mnt/zk/a/b/.zk-data set(/a/b, b"foo")
mkdir /mnt/zk/a/b/c create(/a/b/c, b"")
rmdir /mnt/zk/a/b/c delete(/a/b/c) (if childless)

Node data is passed through as raw bytes with no encoding.

Installation

pip install fusedzoo            # default: fusepy (libfuse2) backend
pip install fusedzoo[pyfuse3]   # opt-in: pyfuse3 (libfuse3, async) backend

The host system needs libfuse installed (libfuse2 for the fusepy backend, libfuse3 for pyfuse3) and a usable /dev/fuse device.

Usage

fusedzoo mount localhost:2181 /mnt/zk   # mounts in the foreground
fusedzoo umount /mnt/zk

See fusedzoo mount --help for pool sizing, backend selection, read-only, and experimental poll options.

# Create a znode
mkdir /mnt/zk/services

# Write its payload
echo '{"host": "db1"}' > /mnt/zk/services/.zk-data

# Read it back
cat /mnt/zk/services/.zk-data

# Inspect ZooKeeper metadata as extended attributes
getfattr -d /mnt/zk/services

# Remove a childless znode
rmdir /mnt/zk/services

Note: df will not show fusedzoo in plain df -h because ZooKeeper has no filesystem capacity concept and the mount reports 0/0 blocks. Use df -h -a or df -h /mnt/zk to see it explicitly.

Development

hatch run release      # ruff + mypy + pytest --cov + hatch build (full gate)
hatch run dry_release  # same but non-blocking (continues on failure)
hatch run docs:build   # build Sphinx docs

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fusedzoo-0.1.0.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fusedzoo-0.1.0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file fusedzoo-0.1.0.tar.gz.

File metadata

  • Download URL: fusedzoo-0.1.0.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fusedzoo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b32b669ba22f99f83f25e733957c58797b861714a9f2f0fa5198eaa3b7abc11
MD5 0ae374ac9a0e5c10ed00abc7268e6ddb
BLAKE2b-256 275da1fe8e5a2a5b8c39ee8a172f0e7b709c18448058f3316569b220ec981d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for fusedzoo-0.1.0.tar.gz:

Publisher: ci.yml on ModdingFox/fusedzoo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fusedzoo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fusedzoo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fusedzoo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0c0ca36f73c628728aeb74197a60845efececbfcec3ddd290c3f51bba31cb66
MD5 d036b35209c15792c1170a83568d267b
BLAKE2b-256 4e64086ef1e0be8a5ac9f1601c5b52272f5d5273d04a1faac93c1c92cf3bf084

See more details on using hashes here.

Provenance

The following attestation bundles were made for fusedzoo-0.1.0-py3-none-any.whl:

Publisher: ci.yml on ModdingFox/fusedzoo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page