hameizi commented on a change in pull request #3612:
URL: https://github.com/apache/iceberg/pull/3612#discussion_r758074935



##########
File path: api/src/main/java/org/apache/iceberg/UpdateSnapshotReference.java
##########
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+/**
+ * API for updating snapshot reference.
+ * <p>
+ * Apply returns the updated snapshot reference as a {@link SnapshotReference} 
for validation.
+ * <p>
+ * When committing, these changes will be applied to the current table 
metadata. Commit conflicts
+ * will be resolved by applying the pending changes to the new table metadata.
+ */
+public interface UpdateSnapshotReference extends PendingUpdate<Map<String, 
SnapshotReference>> {
+
+  /**
+   * remove snapshotReference.
+   *
+   * @param name name of snapshot reference
+   * @return this
+   * @throws IllegalArgumentException If there is no such snapshot reference 
named name
+   */
+  UpdateSnapshotReference removeReference(String name);
+
+  /**
+   * Update minSnapshotsToKeep of snapshotReference what will be search by 
referenceName and snapshotReferenceType.
+   *
+   * @param ageMs       new maxSnapshotAgeMs for snapshot reference. If null 
will not update.
+   * @param numToKeep   new minSnapshotsToKeep for snapshot reference. If null 
will not update.
+   * @param name        name of snapshot reference what will be update
+   * @return this
+   */
+
+  UpdateSnapshotReference setBranchRetention(String name, Long ageMs, Integer 
numToKeep);
+
+  /**
+   * Update minSnapshotsToKeep of snapshotReference what will be search by 
referenceName and snapshotReferenceType.
+   *
+   * @param maxRefAgeMs new maxRefAgeMs for snapshot reference. If null will 
not update.
+   * @param name        name of snapshot reference what will be update
+   * @return this
+   */
+
+  UpdateSnapshotReference setMaxRefAgeMs(String name, Long maxRefAgeMs);
+
+  /**
+   * Update name of snapshotReference what will be search by referenceName and 
snapshotReferenceType.
+   *
+   * @param oldName old name of snapshot reference
+   * @param name    new name for snapshot reference
+   * @return this
+   */
+  UpdateSnapshotReference updateName(String oldName, String name);

Review comment:
       updateName is used when user want just update the name of one reference 
and inherit old config like reflifetime. And updateReference is used when user 
want update multiple properties of one old reference, so they can update these 
by just once operation.




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