dimas-b commented on code in PR #4115:
URL: https://github.com/apache/polaris/pull/4115#discussion_r3417098448
##########
runtime/service/src/main/java/org/apache/polaris/service/config/ServiceProducers.java:
##########
@@ -457,9 +457,16 @@ public RequestIdSupplier requestIdSupplier() {
@Produces
@ApplicationScoped
- public PolarisMetricsReporter metricsReporter(
- MetricsReportingConfiguration config, @Any
Instance<PolarisMetricsReporter> reporters) {
- return reporters.select(Identifier.Literal.of(config.type())).get();
+ public IcebergMetricsReporter metricsReporter(
+ MetricsReportingConfiguration config, @Any
Instance<IcebergMetricsReporter> reporters) {
+ var selected = reporters.select(Identifier.Literal.of(config.type()));
+ if (selected.isUnsatisfied()) {
+ LOGGER.warn(
+ "No IcebergMetricsReporter found for type '{}'; Iceberg metrics will
be dropped",
+ config.type());
+ return (catalogName, catalogId, table, tableId, metricsReport,
receivedTimestamp) -> {};
Review Comment:
Would it make sense to move `NoOpMetricsReporter` into the metrics SPI
module? This way we'll have only one "no op" impl. 😉 and builds that do not
need metrics reporters do not have to reinvent the "no op" reporter either.
As a side benefit, `selected` will always be resolvable (aside from config
mistakes).
##########
extensions/metrics-reports/impl/build.gradle.kts:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+plugins {
+ id("polaris-server")
+ id("org.kordamp.gradle.jandex")
+}
+
+dependencies {
+ implementation(project(":polaris-core"))
+ implementation(project(":polaris-api-metrics-reports-service"))
+ implementation(project(":polaris-extensions-metrics-reports-spi"))
+
+ implementation(platform(libs.iceberg.bom))
+ implementation("org.apache.iceberg:iceberg-api")
+
+ implementation(libs.jakarta.enterprise.cdi.api)
+ implementation(libs.jakarta.inject.api)
+ implementation(libs.jakarta.ws.rs.api)
+ implementation(libs.smallrye.common.annotation)
+ implementation(libs.slf4j.api)
+ compileOnly(libs.jakarta.annotation.api)
+
+ implementation(platform(libs.jackson.bom))
+ implementation("com.fasterxml.jackson.core:jackson-annotations")
+
+ testImplementation(platform(libs.junit.bom))
+ testImplementation("org.junit.jupiter:junit-jupiter")
+ testImplementation(libs.assertj.core)
+ testImplementation(libs.mockito.core)
+ testImplementation(libs.jakarta.ws.rs.api)
Review Comment:
IJ apparently suggests that this is redundant (given line 35).
##########
persistence/relational-jdbc/src/main/resources/META-INF/services/org.apache.polaris.core.persistence.pagination.Token$TokenType:
##########
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
Review Comment:
Only comments in this file? Should we just delete it?
##########
extensions/metrics-reports/spi/src/main/java/org/apache/polaris/core/metrics/IcebergMetricsReporter.java:
##########
@@ -16,38 +16,33 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.polaris.service.reporting;
+package org.apache.polaris.core.metrics;
Review Comment:
Now that this class is in `extensions/metrics-reports/spi`, should the
package be `org.apache.polaris.extension.metrics.reports.spi` perhaps? WDYT?
--
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]