mansehajsingh commented on code in PR #1037:
URL: https://github.com/apache/polaris/pull/1037#discussion_r1974106977


##########
polaris-core/src/main/java/org/apache/polaris/core/entity/ETaggableEntity.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.polaris.core.entity;
+
+/**
+ * Entities that can expose an ETag that can uniquely identify their current 
state.
+ */
+public interface ETaggableEntity {
+
+    /**
+     * Obtain an ETag that uniquely identifies the current state of the entity.
+     * @return the ETag
+     */
+    String getETag();
+
+    /**
+     * Determines if the provided etag identifies the current version of the 
entity.
+     * @param etag The etag to compare the entity against
+     * @return true if the etag identifies the current state of the entity, 
false otherwise
+     */
+    boolean isCurrent(String etag);

Review Comment:
   I've given it a `default` implementation, the reason I chose not to make it 
final was because if we want to append a version identifier as we evolve the 
etag's value, we may want to give a custom implementation based on which entity 
we are dealing with. As a default case however, comparing the etag should be 
okay, so I have moved it up to the interface



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

Reply via email to