Skip to content

Commit

Permalink
refactor(gms): reorganize GMS factory namespace (#1916)
Browse files Browse the repository at this point in the history
Fixes #1658
  • Loading branch information
mars-lan authored Oct 6, 2020
1 parent 8b23672 commit 0f68f86
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/how/entity-onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Refer to [graph onboarding](graph-onboarding.md) if you need to perform graph qu
See [`CorpUsers`] for an example of top-level [resource endpoint]. Optionally add an aspect-specific [sub-resource endpoint] such as [`CorpUsersEditableInfoResource`].

## 6. Configure dependency injection
GMS uses [Spring Framework](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans) for dependency injection. You'll need to add [various factories](https://github.com/linkedin/datahub/tree/master/gms/factories/src/main/java/com/linkedin/identity/factory) to create any custom DAOs used by the rest.li endpoint. You'll also need to add any custom package to the `base-package` of `<context:component-scan>` tag in [beans.xml](https://github.com/linkedin/datahub/blob/master/gms/war/src/main/webapp/WEB-INF/beans.xml)
GMS uses [Spring Framework](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans) for dependency injection. You'll need to add [various factories](https://github.com/linkedin/datahub/tree/master/gms/factories/src/main/java/com/linkedin/gms/factory) to create any custom DAOs used by the rest.li endpoint. You'll also need to add any custom package to the `base-package` of `<context:component-scan>` tag in [beans.xml](https://github.com/linkedin/datahub/blob/master/gms/war/src/main/webapp/WEB-INF/beans.xml)

## 7. UI for entity onboarding [WIP]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.common.factory;
package com.linkedin.gms.factory.common;

import io.confluent.kafka.serializers.KafkaAvroSerializer;
import io.confluent.kafka.serializers.AbstractKafkaAvroSerDeConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.common.factory;
package com.linkedin.gms.factory.common;

import io.ebean.config.ServerConfig;
import io.ebean.datasource.DataSourceConfig;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.common.factory;
package com.linkedin.gms.factory.common;

import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.common.factory;
package com.linkedin.gms.factory.common;

import javax.annotation.Nonnull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.common.factory;
package com.linkedin.gms.factory.common;

import com.linkedin.mxe.TopicConvention;
import com.linkedin.mxe.TopicConventionImpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.dataplatform.factory;
package com.linkedin.gms.factory.dataplatform;

import com.linkedin.common.urn.DataPlatformUrn;
import com.linkedin.metadata.aspect.DataPlatformAspect;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linkedin.dataprocess.factory;
package com.linkedin.gms.factory.dataprocess;

import com.linkedin.common.factory.TopicConventionFactory;
import com.linkedin.gms.factory.common.TopicConventionFactory;
import com.linkedin.common.urn.DataProcessUrn;
import com.linkedin.metadata.aspect.DataProcessAspect;
import com.linkedin.metadata.dao.EbeanLocalDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.dataprocess.factory;
package com.linkedin.gms.factory.dataprocess;

import com.linkedin.metadata.configs.DataProcessSearchConfig;
import com.linkedin.metadata.dao.search.ESSearchDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.dataset.factory;
package com.linkedin.gms.factory.dataset;

import com.linkedin.metadata.configs.DatasetBrowseConfig;
import com.linkedin.metadata.dao.browse.ESBrowseDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linkedin.dataset.factory;
package com.linkedin.gms.factory.dataset;

import com.linkedin.common.factory.TopicConventionFactory;
import com.linkedin.gms.factory.common.TopicConventionFactory;
import com.linkedin.common.urn.DatasetUrn;
import com.linkedin.metadata.aspect.DatasetAspect;
import com.linkedin.metadata.dao.EbeanLocalDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.dataset.factory;
package com.linkedin.gms.factory.dataset;

import com.linkedin.metadata.dao.Neo4jQueryDAO;
import org.neo4j.driver.Driver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.dataset.factory;
package com.linkedin.gms.factory.dataset;

import com.linkedin.metadata.configs.DatasetSearchConfig;
import com.linkedin.metadata.dao.search.ESSearchDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linkedin.identity.factory;
package com.linkedin.gms.factory.identity;

import com.linkedin.common.factory.TopicConventionFactory;
import com.linkedin.gms.factory.common.TopicConventionFactory;
import com.linkedin.common.urn.CorpGroupUrn;
import com.linkedin.metadata.aspect.CorpGroupAspect;
import com.linkedin.metadata.dao.EbeanLocalDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.identity.factory;
package com.linkedin.gms.factory.identity;

import com.linkedin.metadata.configs.CorpGroupSearchConfig;
import com.linkedin.metadata.dao.search.ESSearchDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linkedin.identity.factory;
package com.linkedin.gms.factory.identity;

import com.linkedin.common.factory.TopicConventionFactory;
import com.linkedin.gms.factory.common.TopicConventionFactory;
import com.linkedin.common.urn.CorpuserUrn;
import com.linkedin.metadata.aspect.CorpUserAspect;
import com.linkedin.metadata.dao.EbeanLocalDAO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linkedin.identity.factory;
package com.linkedin.gms.factory.identity;

import com.linkedin.metadata.configs.CorpUserSearchConfig;
import com.linkedin.metadata.dao.search.ESSearchDAO;
Expand Down
2 changes: 1 addition & 1 deletion gms/war/src/main/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-lazy-init="true">

<context:component-scan base-package="com.linkedin.common.factory,com.linkedin.dataset.factory,com.linkedin.identity.factory,com.linkedin.dataprocess.factory" />
<context:component-scan base-package="com.linkedin.gms.factory" />

<!-- An InjectResourceFactory must be created. It is ApplicationContextAware so
must be instantiated via spring and then passed into rest.li -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.linkedin.common.factory.RestHighLevelClientFactory;
import com.linkedin.gms.factory.common.RestHighLevelClientFactory;
import com.linkedin.metadata.builders.search.RegisteredIndexBuilders;
import com.linkedin.metadata.builders.search.SnapshotProcessor;
import com.linkedin.metadata.utils.elasticsearch.ElasticsearchConnector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.linkedin.common.factory.Neo4jDriverFactory;
import com.linkedin.gms.factory.common.Neo4jDriverFactory;
import com.linkedin.metadata.dao.internal.BaseGraphWriterDAO;
import com.linkedin.metadata.dao.internal.Neo4jGraphWriterDAO;

Expand Down

0 comments on commit 0f68f86

Please sign in to comment.