Skip to content

Commit

Permalink
Changes in logging during store removal refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii0lomakin committed Jan 31, 2024
1 parent 3b7dd7b commit cffcf77
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions environment/src/main/kotlin/jetbrains/exodus/env/Environments.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,21 @@ object Environments : KLogging() {
val ec = env.environmentConfig

if (env.environmentConfig.storesToRemoveBeforeCompaction != null) {
env.executeInTransaction { tx ->
val storesToRemove = env.environmentConfig.storesToRemoveBeforeCompaction.split(",")
EnvironmentImpl.loggerInfo(
"Store(s) are(is) ${env.environmentConfig.storesToRemoveBeforeCompaction} " +
"going to be removed from the database."
)
}

for (storeToRemove in storesToRemove) {
if (env.storeExists(storeToRemove, tx)) {
env.removeStore(storeToRemove, tx)
}
env.executeInTransaction { tx ->
val storesToRemove = env.environmentConfig.storesToRemoveBeforeCompaction.split(",")

for (storeToRemove in storesToRemove) {
if (env.storeExists(storeToRemove, tx)) {
env.removeStore(storeToRemove, tx)
EnvironmentImpl.loggerInfo("$storeToRemove is removed from database")
}
}
EnvironmentImpl.loggerInfo(
"Store(s) ${env.environmentConfig.storesToRemoveBeforeCompaction} was(were) removed from the database."
)
}

val needsToBeMigrated = !env.log.formatWithHashCodeIsUsed
Expand Down

0 comments on commit cffcf77

Please sign in to comment.