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

[C#] Input-specific functions in IVariableLengthStruct #289

Closed
badrishc opened this issue Jul 23, 2020 · 4 comments · Fixed by #290
Closed

[C#] Input-specific functions in IVariableLengthStruct #289

badrishc opened this issue Jul 23, 2020 · 4 comments · Fixed by #290

Comments

@badrishc
Copy link
Contributor

In #270, we added an additional method to IVariableLengthStruct:

int GetLength<Input>(ref T t, ref Input input)

In addition, we already had this earlier:

int GetInitialLength<Input>(ref Input input)

With the moving of Input to client sessions (which is a huge improvement, btw), it is causing complications when users have sessions with different input types on the same FASTER store, as the above two functions cannot be typed specifically to a session.

The proposal would be to instead provide these two methods via ClientSession (internally, FasterSession) so that they may be customized per Input type.

CC @marius-klimantavicius as you authored the above-referenced PR and are in the best position to comment/contribute on this.

@badrishc
Copy link
Contributor Author

Also cc @mito-csod

@marius-klimantavicius
Copy link
Contributor

We could move out methods from IVariableLengthStruct to IFasterSession<...> what I am thinking about is how to handle Generic and Blittable cases (relatively easy to do) and how to allow the user to specify the required methods (without affecting fixed size cases). One idea is to have IVariableLengthStruct as is (or with <Input> methods removed) and introduce additional ISessionVariableLengthStruct (or similar, naming is difficult) which could be optionally provided when creating client session (for fixed sizes it would be either exception or not used).

@badrishc
Copy link
Contributor Author

badrishc commented Jul 25, 2020

Makes sense. We could introduce IVariableLengthStruct<T, TInput> that could be provided per session. If not provided, we would default to fall through to existing IVariableLengthStruct.

@badrishc
Copy link
Contributor Author

PR is out, will merge soon based on feedback if any.

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 a pull request may close this issue.

2 participants