dimas-b commented on code in PR #1285:
URL: https://github.com/apache/polaris/pull/1285#discussion_r2159118735
##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java:
##########
@@ -85,24 +96,51 @@
import org.apache.polaris.core.config.FeatureConfiguration;
import org.apache.polaris.core.config.PolarisConfigurationStore;
import org.apache.polaris.core.context.RealmContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* CODE_COPIED_TO_POLARIS Copied from CatalogHandler in Iceberg 1.8.0 Contains
a collection of
* utilities related to managing Iceberg entities
*/
@ApplicationScoped
public class CatalogHandlerUtils {
+ private static final Logger LOGGER =
LoggerFactory.getLogger(CatalogHandlerUtils.class);
+
private static final Schema EMPTY_SCHEMA = new Schema();
private static final String INITIAL_PAGE_TOKEN = "";
+ private static final String CONFLICT_RESOLUTION_ACTION =
+ "polaris.internal.conflict-resolution.by-operation-type.replace";
+ private static final Field LAST_SEQUENCE_NUMBER_FIELD;
- private final RealmContext realmContext;
- private final PolarisConfigurationStore configurationStore;
+ static {
+ try {
+ LAST_SEQUENCE_NUMBER_FIELD =
+ TableMetadata.Builder.class.getDeclaredField("lastSequenceNumber");
+ LAST_SEQUENCE_NUMBER_FIELD.setAccessible(true);
+ } catch (NoSuchFieldException e) {
+ throw new RuntimeException("Unable to access field", e);
+ }
+ }
+
+ private final int maxCommitRetries;
+ private final boolean rollbackCompactionEnabled;
@Inject
public CatalogHandlerUtils(
RealmContext realmContext, PolarisConfigurationStore configurationStore)
{
- this.realmContext = realmContext;
- this.configurationStore = configurationStore;
+ this.maxCommitRetries =
+ configurationStore.getConfiguration(
+ realmContext, FeatureConfiguration.ICEBERG_COMMIT_MAX_RETRIES);
+ this.rollbackCompactionEnabled =
Review Comment:
minor: I believe it would be nicer to redirect to the other constructor
(line 141) with the values obtained from configuration. This way construction
calls go through one place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]