phet commented on a change in pull request #3414: URL: https://github.com/apache/gobblin/pull/3414#discussion_r732422049
########## File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_store/MysqlNonFlowSpecStore.java ########## @@ -0,0 +1,318 @@ +/* + * 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.runtime.spec_store; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.net.URI; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import com.google.common.base.Optional; +import com.google.common.collect.Lists; +import com.google.common.io.ByteStreams; +import com.typesafe.config.Config; + +import javax.sql.DataSource; +import lombok.extern.slf4j.Slf4j; + +import org.apache.gobblin.broker.SharedResourcesBrokerFactory; +import org.apache.gobblin.configuration.ConfigurationKeys; +import org.apache.gobblin.metastore.MysqlDataSourceFactory; +import org.apache.gobblin.runtime.api.FlowSpec; +import org.apache.gobblin.runtime.api.InstrumentedSpecStore; +import org.apache.gobblin.runtime.api.Spec; +import org.apache.gobblin.runtime.api.SpecNotFoundException; +import org.apache.gobblin.runtime.api.SpecSerDe; +import org.apache.gobblin.runtime.api.SpecSerDeException; +import org.apache.gobblin.runtime.api.SpecStore; + + +/** + * Implementation of {@link SpecStore} that stores specs (other than {@link FlowSpec}) in MySQL as a serialized BLOB, per the provided + * {@link SpecSerDe}. + * Note: versions are unsupported, so the version parameter is ignored in methods that have it. + * + * A tag column is added into implementation to serve certain filtering purposes in MySQL-based SpecStore. + * For example, in DR mode of GaaS, we would only want certain {@link Spec}s to be eligible for orchestrated + * by alternative GaaS instances. Another example is allow-listing/deny-listing {@link Spec}s temporarily + * but not removing it from {@link SpecStore}. + * + * The {@link MysqlSpecStore} is a specialization enhanced for {@link FlowSpec} search and retrieval. + */ +@Slf4j +public class MysqlNonFlowSpecStore extends InstrumentedSpecStore { Review comment: so true... also not as hideous a name ;) will change -- 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]
