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

Aperta
#9,316 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, cpp, csharp, java, nodejs, ocaml, python, ruby, rust

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Rust
Stelle
5.5k
Fork
869
Merge medio
8h 2m
PR unite (30g)
862

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/opendal

Tutte le issue di apache/opendal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.