From 3586e4df8dfc53427b4a87eef10b79576795a57e Mon Sep 17 00:00:00 2001 From: Rakhi Agrawal Date: Fri, 23 Aug 2024 05:08:33 -0700 Subject: [PATCH] Creating PreIngestionLambda Interface (#398) * Initial commit * Added proto * Fixed enum * Using pdl * Addressed 1 comment * Added POJO * Addressed more comments * Fixed checkstyle error * Added @Builder * Final interface decision * Revert "Final interface decision" This reverts commit b32bd1c6713007c40794b756598210fbfdd388d2. * Include Skip and Proceed * Removed unused import * Final * java doc --------- Co-authored-by: Rakhi Agrawal --- dao-api/build.gradle | 2 +- .../dao/ingestion/PreUpdateRoutingClient.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 dao-api/src/main/java/com/linkedin/metadata/dao/ingestion/PreUpdateRoutingClient.java diff --git a/dao-api/build.gradle b/dao-api/build.gradle index ad0080211..5cdf09541 100644 --- a/dao-api/build.gradle +++ b/dao-api/build.gradle @@ -9,7 +9,7 @@ dependencies { compile externalDependency.javatuples compile externalDependency.reflections compile externalDependency.commonsLang - + implementation 'com.google.protobuf:protobuf-java:3.21.1' dataModel project(':core-models') dataModel project(':validators') diff --git a/dao-api/src/main/java/com/linkedin/metadata/dao/ingestion/PreUpdateRoutingClient.java b/dao-api/src/main/java/com/linkedin/metadata/dao/ingestion/PreUpdateRoutingClient.java new file mode 100644 index 000000000..5c63296cc --- /dev/null +++ b/dao-api/src/main/java/com/linkedin/metadata/dao/ingestion/PreUpdateRoutingClient.java @@ -0,0 +1,19 @@ +package com.linkedin.metadata.dao.ingestion; + +import com.google.protobuf.Message; + + +/** + * An interface that defines methods to route update requests to the appropriate custom APIs. + */ + +public interface PreUpdateRoutingClient { + /** + * A method that routes the update request to the appropriate custom API. + * @param urn the urn of the asset + * @param aspect the aspect to be updated + * @return the updated aspect + * @throws Exception if the routing fails + */ + ASPECT routingLambda(Message urn, ASPECT aspect) throws Exception; +} \ No newline at end of file