Skip to content

Commit

Permalink
single export
Browse files Browse the repository at this point in the history
draft contains some todos
  • Loading branch information
guy-har committed Nov 8, 2020
1 parent fcffe26 commit cfb3774
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
8 changes: 1 addition & 7 deletions cmd/lakefs/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ var runCmd = &cobra.Command{
dedupCleaner := dedup.NewCleaner(blockStore, cataloger.DedupReportChannel())

// parade
paradeDBParams := cfg.GetParadeDatabaseParams()
paradeDBPool, err := db.ConnectDBPool(paradeDBParams)
if err != nil {
logger.WithError(err).Errorf("Failed to connect parade database")
}
paradeDB := parade.NewParadeDB(paradeDBPool)
paradeDB := parade.NewParadeDB(dbPool.Pool())
// export handler
exportHandler := export.NewHandler(blockStore, cataloger, paradeDB)
exportActionManager := parade.NewActionManager(exportHandler, paradeDB, nil)
Expand All @@ -105,7 +100,6 @@ var runCmd = &cobra.Command{
_ = cataloger.Close()
_ = dedupCleaner.Close()
exportActionManager.Close()
paradeDBPool.Close()
}()

// start API server
Expand Down
13 changes: 1 addition & 12 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import (
)

const (
DefaultDatabaseConnString = "postgres://localhost:5432/postgres?sslmode=disable"
DefaultParadeDatabaseConnString = "postgres://localhost:5432/parade?sslmode=disable"
DefaultDatabaseConnString = "postgres://localhost:5432/postgres?sslmode=disable"

DefaultBlockStoreType = "local"
DefaultBlockStoreLocalPath = "~/lakefs/data"
Expand Down Expand Up @@ -80,7 +79,6 @@ func setDefaults() {
viper.SetDefault("logging.output", DefaultLoggingOutput)

viper.SetDefault("database.connection_string", DefaultDatabaseConnString)
viper.SetDefault("parade.database.connection_string", DefaultParadeDatabaseConnString)

viper.SetDefault("auth.cache.enabled", DefaultAuthCacheEnabled)
viper.SetDefault("auth.cache.size", DefaultAuthCacheSize)
Expand Down Expand Up @@ -113,15 +111,6 @@ func (c *Config) GetDatabaseParams() dbparams.Database {
}
}

func (c *Config) GetParadeDatabaseParams() dbparams.Database {
return dbparams.Database{
ConnectionString: viper.GetString("parade.database.connection_string"),
MaxOpenConnections: viper.GetInt32("parade.database.max_open_connections"),
MaxIdleConnections: viper.GetInt32("parade.database.max_idle_connections"),
ConnectionMaxLifetime: viper.GetDuration("parade.database.connection_max_lifetime"),
}
}

func (c *Config) GetCatalogerCatalogParams() catalogparams.Catalog {
return catalogparams.Catalog{
BatchRead: catalogparams.BatchRead{
Expand Down

0 comments on commit cfb3774

Please sign in to comment.