You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/05 20:08:20 UTC

[GitHub] [iceberg] danielcweeks commented on a change in pull request #4050: [WIP] Add FileIOMetrics to enable reporting of read/write metrics

danielcweeks commented on a change in pull request #4050:
URL: https://github.com/apache/iceberg/pull/4050#discussion_r800095191



##########
File path: api/src/main/java/org/apache/iceberg/io/FileIOMetrics.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.io;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * Optional interface for FileIO implementations to report metrics related
+ * to read/write operations.
+ */
+public interface FileIOMetrics extends Serializable {
+  void initialize(Map<String,String> properties);
+  void incrementBytesRead(long bytesRead);

Review comment:
       The more I think about this interface, the less I like the parallels with the Hadoop FileSystem statistics because it is very limited.
   
   I think what we really want is a way to provide arbitrary IO specific metrics, not just bytes/ops (e.g. s3 request count, parts uploaded, request latency).  So, I think we want to pivot this interface to accept more generic metrics:
   
   ```
   void increment(<Metric>)
   void decrement(<Metric>) ?? Not sure if there is a use case for this
   ```
   
   Where a metric is a `name/value` pair.  In the hadoop implementation, we can still map those to the statistics, but overall, it would provide more flexible metric reporting.
   
   Thoughts?
   




-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org