Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce FS API #669

Merged
merged 18 commits into from
Jan 14, 2016
Merged

Introduce FS API #669

merged 18 commits into from
Jan 14, 2016

Conversation

diptanu
Copy link
Contributor

@diptanu diptanu commented Jan 13, 2016

The following APIs has been introduced in the client -

/v1/client/fs/ls/:alloc-id/?path=/path/relative/to/alloc/dir

/v1/client/fs/stat/:alloc-id/?path=/path/relative/to/alloc/dir

/v1/client/fs/readat/:alloc-id?path=/path/relative/to/alloc/dir&limit=K&offset=N

@armon These APIs currently don't do any forwarding because to forward the request, the Agent has to make two API calls to the server, first get the allocation for the alloc id and then another API call to get the node information from the node id of the allocation. So every API call is going to result into two API calls to the server.
Instead, the tools using the APIs could make the two calls to the server to determine the correct addr of the client on which the allocation is running and cache the information. And from there on keep making the API calls to the same client for the allocation. What you think? (It's easy to introduce forwarding if we want)

IsDir bool
Size int64
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add an interfacet:

type AllocDirFS interface {
    List(path string) ([]*allocdir.AllocFileInfo, error)
    Stat(path string) (*allocdir.AllocFileInfo, error)
    ReadAt(path string, offset int64, limit int64) (io.Reader, error)
}

diptanu added a commit that referenced this pull request Jan 14, 2016
@diptanu diptanu merged commit c947155 into master Jan 14, 2016
return files, err
}

// Stat returns information about the file at path relative to the alloc dir
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at a

@diptanu diptanu deleted the f-fs-api branch January 19, 2016 19:53
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants