Skip to content

Commit

Permalink
Merge pull request #161 from openlattice/task/LATTICE-3050-sql-fixes
Browse files Browse the repository at this point in the history
Remaining fixes and modification for study + participant migration
  • Loading branch information
UnsungHero97 authored Feb 19, 2022
2 parents d725b4c + 47285c1 commit b02546a
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,35 @@ package com.openlattice.mechanic.pods

import com.codahale.metrics.MetricRegistry
import com.geekbeast.hazelcast.HazelcastClientProvider
import com.geekbeast.jdbc.DataSourceManager
import com.geekbeast.rhizome.configuration.RhizomeConfiguration
import com.geekbeast.rhizome.jobs.HazelcastJobService
import com.geekbeast.rhizome.pods.ConfigurationLoader
import com.google.common.eventbus.EventBus
import com.google.common.util.concurrent.ListeningExecutorService
import com.hazelcast.core.HazelcastInstance
import com.geekbeast.rhizome.configuration.RhizomeConfiguration
import com.geekbeast.rhizome.pods.ConfigurationLoader
import com.openlattice.assembler.AssemblerConfiguration
import com.openlattice.auditing.AuditRecordEntitySetsManager
import com.openlattice.auditing.AuditingConfiguration
import com.openlattice.auditing.pods.AuditingConfigurationPod
import com.openlattice.authorization.*
import com.openlattice.authorization.AuthorizationManager
import com.openlattice.authorization.DbCredentialService
import com.openlattice.authorization.HazelcastAclKeyReservationService
import com.openlattice.authorization.HazelcastAuthorizationService
import com.openlattice.authorization.HazelcastPrincipalsMapManager
import com.openlattice.authorization.Principals
import com.openlattice.authorization.PrincipalsMapManager
import com.openlattice.authorization.mapstores.ResolvedPrincipalTreesMapLoader
import com.openlattice.conductor.rpc.ConductorConfiguration
import com.openlattice.conductor.rpc.ConductorElasticsearchApi
import com.openlattice.data.DataDeletionManager
import com.openlattice.data.EntityKeyIdService
import com.openlattice.data.ids.PostgresEntityKeyIdService
import com.openlattice.data.storage.*
import com.openlattice.data.storage.ByteBlobDataManager
import com.openlattice.data.storage.DataDeletionService
import com.openlattice.data.storage.DataSourceResolver
import com.openlattice.data.storage.EntityDatastore
import com.openlattice.data.storage.IndexingMetadataManager
import com.openlattice.data.storage.postgres.PostgresEntityDataQueryService
import com.openlattice.data.storage.postgres.PostgresEntityDatastore
import com.openlattice.datasets.DataSetService
Expand All @@ -54,7 +66,6 @@ import com.openlattice.graph.core.GraphService
import com.openlattice.ids.HazelcastIdGenerationService
import com.openlattice.ids.HazelcastLongIdService
import com.openlattice.ioc.providers.LateInitProvider
import com.geekbeast.jdbc.DataSourceManager
import com.openlattice.linking.LinkingQueryService
import com.openlattice.linking.PostgresLinkingFeedbackService
import com.openlattice.linking.graph.PostgresLinkingQueryService
Expand Down Expand Up @@ -132,6 +143,9 @@ class MechanicUpgradePod {
@Inject
private lateinit var toolbox: Toolbox

@Inject
private lateinit var rptml: ResolvedPrincipalTreesMapLoader

@Bean
fun conductorConfiguration(): ConductorConfiguration {
return configurationLoader.logAndLoad("conductor", ConductorConfiguration::class.java)
Expand Down Expand Up @@ -325,7 +339,7 @@ class MechanicUpgradePod {
}

@Bean
fun principalsManager(): SecurePrincipalsManager {
fun principalService(): SecurePrincipalsManager {
return HazelcastPrincipalService(
hazelcastInstance,
aclKeyReservationService(),
Expand Down Expand Up @@ -358,15 +372,16 @@ class MechanicUpgradePod {
fun v3StudyMigration(): V3StudyMigrationUpgrade {
return V3StudyMigrationUpgrade(
toolbox,
hikariDataSource,
principalsManager(),
rhizomeConfiguration,
principalService(),
dataQueryService(),
searchService()
)
}

@PostConstruct
fun post() {
Principals.init(principalService(), hazelcastInstance)
lateInitProvider.setDataSourceResolver(dataSourceResolver())
}
}
Loading

0 comments on commit b02546a

Please sign in to comment.