|
45 | 45 | import org.apache.iceberg.exceptions.NoSuchTableException; |
46 | 46 | import org.apache.iceberg.exceptions.NoSuchViewException; |
47 | 47 | import org.apache.iceberg.exceptions.NotAuthorizedException; |
48 | | -import org.apache.iceberg.exceptions.RESTException; |
49 | 48 | import org.apache.iceberg.exceptions.UnprocessableEntityException; |
50 | 49 | import org.apache.iceberg.exceptions.ValidationException; |
51 | 50 | import org.apache.iceberg.relocated.com.google.common.base.Splitter; |
|
77 | 76 | * Original @ <a href="https://github.com/apache/iceberg/blob/apache-iceberg-1.9.1/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java">RESTCatalogAdapter.java</a> |
78 | 77 | * Adaptor class to translate REST requests into {@link Catalog} API calls. |
79 | 78 | */ |
80 | | -public class HMSCatalogAdapter implements RESTClient { |
| 79 | +public class HMSCatalogAdapter { |
81 | 80 | private static final Splitter SLASH = Splitter.on('/'); |
82 | 81 |
|
83 | 82 | private static final Map<Class<? extends Exception>, Integer> EXCEPTION_ERROR_CODES = |
@@ -515,67 +514,7 @@ <T extends RESTResponse> T execute( |
515 | 514 | } |
516 | 515 | ErrorResponse error = errorBuilder.build(); |
517 | 516 | errorHandler.accept(error); |
518 | | - // if the error handler doesn't throw an exception, throw a generic one |
519 | | - throw new RESTException("Unhandled error: %s", error); |
520 | | - } |
521 | | - |
522 | | - @Override |
523 | | - public <T extends RESTResponse> T delete( |
524 | | - String path, |
525 | | - Class<T> responseType, |
526 | | - Map<String, String> headers, |
527 | | - Consumer<ErrorResponse> errorHandler) { |
528 | | - return execute(HTTPMethod.DELETE, path, null, null, errorHandler); |
529 | | - } |
530 | | - |
531 | | - @Override |
532 | | - public <T extends RESTResponse> T delete( |
533 | | - String path, |
534 | | - Map<String, String> queryParams, |
535 | | - Class<T> responseType, |
536 | | - Map<String, String> headers, |
537 | | - Consumer<ErrorResponse> errorHandler) { |
538 | | - return execute(HTTPMethod.DELETE, path, queryParams, null, errorHandler); |
539 | | - } |
540 | | - |
541 | | - @Override |
542 | | - public <T extends RESTResponse> T post( |
543 | | - String path, |
544 | | - RESTRequest body, |
545 | | - Class<T> responseType, |
546 | | - Map<String, String> headers, |
547 | | - Consumer<ErrorResponse> errorHandler) { |
548 | | - return execute(HTTPMethod.POST, path, null, body, errorHandler); |
549 | | - } |
550 | | - |
551 | | - @Override |
552 | | - public <T extends RESTResponse> T get( |
553 | | - String path, |
554 | | - Map<String, String> queryParams, |
555 | | - Class<T> responseType, |
556 | | - Map<String, String> headers, |
557 | | - Consumer<ErrorResponse> errorHandler) { |
558 | | - return execute(HTTPMethod.GET, path, queryParams, null, errorHandler); |
559 | | - } |
560 | | - |
561 | | - @Override |
562 | | - public void head(String path, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) { |
563 | | - execute(HTTPMethod.HEAD, path, null, headers, errorHandler); |
564 | | - } |
565 | | - |
566 | | - @Override |
567 | | - public <T extends RESTResponse> T postForm( |
568 | | - String path, |
569 | | - Map<String, String> formData, |
570 | | - Class<T> responseType, |
571 | | - Map<String, String> headers, |
572 | | - Consumer<ErrorResponse> errorHandler) { |
573 | | - return execute(HTTPMethod.POST, path, null, formData, errorHandler); |
574 | | - } |
575 | | - |
576 | | - @Override |
577 | | - public void close() { |
578 | | - // The caller is responsible for closing the underlying catalog backing this REST catalog. |
| 517 | + return null; |
579 | 518 | } |
580 | 519 |
|
581 | 520 | private static class BadResponseType extends RuntimeException { |
|
0 commit comments