jerqi commented on code in PR #7734:
URL: https://github.com/apache/gravitino/pull/7734#discussion_r2275610291
##########
core/src/main/java/org/apache/gravitino/SupportsRelationOperations.java:
##########
@@ -148,4 +149,32 @@ default <E extends Entity & HasIdentifier> List<E>
updateEntityRelations(
throw new UnsupportedOperationException(
"updateEntityRelations is not supported by this implementation");
}
+
+ /**
+ * Inserts a list of entities and their associated relations into the
storage.
+ *
+ * @param <E> The type of entities being inserted, which must extend Entity
and implement
+ * HasIdentifier.
+ * @param relType The type of relation to be established between the
entities.
+ * @param entities The list of entities to be inserted, which must implement
the Entity and
+ * HasIdentifier
+ * @param relations The list of relations to be established between the
entities.
+ * @param overwrite If true, existing relations will be overwritten; if
false, existing relations
+ * will throw an exception.
+ * @throws IOException If an error occurs during the insertion process, such
as a storage issue.
+ */
+ <E extends Entity & HasIdentifier> void insertEntitiesAndRelations(
+ Type relType, List<E> entities, List<Relation> relations, boolean
overwrite)
+ throws IOException;
+
+ /**
+ * Deletes a list of relations of a specific type.
+ *
+ * @param relType The type of relation to be deleted.
+ * @param relations The list of relations to be deleted, which must
implement the Relation
+ * interface.
+ * @return The number of relations deleted.
+ * @throws IOException If an error occurs during the deletion process, such
as a storage issue.
+ */
+ int deleteRelations(Type relType, List<Relation> relations) throws
IOException;
Review Comment:
I will delete entities and relations at the same time.
--
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]