rdblue commented on a change in pull request #73: Allow data output streams to 
be generated via custom mechanisms when given partitioning and file name
URL: https://github.com/apache/incubator-iceberg/pull/73#discussion_r248506265
 
 

 ##########
 File path: core/src/main/java/com/netflix/iceberg/hadoop/HadoopFileIO.java
 ##########
 @@ -1,21 +1,106 @@
+/*
+ * 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 com.netflix.iceberg.hadoop;
 
+import com.google.common.base.Preconditions;
+import com.netflix.iceberg.PartitionSpec;
+import com.netflix.iceberg.StructLike;
+import com.netflix.iceberg.TableMetadata;
+import com.netflix.iceberg.TableProperties;
 import com.netflix.iceberg.io.FileIO;
 import com.netflix.iceberg.exceptions.RuntimeIOException;
 import com.netflix.iceberg.io.InputFile;
 import com.netflix.iceberg.io.OutputFile;
+import com.netflix.iceberg.transforms.Transform;
+import com.netflix.iceberg.transforms.Transforms;
+import com.netflix.iceberg.types.Types;
+import java.io.IOException;
+import java.util.Map;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
-import java.io.IOException;
-
 public class HadoopFileIO implements FileIO {
 
+  private static final Transform<String, Integer> HASH_FUNC = Transforms
+      .bucket(Types.StringType.get(), Integer.MAX_VALUE);
+
+  private static final String METADATA_DIR_NAME = "metadata";
+  private static final String DATA_DIR_NAME = "data";
+
   private final SerializableConfiguration hadoopConf;
+  private final String tableLocation;
+  private final String newDataFileDir;
+  private final boolean useObjectStorage;
+  private final String objectStorePath;
+  private final String newMetadataFileDir;
 
-  public HadoopFileIO(Configuration hadoopConf) {
+  public HadoopFileIO(
+      Configuration hadoopConf, TableMetadata tableMetadata) {
     this.hadoopConf = new SerializableConfiguration(hadoopConf);
+    this.tableLocation = tableMetadata.location();
+    Map<String, String> tableProperties = tableMetadata.properties();
+    this.newDataFileDir = stripTrailingSlash(
+        tableProperties
+            .getOrDefault(
 
 Review comment:
   Nit: different indentation than the next statement? (Not a big deal if you 
aren't making further changes)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to