Skip to content

HDDS-7419. Integrate the GetKeyInfo API to OFS#1

Closed
duongkame wants to merge 48 commits intoHDDS-7231from
HDDS-7419
Closed

HDDS-7419. Integrate the GetKeyInfo API to OFS#1
duongkame wants to merge 48 commits intoHDDS-7231from
HDDS-7419

Conversation

@duongkame
Copy link
Owner

What changes were proposed in this pull request?

Problem

The target of this task is to deprecate the LookupFile interface and use GetKeyInfo for the OFS use case.

The gap between OFS and object storage use cases (like S3) is that due to a file system nature, OFS has to answer the file read requests from its client. A file read input is a file path and OFS needs to be able to decide if the given path is a valid file. To be specific, if the given path is not a file (but a directory), OFS should return an error. Reading empty files is a valid use case.

// throws IOException if the given path is not a file.
FileSystem.open(path)

The lookupKey API returns the same content for an empty file and directory.

Today, this is solved in Ozone by the separated lookupFile API, detecting if the given key is a directory and throwing an error on server-side.

throw new OMException(ResultCodes.NOT_A_FILE);

GetKeyInfo replaces lookupKey and inherits the same limit.

Solution

To make GetKeyInfo available for OFS, we can simply add to its response a field indicating if the key represents a directory or a file so that OFS client code can make the assertion.

https://issues.apaceorg/jira/browse/HDDS-7419

How was this patch tested?

OFS integration test.

captainzmc and others added 30 commits October 19, 2022 15:26
…d which meets specific test requirements (apache#3754)"

This reverts commit e45f9b8.
… SCM when converting an unsecure cluster to secure (apache#3859)
Co-authored-by: SaketaChalamchala <schalamchala@cloudera.com>
@duongkame
Copy link
Owner Author

duongkame commented Oct 27, 2022

@kerneltime This is an early review of OFS integration. Would be nice if you can have a look. I'll change the PR destination when HDDS-7231 is merged.

@duongkame
Copy link
Owner Author

Immediate PR closed, moved to apache#3912.

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.