[
https://issues.apache.org/jira/browse/GOBBLIN-1705?focusedWorklogId=811377&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-811377
]
ASF GitHub Bot logged work on GOBBLIN-1705:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 22/Sep/22 19:41
Start Date: 22/Sep/22 19:41
Worklog Time Spent: 10m
Work Description: umustafi commented on code in PR #3557:
URL: https://github.com/apache/gobblin/pull/3557#discussion_r978022183
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/SpecStoreChangeMonitorFactory.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * 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.Objects;
+
+import com.typesafe.config.Config;
+
+import javax.inject.Inject;
+import javax.inject.Provider;
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.gobblin.util.ConfigUtils;
+import org.apache.gobblin.util.reflection.GobblinConstructorUtils;
+
+
+/**
+ * A factory implementation that returns a {@link SpecStoreChangeMonitor}
instance.
+ */
+@Slf4j
+public class SpecStoreChangeMonitorFactory implements
Provider<SpecStoreChangeMonitor> {
+ private final Config config;
+
+ @Inject
+ public SpecStoreChangeMonitorFactory(Config config) {
+ this.config = Objects.requireNonNull(config);
+ }
+
+ private SpecStoreChangeMonitor createSpecStoreChangeMonitor()
+ throws ReflectiveOperationException {
+ Config specStoreChangeConfig =
config.getConfig(SpecStoreChangeMonitor.SPEC_STORE_CHANGE_MONITOR_PREFIX);
+ String topic =
specStoreChangeConfig.getString(SpecStoreChangeMonitor.SPEC_STORE_CHANGE_MONITOR_TOPIC_KEY);
+ int numThreads = ConfigUtils.getInt(specStoreChangeConfig,
SpecStoreChangeMonitor.SPEC_STORE_CHANGE_MONITOR_NUM_THREADS_KEY, 5);
Review Comment:
I'm moving the topic and num threads key to this class. We need the prefix
to extract the config with all the spec store change monitor prefixed values
`Config specStoreChangeConfig =
config.getConfig(SpecStoreChangeMonitor.SPEC_STORE_CHANGE_MONITOR_PREFIX);`
Issue Time Tracking
-------------------
Worklog Id: (was: 811377)
Time Spent: 3h 40m (was: 3.5h)
> 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: 3h 40m
> 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)