Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TACHYON-1061] Throw detailed exceptions isolated from RPC framework
The bulk of this commit is renaming/refactors, so below we detail the important things to look at In tachyon.thrift, we deleted all the thrift exceptions, and replaced them with two exceptions, TachyonTException and ThriftIOException, which are general containers for Tachyon exceptions and IOExceptions, respectively. Also modified the service interfaces to only throw those exceptions. In tacyhon/exception/, we defined the TachyonException class as a superclass of all Tachyon exceptions, which can convert back and forth between TachyonTException using error codes. We then defined an exception subclass for each of the error code values, which will be the specific exceptions that we throw around in Tachyon everywhere except the thrift layer. Finally, in the client code, whenever we make an RPC call, we immediately convert the TachyonTException to a TachyonException and the ThriftIOException to an IOException, and propagate that up to the top layer of the client. At any user-facing boundary of the client (like TachyonFileSystem), we'll unwrap the TachyonException with any specific ones we think it might throw. Otherwise, we'll throw the general TachyonException as-is, as a catch-all for exceptions we didn't expect, or might add later. By including the TachyonException in all the 'throws' clauses of the function signatures, we allow for backwards compatibility by ensuring that newly added exceptions won't cause a compile-time error in user code.
- Loading branch information
Showing
120 changed files
with
19,728 additions
and
21,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.