obelix74 commented on code in PR #3616:
URL: https://github.com/apache/polaris/pull/3616#discussion_r2761885073


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/metrics/ReportIdToken.java:
##########
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+package org.apache.polaris.core.persistence.metrics;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import jakarta.annotation.Nullable;
+import org.apache.polaris.core.persistence.pagination.Token;
+import org.apache.polaris.immutables.PolarisImmutable;
+
+/**
+ * Pagination {@linkplain Token token} for metrics queries, backed by the 
report ID (UUID).
+ *
+ * <p>This token enables cursor-based pagination for metrics queries across 
different storage
+ * backends. The report ID is used as the cursor because it is:
+ *
+ * <ul>
+ *   <li>Guaranteed unique across all reports
+ *   <li>Present in both scan and commit metrics records
+ *   <li>Stable (doesn't change over time)
+ * </ul>
+ *
+ * <p>Each backend implementation can use this cursor value to implement 
efficient pagination in
+ * whatever way is optimal for that storage system:
+ *
+ * <ul>
+ *   <li>RDBMS: {@code WHERE report_id > :lastReportId ORDER BY report_id}
+ *   <li>NoSQL: Use report ID as partition/sort key cursor
+ *   <li>Time-series: Combine with timestamp for efficient range scans

Review Comment:
   Updated ReportIdToken Javadoc. Clarified it's a reference implementation, 
not required by the SPI. Backends can implement their own Token subclass



-- 
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]

Reply via email to