yuqi1129 commented on code in PR #7973:
URL: https://github.com/apache/gravitino/pull/7973#discussion_r2261854993


##########
core/src/main/java/org/apache/gravitino/cache/EntityCacheKey.java:
##########
@@ -30,6 +30,24 @@ public class EntityCacheKey {
   private final NameIdentifier identifier;
   private final Entity.EntityType type;
   private final SupportsRelationOperations.Type relationType;
+  private final Boolean allFields;
+
+  /**
+   * Creates a new instance of {@link EntityCacheKey} with the given arguments.
+   *
+   * @param ident The identifier of the entity.
+   * @param type The type of the entity.
+   * @param relationType The type of the relation, it can be null.
+   * @param allFields Whether to retrieve all fields of the entity.
+   * @return A new instance of {@link EntityCacheKey}.
+   */
+  public static EntityCacheKey of(
+      NameIdentifier ident,
+      Entity.EntityType type,
+      SupportsRelationOperations.Type relationType,
+      boolean allFields) {
+    return new EntityCacheKey(ident, type, relationType, allFields);

Review Comment:
   If `allFields` is false, then the entities retrieved are the same. If I call 
this API several times? How many fields are fetched from storage if `allFields` 
is false.  Are these fields constant?



##########
core/src/main/java/org/apache/gravitino/cache/EntityCacheKey.java:
##########
@@ -41,7 +59,7 @@ public class EntityCacheKey {
    */
   public static EntityCacheKey of(
       NameIdentifier ident, Entity.EntityType type, 
SupportsRelationOperations.Type relationType) {
-    return new EntityCacheKey(ident, type, relationType);
+    return new EntityCacheKey(ident, type, relationType, null);

Review Comment:
   What's the purpose of setting a Boolean field to null?



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