rdblue commented on a change in pull request #14: Pluggable file I/O submodule 
in TableOperations
URL: https://github.com/apache/incubator-iceberg/pull/14#discussion_r240706640
 
 

 ##########
 File path: core/src/test/java/com/netflix/iceberg/LocalTableOperations.java
 ##########
 @@ -52,25 +53,19 @@ public void commit(TableMetadata base, TableMetadata 
metadata) {
   }
 
   @Override
-  public InputFile newInputFile(String path) {
-    return localInput(path);
-  }
-
-  @Override
-  public OutputFile newMetadataFile(String filename) {
-    try {
-      File metadataFile = temp.newFile(filename);
-      metadataFile.delete();
-      metadataFile.deleteOnExit();
-      return Files.localOutput(metadataFile);
-    } catch (IOException e) {
-      throw new RuntimeIOException(e);
-    }
+  public FileIO io() {
+    return io;
   }
 
   @Override
-  public void deleteFile(String path) {
-    new File(path).delete();
+  public String metadataFileLocation(String fileName) {
+    return createdMetadataFilePaths.computeIfAbsent(fileName, name -> {
+      try {
+        return temp.newFile(name).getAbsolutePath();
 
 Review comment:
   You're right and that should take care of deleteOnExit. I thought that the 
delete was needed because it creates the file, but I guess not since tests are 
passing.

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

Reply via email to