alluxio
alluxio copied to clipboard
Unify DefaultBlockWorkerClient with AbstractClient
What changes are proposed in this pull request?
Make DefaultBlockWorkerClient
extends from AbstractClient
Why are the changes needed?
- Address a todo issue in the codebase
- Reduce duplicated code
- Avoid doing the expensive connection when
DefaultBlockWorkerClient
is constructed, take advantage of the lazy connection mechanism ofAbstractClient
- Improve the flexibility of
AbstractClient
Does this PR introduce any user facing changes?
No
In order for DefaultBlockWorkerClient
to inherit from AbstractClient
, three issues have to be addressed:
-
DefaultBlockWorkerClient
might not work with anInetSocketAddress
as it might use a domain socket instead. Therefore,AbstractClient
is modified to expose agetGrpcServerAddress
method used to return whatever server address the client connects to.DefaultBlockWorkerClient
overrides this method to return the address it needs for connection. -
AbstractClient
now can be extended to construct multiple channels corresponding to differentGrpcNetworkGroup
, so thatDefaultBlockWorker
can construct two channels, one for streaming and one for normal rpc, for its use. -
AbstractClient
currently hardcoded a version checking method, which alluxio workers don't hold. Therefore, a switch is exposed to control whether version checking should be run so thatDefaultBlockWorkerClient
can switch it off.
@beinan @dbw9580 Do you mind taking a look at this refactor? Thanks a lot!
@dbw9580 Cleaned up a bit and addressed your concerns. Would you like to take another look? Thanks!
Please try your best to preserve the behavior of the client, since this is a fundamental class, a lot of things depend on it.
What tests have been done? How do you make sure not to break some conner cases?
What tests have been done? How do you make sure not to break some conner cases?
Every test case that reads or writes from alluxio uses this class. Also tested the generated tarball against tests in ClientIO cluster.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.