Skip to content

Commit

Permalink
Code that print files required for further investigation was added. M…
Browse files Browse the repository at this point in the history
…igration to JDK 17.
  • Loading branch information
andrii0lomakin committed Jan 8, 2024
1 parent 10cf999 commit 59874e2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ subprojects {

tasks.compileKotlin {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
languageVersion = libs.versions.kotlin.lang.get()
apiVersion = libs.versions.kotlin.lang.get()
}
}
tasks.compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
languageVersion = libs.versions.kotlin.lang.get()
apiVersion = libs.versions.kotlin.lang.get()
}
Expand All @@ -178,7 +178,7 @@ subprojects {
withSourcesJar()

toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ class GarbageCollector(internal val environment: EnvironmentImpl) {
utilizationProfile.removeFile(file)
currentFile[0] = file
environment.removeFiles(
currentFile,
if (ec.gcRenameFiles) RemoveBlockType.Rename else RemoveBlockType.Delete
currentFile,
if (ec.gcRenameFiles) RemoveBlockType.Rename else RemoveBlockType.Delete
)
aFileWasDeleted = true
}
Expand Down Expand Up @@ -219,8 +219,8 @@ class GarbageCollector(internal val environment: EnvironmentImpl) {
environment.flushAndSync()
val filesArray = filesToDelete.toArray()
environment.removeFiles(
filesArray,
if (ec.gcRenameFiles) RemoveBlockType.Rename else RemoveBlockType.Delete
filesArray,
if (ec.gcRenameFiles) RemoveBlockType.Rename else RemoveBlockType.Delete
)
filesArray.forEach { utilizationProfile.removeFile(it) }
utilizationProfile.estimateTotalBytesAndWakeGcIfNecessary()
Expand Down Expand Up @@ -351,10 +351,10 @@ class GarbageCollector(internal val environment: EnvironmentImpl) {
val high = log.highReadAddress
val highFile = log.highFileAddress
logger.debug(
String.format(
"Cleaner acquired txn when log high address was: %d (%s@%d) when cleaning file %s",
high, LogUtil.getLogFilename(highFile), high - highFile, LogUtil.getLogFilename(fileAddress)
)
String.format(
"Cleaner acquired txn when log high address was: %d (%s@%d) when cleaning file %s",
high, LogUtil.getLogFilename(highFile), high - highFile, LogUtil.getLogFilename(fileAddress)
)
)
}

Expand All @@ -374,6 +374,26 @@ class GarbageCollector(internal val environment: EnvironmentImpl) {
if (store == null) {
// TODO: remove openStoresCache when txn.openStoreByStructureId() is fast enough (XD-381)
store = txn.openStoreByStructureId(structureId)

if (loggable.address == 520806663897L) {
val tree = txn.getTree(store)
val iterator = tree.addressIterator()
println("Dear Roman please send me the following files:")
var lastFile = -1L

while(iterator.hasNext()) {
val address = iterator.next()
val currentFileAddress = log.getFileAddress(address)

if (lastFile != currentFileAddress) {
println(LogUtil.getLogFilename(currentFileAddress))
lastFile = currentFileAddress
}
}
}

println("Thank you, Roman !")

openStoresCache[structureId] = store
}
store.reclaim(txn, loggable, loggables)
Expand Down

0 comments on commit 59874e2

Please sign in to comment.