-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Reduce number of get
method variants in ShardGetService
#122175
Conversation
ShardGetService contains multiple get*() methods with different visibility. One `getForUpdate` is only used in a test so it can be moved there. An `innerGet` private method is only called by the private get() method so it can be folded in there to remove one more undocumented `get` variant. A public `get` method is only used in TransportShardMultiGetAction so we can rename it to `mget` to avoid confusion with other `get`. Finally the private `get` is renamed to `doGet` to indicate it's an "inner" private method.
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
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.
LGTM! Looks much more intuitive now
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.
LGTM. Thanks for cleaning this 👍
@@ -131,7 +130,7 @@ public GetResult get( | |||
); | |||
} | |||
|
|||
private GetResult get( | |||
private GetResult doGet( |
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.
nit I see the rest of the class uses inner
instead of do
for private functions, feel free to see if renaming to innerGet
might be more conforming.
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 wanted to make a distinction with the other innerGetAndFetch method.
Thanks all |
ShardGetService contains multiple get*() methods
with different visibility.
One
getForUpdate
is only used in a test so itcan be moved there.
An
innerGet
private method is only called bythe private get() method so it can be folded in
there to remove one more undocumented
get
variant.
A public
get
method is only used inTransportShardMultiGetAction so we can rename
it to
mget
to avoid confusion with otherget
.Finally the private
get
is renamed todoGet
to indicate it's an "inner" private method.