nastra commented on a change in pull request #3104:
URL: https://github.com/apache/iceberg/pull/3104#discussion_r742564069



##########
File path: api/src/main/java/org/apache/iceberg/SnapshotReference.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.Objects;
+import java.util.concurrent.TimeUnit;
+import org.apache.iceberg.exceptions.ValidationException;
+
+/**
+ * User-defined information of a named snapshot
+ */
+public class SnapshotReference {
+
+  private final long snapshotId;
+  private final String name;
+  private final SnapshotReferenceType type;
+  private final Integer minSnapshotsToKeep;
+  private final long maxSnapshotAgeMs;
+
+  private SnapshotReference(
+      long snapshotId,
+      String name,
+      SnapshotReferenceType type,
+      Integer minSnapshotsToKeep,
+      long maxSnapshotAgeMs) {
+    this.snapshotId = snapshotId;
+    this.name = name;
+    this.type = type;
+    this.minSnapshotsToKeep = minSnapshotsToKeep;
+    this.maxSnapshotAgeMs = maxSnapshotAgeMs;
+  }
+
+  public long snapshotId() {
+    return snapshotId;
+  }
+
+  public String snapshotName() {
+    return name;
+  }
+
+  public SnapshotReferenceType type() {
+    return type;
+  }
+
+  /**
+   * Returns the minimum number of snapshots to keep for a BRANCH, or null for 
a TAG

Review comment:
       maybe `minSnapshotsToKeep` can be 0 instead of `null` for a TAG? Then 
you could use the primitive `int` type rather than `Integer`




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