rdblue commented on code in PR #7880:
URL: https://github.com/apache/iceberg/pull/7880#discussion_r1315204489


##########
core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java:
##########
@@ -337,4 +394,67 @@ protected String tableName() {
       return tableIdentifier.toString();
     }
   }
+
+  private class InMemoryViewOperations extends BaseViewOperations {
+    private final FileIO fileIO;
+    private final TableIdentifier identifier;
+
+    InMemoryViewOperations(FileIO fileIO, TableIdentifier identifier) {
+      this.fileIO = fileIO;
+      this.identifier = identifier;
+    }
+
+    @Override
+    public void doRefresh() {
+      String latestLocation = views.get(identifier);
+      if (latestLocation == null) {
+        disableRefresh();
+      } else {
+        refreshFromMetadataLocation(latestLocation);
+      }
+    }
+
+    @Override
+    public void doCommit(ViewMetadata base, ViewMetadata metadata) {
+      String newLocation = writeNewMetadata(metadata, currentVersion() + 1);

Review Comment:
   I think this is unnecessary. It gets `currentVersion()` only to pass it back 
to a method defined by the parent. Instead, `BaseViewOperations` should handle 
the version internally with a method like `writeNewMetadataIfNeeded`.



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

Reply via email to