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

Abierto
#9,316 3 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, cpp, csharp, java, nodejs, ocaml, python, ruby, rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
5.5k
Forks
869
Merge medio
8 h 2 min
PR fusionados (30 d)
862

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/opendal

Todos los issues de apache/opendal

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.