Skip to content

refactor(io)!: hide gocloud types in blobfs and gcs behind interfaces - #2635

Open
laskoviymishka wants to merge 3 commits into
apache:mainfrom
laskoviymishka:factory/blobfs-hide-gocloud-types
Open

laskoviymishka wants to merge 3 commits into
apache:mainfrom
laskoviymishka:factory/blobfs-hide-gocloud-types

Conversation

@laskoviymishka

@laskoviymishka laskoviymishka commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

blobfs.New now returns a blobfs.FileIO interface instead of a struct embedding *blob.Bucket, so gocloud methods are no longer reachable from the return value. The interface lists the iceberg-go io interfaces the struct already implemented, plus io.Closer, since callers and the REST catalog close the IO. The struct is unexported and still embeds the bucket, following the shape on the issue. NewWriter, Writer and gcs.ParseGCSConfig exposed gocloud types and had no outside callers, so they are unexported too. blobfs.New still takes a *blob.Bucket; that stays as is.

There is no behavior change and no new tests. The compile-time assertions in blobfs and the hadoop catalog cover the new interface, and the azure and REST tests were moved to it. apidiff on blobfs and gcs reports only the FileIO/New type change and the removal of Writer and ParseGCSConfig. A compatibility note is added to releases.md.

Part of #2062.

AI-assisted, reviewed by a human.

blobfs.New returned a struct embedding *blob.Bucket, so every gocloud
bucket method was part of our API. The struct is now unexported and New
returns a FileIO interface made of the iceberg-go io interfaces it already
implemented, plus io.Closer so callers can still close the bucket. The
struct keeps embedding *blob.Bucket, as agreed on the issue.

NewWriter and Writer exposed *blob.WriterOptions and *blob.Writer and
gcs.ParseGCSConfig returned *gcsblob.Options. None had callers outside
their package, so they are unexported. blobfs.New still takes a
*blob.Bucket on purpose.

No behavior change. The hadoop catalog assertion and the azure and rest
tests now use the interface, and releases.md gets a compatibility note.

Part of apache#2062.

Signed-off-by: laskoviymishka <laskoviymishka@gmail.com>
Signed-off-by: laskoviymishka <laskoviymishka@gmail.com>
@laskoviymishka
laskoviymishka marked this pull request as ready for review November 18, 2026 13:36
Signed-off-by: laskoviymishka <laskoviymishka@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant