[
https://issues.apache.org/jira/browse/TAJO-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14679825#comment-14679825
]
ASF GitHub Bot commented on TAJO-1748:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/680#discussion_r36612232
--- Diff:
tajo-client/src/main/java/org/apache/tajo/client/CatalogAdminClientImpl.java ---
@@ -164,21 +166,22 @@ public TableDesc createExternalTable(final String
tableName, final Schema schema
throw new RuntimeException(e);
}
- if (isThisError(res.getState(), Errors.ResultCode.DUPLICATE_TABLE)) {
- throw new DuplicateTableException(res.getState());
- }
+ throwsIfThisError(res.getState(), DuplicateTableException.class);
+ throwsIfThisError(res.getState(),
InsufficientPrivilegeException.class);
+ throwsIfThisError(res.getState(),
UnavailableTableLocationException.class);
ensureOk(res.getState());
return CatalogUtil.newTableDesc(res.getTable());
}
@Override
- public boolean dropTable(String tableName) throws
UndefinedTableException {
- return dropTable(tableName, false);
+ public void dropTable(String tableName) throws UndefinedTableException,
InsufficientPrivilegeException {
+ dropTable(tableName, false);
}
@Override
- public boolean dropTable(final String tableName, final boolean purge)
throws UndefinedTableException {
+ public void dropTable(final String tableName, final boolean purge)
+ throws UndefinedTableException, InsufficientPrivilegeException {
--- End diff --
I misunderstood some codes. Please forget this comment.
> Refine client APIs to throw specific exceptions
> -----------------------------------------------
>
> Key: TAJO-1748
> URL: https://issues.apache.org/jira/browse/TAJO-1748
> Project: Tajo
> Issue Type: Sub-task
> Components: Catalog, Java Client
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.11.0
>
>
> This patch includes lots of API changes in terms of only exceptions. In
> overall, this patch changes throwable exceptions for APIs and unit tests to
> ensure that the APIs throws exact exceptions.
> In sum, this patch includes the following changes:
> * Rename TajoExceptionInterface to DefaultTajoException.
> * Rename UnImplementedException to NotImplementedException.
> * Replace CatalogException by TajoException
> * Move almost TajoException/TajoRunException in tajo-core into tajo-common
> * Remove CatalogException and CatalogExceptionUtil
> * Add throwable exception to all APIs in TajoClient, QueryClient,
> CatalogService, and CatalogAdminClient.
> * Refine all client implementations to throw received exception exactly.
> * Add negative unit tests for all APIs of them
> * Refine Client API v2 to handle exceptional cases like query failed, and
> killed.
> * Add query fail and kill tests for Client v2
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)