jerryshao commented on code in PR #7734:
URL: https://github.com/apache/gravitino/pull/7734#discussion_r2278363907
##########
core/src/main/java/org/apache/gravitino/meta/StatisticEntity.java:
##########
@@ -35,6 +35,8 @@ public class StatisticEntity implements Entity,
HasIdentifier, Auditable {
Field.required("name", String.class, "The name of the statistic
entity.");
public static final Field VALUE =
Field.required("value", StatisticValue.class, "The value of the
statistic entity.");
+ public static final Field PARENT_ENTITY_TYPE =
+ Field.required("parent_entity_type", EntityType.class, "The type of the
parent entity.");
Review Comment:
It is not parent entity type, it is the statistic which belongs to, you'd
better figure out a better name.
##########
core/src/main/java/org/apache/gravitino/EntityStore.java:
##########
@@ -190,6 +190,54 @@ default boolean delete(NameIdentifier ident, EntityType
entityType) throws IOExc
*/
boolean delete(NameIdentifier ident, EntityType entityType, boolean cascade)
throws IOException;
+ /**
+ * Batch delete entities in the specified namespace.
+ *
+ * @param namespace the namespace in which the entities are located
+ * @param namespaceEntityType the detailed type of the namespace entity
+ * @param deleteEntityNames the names of the entities to be deleted
+ * @param entityType the general type of the entities to be deleted
+ * @param cascade if true, cascade delete the entities, otherwise just
delete the entities
+ * @return the number of entities deleted
+ * @throws IOException if the batch delete operation fails
+ */
+ int batchDeleteInNamespace(
+ Namespace namespace,
+ EntityType namespaceEntityType,
+ List<String> deleteEntityNames,
+ EntityType entityType,
+ boolean cascade)
+ throws IOException;
Review Comment:
This is not generic enough, I think you can change to
`batchDelete(List<Pair<NameIdentifier, EntityType>> idents, boolean cascade)`.
Inside the specific code, you can handle how to group and check each entity
name and type.
##########
core/src/main/java/org/apache/gravitino/EntityStore.java:
##########
@@ -190,6 +190,54 @@ default boolean delete(NameIdentifier ident, EntityType
entityType) throws IOExc
*/
boolean delete(NameIdentifier ident, EntityType entityType, boolean cascade)
throws IOException;
+ /**
+ * Batch delete entities in the specified namespace.
+ *
+ * @param namespace the namespace in which the entities are located
+ * @param namespaceEntityType the detailed type of the namespace entity
+ * @param deleteEntityNames the names of the entities to be deleted
+ * @param entityType the general type of the entities to be deleted
+ * @param cascade if true, cascade delete the entities, otherwise just
delete the entities
+ * @return the number of entities deleted
+ * @throws IOException if the batch delete operation fails
+ */
+ int batchDeleteInNamespace(
+ Namespace namespace,
+ EntityType namespaceEntityType,
+ List<String> deleteEntityNames,
+ EntityType entityType,
+ boolean cascade)
+ throws IOException;
+
+ /**
+ * Batch put entities into the underlying storage.
+ *
+ * @param entities the list of entities to be stored
+ * @param overwritten if true, overwrite the existing entities, otherwise
throw an
+ * @param <E> the type of the entities
+ * @throws IOException if the batch put operation fails
+ * @throws EntityAlreadyExistsException if the entity already exists and the
overwritten flag is
+ * false
+ */
+ <E extends Entity & HasIdentifier> void batchPut(List<E> entities, boolean
overwritten)
+ throws IOException, EntityAlreadyExistsException;
+
+ /**
+ * List all the entities with the specified {@link
org.apache.gravitino.Namespace}, and
+ * deserialize them into the specified {@link Entity} object.
+ *
+ * @param namespace the namespace of the entities
+ * @param namespaceEntityType the detailed type of the namespace entity
+ * @param type the detailed type of the entity
+ * @param entityType the general type of the entity
+ * @return the list of entities
+ * @param <E> the class of the entity
+ * @throws IOException if the list operation fails
+ */
+ <E extends Entity & HasIdentifier> List<E> list(
+ Namespace namespace, EntityType namespaceEntityType, Class<E> type,
EntityType entityType)
+ throws IOException;
Review Comment:
```
list(Pair<Namespace, EntityType> NsWithType, Class<E> type, EntityType
entityType)
```
How about this?
--
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]