diff --git a/.palantir/revapi.yml b/.palantir/revapi.yml index 3b6db5681ffc..1b9ef4604c91 100644 --- a/.palantir/revapi.yml +++ b/.palantir/revapi.yml @@ -1285,12 +1285,6 @@ acceptedBreaks: - code: "java.field.removedWithConstant" old: "field org.apache.iceberg.TableProperties.ROW_LINEAGE" justification: "Removing deprecations for 1.10.0" - - code: "java.method.abstractMethodAdded" - new: "method T org.apache.iceberg.rest.BaseHTTPClient::execute(org.apache.iceberg.rest.HTTPRequest,\ - \ java.lang.Class, java.util.function.Consumer,\ - \ java.util.function.Consumer>,\ - \ org.apache.iceberg.rest.ParserContext)" - justification: "Add context aware parsing" - code: "java.method.removed" old: "method boolean org.apache.iceberg.TableMetadata::rowLineageEnabled()" justification: "Removing deprecations for 1.10.0" diff --git a/core/src/main/java/org/apache/iceberg/rest/BaseHTTPClient.java b/core/src/main/java/org/apache/iceberg/rest/BaseHTTPClient.java index ca832d7a4eaa..de92f86dec6d 100644 --- a/core/src/main/java/org/apache/iceberg/rest/BaseHTTPClient.java +++ b/core/src/main/java/org/apache/iceberg/rest/BaseHTTPClient.java @@ -149,10 +149,16 @@ protected abstract T execute( Consumer errorHandler, Consumer> responseHeaders); - protected abstract T execute( + protected T execute( HTTPRequest request, Class responseType, Consumer errorHandler, Consumer> responseHeaders, - ParserContext parserContext); + ParserContext parserContext) { + if (null != parserContext) { + throw new UnsupportedOperationException("Parser context is not supported"); + } + + return execute(request, responseType, errorHandler, responseHeaders); + } } diff --git a/core/src/main/java/org/apache/iceberg/rest/ParserContext.java b/core/src/main/java/org/apache/iceberg/rest/ParserContext.java index c42a22eb842d..25c533fe367a 100644 --- a/core/src/main/java/org/apache/iceberg/rest/ParserContext.java +++ b/core/src/main/java/org/apache/iceberg/rest/ParserContext.java @@ -22,8 +22,9 @@ import java.util.Collections; import java.util.Map; import org.apache.hadoop.util.Preconditions; +import org.apache.iceberg.relocated.com.google.common.collect.Maps; -class ParserContext { +public class ParserContext { private final Map data; @@ -44,11 +45,7 @@ static Builder builder() { } static class Builder { - private Map data; - - private Builder() { - this.data = Collections.emptyMap(); - } + private final Map data = Maps.newHashMap(); public Builder add(String key, Object value) { Preconditions.checkNotNull(key, "Key cannot be null");