-
Notifications
You must be signed in to change notification settings - Fork 42
Add TryQueryOffset API #413
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
Conversation
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
@bangjiehan Better late than never :) WDYT? |
Thank you for trying to improve this API. TryQueryOffset could be implemented without throwing any Exception at all. Maybe put actual implementation in TryQueryOffset(exception-free, of course) and reimplement QueryOffset by wrapping TryQueryOffset(if returned value is null, thrown exception to maintain old behavior). I found StreamStats.FirstOffset() and StreamStats.CommittedChunkId() have similar issue. |
Thank you @bangjiehan So you would do: try
{
var qOffset = await QueryOffset(reference, stream).ConfigureAwait(false);
return qOffset;
}
catch (Exception)
{
return null;
} Isn't that misleading? I mean, any Exception? About QueryOffset and TryQueryOffset I have to leave both the API for at least a reasonable time |
I can't remove these API I can Add other API(s) with TryFirstOffset and TryCommittedChunkId thank you for let me know |
Signed-off-by: Gabriele Santomaggio <[email protected]>
@bangjiehan ok now @lukebakken WDYT? |
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
Signed-off-by: Gabriele Santomaggio <[email protected]>
@Gsantomaggio My original intention is below:
These codes just to convey my intention and it still just a workaround I think. Maybe, QueryOffsetResponse should treat 'offset not exist' as one of its results in the end. |
Signed-off-by: Gabriele Santomaggio <[email protected]>
@bangjiehan makes more sense now! I will merge thank you |
Closes: #370