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


##########
core/src/main/java/org/apache/iceberg/view/BaseViewOperations.java:
##########
@@ -0,0 +1,215 @@
+/*
+ * 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.view;
+
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import org.apache.iceberg.exceptions.AlreadyExistsException;
+import org.apache.iceberg.exceptions.CommitFailedException;
+import org.apache.iceberg.exceptions.NoSuchViewException;
+import org.apache.iceberg.exceptions.NotFoundException;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.relocated.com.google.common.base.Objects;
+import org.apache.iceberg.util.Tasks;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class BaseViewOperations implements ViewOperations {
+  private static final Logger LOG = 
LoggerFactory.getLogger(BaseViewOperations.class);
+
+  private static final String METADATA_FOLDER_NAME = "metadata";
+
+  private ViewMetadata currentMetadata = null;
+  private String currentMetadataLocation = null;
+  private boolean shouldRefresh = true;
+  private int version = -1;
+
+  protected BaseViewOperations() {}
+
+  protected void requestRefresh() {
+    this.shouldRefresh = true;
+  }
+
+  protected void disableRefresh() {
+    this.shouldRefresh = false;
+  }
+
+  protected void doRefresh() {
+    throw new UnsupportedOperationException("Not implemented: doRefresh");
+  }
+
+  protected void doCommit(ViewMetadata base, ViewMetadata metadata) {
+    throw new UnsupportedOperationException("Not implemented: doCommit");
+  }
+
+  protected abstract String viewName();
+
+  protected abstract FileIO io();
+
+  public int currentVersion() {
+    return version;
+  }
+
+  public String currentMetadataLocation() {

Review Comment:
   The table equivalent is only used in children and in tests. I think we can 
make this `protected`.



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