Skip to content

Commit a06b318

Browse files
lint(restore-indices): clean-up restore indices class (datahub-project#11176)
1 parent 841cb5b commit a06b318

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

datahub-upgrade/src/main/java/com/linkedin/datahub/upgrade/config/RestoreIndicesConfig.java

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,23 @@
88
import io.ebean.Database;
99
import javax.annotation.Nonnull;
1010
import lombok.extern.slf4j.Slf4j;
11-
import org.springframework.beans.factory.annotation.Autowired;
1211
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
13-
import org.springframework.context.ApplicationContext;
1412
import org.springframework.context.annotation.Bean;
1513
import org.springframework.context.annotation.Configuration;
16-
import org.springframework.context.annotation.DependsOn;
1714

1815
@Slf4j
1916
@Configuration
2017
public class RestoreIndicesConfig {
21-
@Autowired ApplicationContext applicationContext;
2218

2319
@Bean(name = "restoreIndices")
24-
@DependsOn({
25-
"ebeanServer",
26-
"entityService",
27-
"systemMetadataService",
28-
"searchService",
29-
"graphService"
30-
})
3120
@ConditionalOnProperty(name = "entityService.impl", havingValue = "ebean", matchIfMissing = true)
3221
@Nonnull
33-
public RestoreIndices createInstance() {
34-
final Database ebeanServer = applicationContext.getBean(Database.class);
35-
final EntityService<?> entityService = applicationContext.getBean(EntityService.class);
36-
final SystemMetadataService systemMetadataService =
37-
applicationContext.getBean(SystemMetadataService.class);
38-
final EntitySearchService entitySearchService =
39-
applicationContext.getBean(EntitySearchService.class);
40-
final GraphService graphService = applicationContext.getBean(GraphService.class);
41-
22+
public RestoreIndices createInstance(
23+
final Database ebeanServer,
24+
final EntityService<?> entityService,
25+
final EntitySearchService entitySearchService,
26+
final GraphService graphService,
27+
final SystemMetadataService systemMetadataService) {
4228
return new RestoreIndices(
4329
ebeanServer, entityService, systemMetadataService, entitySearchService, graphService);
4430
}

0 commit comments

Comments
 (0)