-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pluginRegistry): add configuration to reduce runnable frequency (#…
- Loading branch information
1 parent
d476f5f
commit eed0abe
Showing
6 changed files
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
@Data | ||
public class EntityRegistryPluginConfiguration { | ||
String path; | ||
int loadDelaySeconds; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
...es/src/main/java/com/linkedin/gms/factory/entityregistry/PluginEntityRegistryFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
package com.linkedin.gms.factory.entityregistry; | ||
|
||
import com.linkedin.gms.factory.config.ConfigurationProvider; | ||
import com.linkedin.metadata.config.EntityRegistryPluginConfiguration; | ||
import com.linkedin.metadata.models.registry.PluginEntityRegistryLoader; | ||
import com.linkedin.metadata.spring.YamlPropertySourceFactory; | ||
import java.io.FileNotFoundException; | ||
import java.net.MalformedURLException; | ||
import javax.annotation.Nonnull; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.PropertySource; | ||
|
||
@Configuration | ||
@PropertySource(value = "classpath:/application.yml", factory = YamlPropertySourceFactory.class) | ||
public class PluginEntityRegistryFactory { | ||
|
||
@Value("${datahub.plugin.entityRegistry.path}") | ||
private String pluginRegistryPath; | ||
|
||
@Bean(name = "pluginEntityRegistry") | ||
@Nonnull | ||
protected PluginEntityRegistryLoader getInstance() | ||
protected PluginEntityRegistryLoader getInstance(ConfigurationProvider configurationProvider) | ||
throws FileNotFoundException, MalformedURLException { | ||
return new PluginEntityRegistryLoader(pluginRegistryPath); | ||
EntityRegistryPluginConfiguration pluginConfiguration = | ||
configurationProvider.getDatahub().getPlugin().getEntityRegistry(); | ||
return new PluginEntityRegistryLoader( | ||
pluginConfiguration.getPath(), pluginConfiguration.getLoadDelaySeconds()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters