Skip to content

Commit

Permalink
minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
simerplaha committed Nov 30, 2021
1 parent 966b7cb commit e4cd50d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ private[core] object KeyValueGrouper extends LazyLogging {

def add[T[_]](keyValue: KeyValue,
builder: MergeStats[Memory, T],
isLastLevel: Boolean): Unit = {
isLastLevel: Boolean): Unit =
if (isLastLevel) {
val keyValueToMergeOrNull = toLastLevelOrNull(keyValue)
if (keyValueToMergeOrNull != null)
builder addOne keyValueToMergeOrNull
} else {
builder addOne keyValue.toMemory()
}
}

def toLastLevelOrNull(keyValue: KeyValue): Memory =
keyValue match {
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/scala/swaydb/core/segment/ref/SegmentRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ private[core] class SegmentRef(val path: Path,
private[segment] def addToSkipList(keyValue: Persistent): Unit =
skipList foreach {
skipList =>
//cut not required anymore since SegmentSearch always cutd.
//keyValue.cutKeys
//cut not required anymore since SegmentSearch always cut.
//keyValue.cutKeys()
if (skipList.putIfAbsent(keyValue.key, keyValue))
keyValueMemorySweeper.foreach(_.add(keyValue, skipList))
}
Expand Down Expand Up @@ -217,13 +217,13 @@ private[core] class SegmentRef(val path: Path,
def cachedKeyValueSize: Int =
skipList.foldLeft(0)(_ + _.size)

def clearCachedKeyValues() =
def clearCachedKeyValues(): Unit =
skipList.foreach(_.clear())

def clearAllCaches() =
def clearAllCaches(): Unit =
segmentBlockCache.clear()

def areAllCachesEmpty =
def areAllCachesEmpty: Boolean =
isKeyValueCacheEmpty && !segmentBlockCache.isCached

def readAllBytes(): Slice[Byte] =
Expand Down

0 comments on commit e4cd50d

Please sign in to comment.