[
https://issues.apache.org/jira/browse/GOBBLIN-1705?focusedWorklogId=809924&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-809924
]
ASF GitHub Bot logged work on GOBBLIN-1705:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Sep/22 04:32
Start Date: 19/Sep/22 04:32
Worklog Time Spent: 10m
Work Description: arjun4084346 commented on code in PR #3557:
URL: https://github.com/apache/gobblin/pull/3557#discussion_r973855330
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/SpecStoreChangeMonitor.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.service.monitoring;
+
+import java.util.HashSet;
+
+import com.google.inject.Inject;
+import com.typesafe.config.Config;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.gobblin.kafka.client.DecodeableKafkaRecord;
+import org.apache.gobblin.runtime.api.Spec;
+import org.apache.gobblin.runtime.kafka.HighLevelConsumer;
+import org.apache.gobblin.runtime.spec_catalog.FlowCatalog;
+import org.apache.gobblin.service.modules.scheduler.GobblinServiceJobScheduler;
+
+
+/**
+ * A Flow Spec Store change monitor that uses {@link SpecStoreChangeEvent}
schema to process Kafka messages received
+ * from the consumer service. This monitor responds to changes to flow specs
(creations, updates, deletes) and acts as
+ * a connector between the API and execution layers of GaaS.
+ */
+@Slf4j
+public class SpecStoreChangeMonitor extends HighLevelConsumer {
+ protected HashSet<Long> timestampsSeenBefore;
+
+ @Inject
+ protected FlowCatalog flowCatalog;
+
+ @Inject
+ protected GobblinServiceJobScheduler scheduler;
+
+ @Inject
+ public SpecStoreChangeMonitor(String topic, Config config, int numThreads) {
+ super(topic, config, numThreads);
+ this.timestampsSeenBefore = new HashSet();
Review Comment:
Is the change pushed?
Issue Time Tracking
-------------------
Worklog Id: (was: 809924)
Time Spent: 2h (was: 1h 50m)
> New Consumer service that processes changes to Flow Spec Store
> --------------------------------------------------------------
>
> Key: GOBBLIN-1705
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1705
> Project: Apache Gobblin
> Issue Type: New Feature
> Components: gobblin-service
> Reporter: Urmi Mustafi
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 2h
> Remaining Estimate: 0h
>
> In the multi-leader version of GaaS, the REST API layer will not directly
> contact the `GobblinServiceJobScheduler` to respond to API requests. Instead
> after flow level updates are persisted to MySQL, this new monitor will
> subscribe to Kafka events informing it of Flow Spec changes corresponding to
> the API requests and trigger their execution. There will be a similar change
> to follow to respond to other API requests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)