uex = UserException.systemError(resultException).addIdentity(queryContext.getCurrentEndpoint()).build(logger); } else { uex = null;
.addIdentity(fragment.getAssignment()) .addContext("Fragment", handle.getMajorFragmentId() + ":" + handle.getMinorFragmentId()) .build(logger);
throw UserException .unsupportedError().message("Do not support response for rpc type %d", rpcType) .addIdentity(endpoint) .build(logger); throw UserException.dataReadError(e).addIdentity(endpoint).build(logger); } catch (IOException e) { throw UserException.ioExceptionError(e).addIdentity(endpoint).build(logger);
@Override public MessageLite getResponseDefaultInstance(int rpcType) throws RpcException { switch(rpcType) { case DFS.RpcType.GET_FILE_STATUS_RESPONSE_VALUE: return DFS.GetFileStatusResponse.getDefaultInstance(); case DFS.RpcType.GET_FILE_DATA_RESPONSE_VALUE: return DFS.GetFileDataResponse.getDefaultInstance(); case DFS.RpcType.LIST_STATUS_RESPONSE_VALUE: return DFS.ListStatusResponse.getDefaultInstance(); case DFS.RpcType.MKDIRS_RESPONSE_VALUE: return DFS.MkdirsResponse.getDefaultInstance(); case DFS.RpcType.RENAME_RESPONSE_VALUE: return DFS.RenameResponse.getDefaultInstance(); case DFS.RpcType.DELETE_RESPONSE_VALUE: return DFS.DeleteResponse.getDefaultInstance(); case DFS.RpcType.WRITE_DATA_RESPONSE_VALUE: return DFS.WriteDataResponse.getDefaultInstance(); default: throw UserException .unsupportedError().message("Do not support response for rpc type %d", rpcType) .addIdentity(endpoint).build(logger); } }
private static final RpcException newRPCException(NodeEndpoint endpoint, IOException ioe) { UserRemoteException ure = UserRemoteException.create(UserException .ioExceptionError(ioe) .addIdentity(endpoint) .build(logger).getOrCreatePBError(false)); return new RpcException(ure); } @Test