[
https://issues.apache.org/jira/browse/GOBBLIN-2153?focusedWorklogId=934466&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-934466
]
ASF GitHub Bot logged work on GOBBLIN-2153:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 12/Sep/24 09:08
Start Date: 12/Sep/24 09:08
Worklog Time Spent: 10m
Work Description: pratapaditya04 commented on code in PR #4052:
URL: https://github.com/apache/gobblin/pull/4052#discussion_r1756459307
##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/util/TemporalWorkFlowUtils.java:
##########
@@ -0,0 +1,52 @@
+package org.apache.gobblin.temporal.ddm.util;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import lombok.NonNull;
+import lombok.experimental.UtilityClass;
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.temporal.ddm.work.assistance.Help;
+
+
+/**
+ * Utility class for handling Temporal workflow-related operations.
+ */
+@UtilityClass
+public class TemporalWorkFlowUtils {
+
+ /**
+ * Generates search attributes for a WorkFlow based on the provided GAAS
job properties.
+ *
+ * @param jobProps the properties of the job, must not be null.
+ * @return a map containing the generated search attributes.
+ */
+ public static Map<String, Object> generateGaasSearchAttributes(@NonNull
Properties jobProps) {
+ Map<String, Object> attributes = new HashMap<>();
+ attributes.put(Help.GAAS_FLOW_KEY, String.format("%s.%s",
jobProps.getProperty(ConfigurationKeys.FLOW_GROUP_KEY),
+ jobProps.getProperty(ConfigurationKeys.FLOW_NAME_KEY)));
+ attributes.put(Help.USER_TO_PROXY_SEARCH_KEY,
jobProps.getProperty(Help.USER_TO_PROXY_KEY));
Review Comment:
have added default values so incase FLOW_GROUP_KEY, FLOW_NAME_KEY and
USER_TO_PROXY_KEY are not set, the default values will be returned. Dont prefer
throwing an exception as we don't want the job to fail just because
searchAttributes couldn't be set.
Issue Time Tracking
-------------------
Worklog Id: (was: 934466)
Time Spent: 1h 10m (was: 1h)
> Add SearchAttributes to filter Temporal Flows in the UI
> -------------------------------------------------------
>
> Key: GOBBLIN-2153
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2153
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Aditya Pratap Singh
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Add SearchAttributes to filter Temporal Flows in the UI
--
This message was sent by Atlassian Jira
(v8.20.10#820010)