new feature: expose full-file checksum metadata and options in generated bindings

Open
#9,316 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, cpp, csharp, java, nodejs, ocaml, python, ruby, rust

Research direction

Start with dev/src/generate/metadata.rs, dev/src/generate/core_options.rs, and the checksum handling in dev/src/generate/java.rs, then compare them with the core types under core/core/src/types/. Run the existing binding-generation workflow and review the resulting mirrors. Done means generated bindings expose metadata checksum values and the agreed read, reader, stat, and write checksum options, with maintainer decisions documented for Python compatibility and write digests.

Written by the indexing model from the issue text.

Description

bindings/c bindings/cpp bindings/dotnet bindings/go bindings/java bindings/nodejs bindings/ocaml bindings/python bindings/ruby enhancement

Drafted with AI assistance and reviewed by the submitter.

Feature Description

Expose core's full-file checksum in the bindings: Metadata::checksum, the checksum hint on StatOptions, ReadOptions, and ReaderOptions, and WriteOptions::checksum (WriteChecksum).

Problem and Solution

Core is complete (#9182). dev/src/generate/metadata.rs marks checksum as binding-specific, so each binding maps Checksum itself. dev/src/generate/core_options.rs skips WriteOptions::checksum.

Binding state:

  • Python: stat(checksum=True) and Metadata.checksum as (algorithm, digest bytes) or None (#9328). write() and open() take checksum: ChecksumAlgorithm, which maps to WriteChecksum::Algo only (#9231).
  • .NET: forwards the ReadOptions and StatOptions hints. It has no Metadata checksum, so the hints have no visible effect.
  • Java: the JNI layer always sends checksum: false.
  • Other bindings: no checksum surface.

No core change is necessary. Each binding adds, in this order:

  1. A Metadata checksum: the algorithm name and the raw digest bytes, with the Python names (crc32c, crc64nvme, crc64ecma, md5, sha1, sha256).
  2. The stat hint.
  3. The write intent. If write() returns Metadata, the caller also gets the verified digest.

Skip the read and reader hints in a binding that has no reader metadata. The hint does not verify data, so it has no visible effect there.

Open question: does a binding expose Any, Fast, and Expected, or only Algo? #9231 deferred Expected until a caller needs it. Proposal for Python and Node.js: accept an algorithm name, "any", "fast", or an (algorithm, digest) value with the same shape as Metadata.checksum.

Progress
  • Python: (algorithm, digest) and "any" write intents (#9459)
  • Node.js: Metadata.checksum, the stat hint, and write intents (#9460)
  • Java
  • .NET: Metadata checksum (the read and stat hints exist)
  • C and Go (#9323)
  • C++ (#9324)
Additional Context

Related: #9182, #9231, #9328, #9320.

Are you willing to contribute to the development of this feature?
  • Yes, I am willing to contribute to the development of this feature.
Dominant language
Rust
Stars
5.5k
Forks
869
Avg merge
8h 2m
Merged PRs (30d)
862

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/opendal

All issues in apache/opendal

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.