rdblue commented on code in PR #5268: URL: https://github.com/apache/iceberg/pull/5268#discussion_r922335234
########## api/src/main/java/org/apache/iceberg/metrics/ScanReporter.java: ########## @@ -0,0 +1,84 @@ +/* + * 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.iceberg.metrics; + +import java.util.Map; +import org.apache.iceberg.metrics.ScanReport.ScanMetrics; + +/** + * This interface defines the basic API for a Table Scan Reporter that can be used to collect and report different + * metrics during a Table scan. The general usage of the Scan Reporter is as following: + * <ul> + * <li>startScan() to indicate that this is a new Scan so that metrics (and other things) can be initialized</li> + * <li>use scanMetrics() to add recorded metrics during a Scan</li> + * <li>reportScan() at the end of the Scan</li> + * </ul> + */ +public interface ScanReporter { + + /** + * Indicates that a new Scan is about to be performed, where implementors should initialize the {@link ScanMetrics}, + * which can then be used to add recorded metrics to during a Scan. + */ + void startScan(); Review Comment: Similar to the comment above, this would be `startScanPlanning`. I'm also not sure that the `ScanReporter` itself should be a timer. That mixes more responsibility than necessary. I would probably just add a timer for total planning time to the scan metrics. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
