-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Introduce FS API #669
Conversation
IsDir bool | ||
Size int64 | ||
} | ||
|
There was a problem hiding this comment.
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)
}
return files, err | ||
} | ||
|
||
// Stat returns information about the file at path relative to the alloc dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at a
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. |
The following APIs has been introduced in the client -
@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)