Skip to content

Commit

Permalink
moved cache and compression to core packages
Browse files Browse the repository at this point in the history
  • Loading branch information
simerplaha committed Nov 17, 2021
1 parent 1bac172 commit ec5f447
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion actor/src/main/scala/swaydb/Actor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package swaydb
import com.typesafe.scalalogging.LazyLogging
import swaydb.ActorConfig.QueueOrder
import swaydb.Bag.Implicits._
import swaydb.cache.{Cache, CacheNoIO}
import swaydb.core.cache.{Cache, CacheNoIO}
import swaydb.effect.Reserve
import swaydb.utils.{AtomicThreadLocalBoolean, FunctionSafe, Options}

Expand Down
2 changes: 1 addition & 1 deletion actor/src/main/scala/swaydb/ActorHooks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package swaydb

import com.typesafe.scalalogging.LazyLogging
import swaydb.IO.ExceptionHandler
import swaydb.cache.CacheNoIO
import swaydb.core.cache.CacheNoIO

import scala.concurrent.ExecutionContext

Expand Down
16 changes: 8 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ lazy val SwayDB =
`core-interop`,
actor,
stream,
cache,
`core-cache`,
swaydb,
`swaydb-java`,
compression,
`core-compression`,
configs,
serializers,
`x-interop-boopickle`,
Expand Down Expand Up @@ -196,13 +196,13 @@ lazy val core =
utils,
`core-queue`,
slice,
cache,
`core-cache`,
actor,
compression,
`core-compression`,
`core-skiplist`,
testkit % Test,
macros % "test->test;compile-internal",
compression % Test,
`core-compression` % Test,
configs % Test,
serializers % Test
)
Expand Down Expand Up @@ -266,7 +266,7 @@ lazy val actor =
.settings(commonSettings)
.settings(publishSettings)
.settings(libraryDependencies ++= commonDependencies(scalaVersion.value))
.dependsOn(effect, cache)
.dependsOn(effect, `core-cache`)

lazy val stream =
project
Expand All @@ -275,7 +275,7 @@ lazy val stream =
.settings(libraryDependencies ++= commonDependencies(scalaVersion.value))
.dependsOn(effect, utils, testkit % Test)

lazy val cache =
lazy val `core-cache` =
project
.settings(commonSettings)
.settings(publishSettings)
Expand Down Expand Up @@ -323,7 +323,7 @@ lazy val `core-performance` =
.settings(libraryDependencies ++= testDependencies(scalaVersion.value))
.dependsOn(core)

lazy val compression =
lazy val `core-compression` =
project
.settings(commonSettings)
.settings(publishSettings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package swaydb.cache
package swaydb.core.cache

import com.typesafe.scalalogging.LazyLogging
import swaydb.IO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package swaydb.cache
package swaydb.core.cache

import swaydb.IO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package swaydb.cache
package swaydb.core.cache

import org.scalamock.scalatest.MockFactory
import org.scalatest.matchers.should.Matchers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package swaydb.cache
package swaydb.core.cache

import org.scalamock.scalatest.MockFactory
import org.scalatest.matchers.should.Matchers
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import swaydb.Error.Segment.ExceptionHandler
import swaydb.IO
import swaydb.cache.Cache
import swaydb.core.cache.Cache
import swaydb.core.CommonAssertions._
import swaydb.Benchmark
import swaydb.effect.Reserve
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/swaydb/core/data/KeyValue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package swaydb.core.data

import swaydb.cache.{Cache, CacheNoIO}
import swaydb.core.cache.{Cache, CacheNoIO}
import swaydb.core.log.serializer.RangeValueSerializer.OptionRangeValueSerializer
import swaydb.core.log.serializer.{RangeValueSerializer, ValueSerializer}
import swaydb.core.segment.assigner.Assignable
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/swaydb/core/io/file/DBFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package swaydb.core.io.file

import com.typesafe.scalalogging.LazyLogging
import swaydb.Error.IO.ExceptionHandler
import swaydb.cache.Cache
import swaydb.core.cache.Cache
import swaydb.core.sweeper.ByteBufferSweeper.ByteBufferSweeperActor
import swaydb.core.sweeper.{ByteBufferSweeper, FileSweeper, FileSweeperItem}
import swaydb.config.ForceSave
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package swaydb.core.segment
import com.typesafe.scalalogging.LazyLogging
import swaydb.Error.Segment.ExceptionHandler
import swaydb.IO
import swaydb.cache.{Cache, CacheNoIO}
import swaydb.core.cache.{Cache, CacheNoIO}
import swaydb.core.data._
import swaydb.core.function.FunctionStore
import swaydb.core.io.file.{DBFile, ForceSaveApplier}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package swaydb.core.segment.block

import com.typesafe.scalalogging.LazyLogging
import swaydb.cache.Cache
import swaydb.core.cache.Cache
import swaydb.core.sweeper.MemorySweeper
import swaydb.utils.HashedMap
import swaydb.slice.{Slice, SliceOption, SliceRO, Slices}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package swaydb.core.segment.block

import swaydb.cache.CacheNoIO
import swaydb.core.cache.CacheNoIO
import swaydb.core.sweeper.MemorySweeper
import swaydb.utils.HashedMap
import swaydb.slice.{Slice, SliceOption}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package swaydb.core.segment.block.segment

import swaydb.Error.Segment.ExceptionHandler
import swaydb.cache.{Cache, Lazy}
import swaydb.core.cache.{Cache, Lazy}
import swaydb.core.data.Persistent
import swaydb.core.io.file.DBFile
import swaydb.core.segment.block.binarysearch.{BinarySearchIndexBlock, BinarySearchIndexBlockOffset}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import swaydb.ActorConfig.QueueOrder
import swaydb.Bag.Implicits._
import swaydb.Error.IO.ExceptionHandler
import swaydb._
import swaydb.cache.{Cache, CacheNoIO}
import swaydb.core.cache.{Cache, CacheNoIO}
import swaydb.core.io.file.ForceSaveApplier
import swaydb.core.sweeper.ByteBufferCleaner.Cleaner
import swaydb.utils.English
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/swaydb/core/sweeper/FileSweeper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package swaydb.core.sweeper
import com.typesafe.scalalogging.LazyLogging
import swaydb.ActorConfig.QueueOrder
import swaydb.Bag.Implicits._
import swaydb.cache.CacheNoIO
import swaydb.core.cache.CacheNoIO
import swaydb.core.level.zero.LevelZero
import swaydb.core.level.{LevelRef, NextLevel}
import swaydb.config.FileCache
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/scala/swaydb/core/sweeper/MemorySweeper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package swaydb.core.sweeper

import com.typesafe.scalalogging.LazyLogging
import swaydb.ActorConfig.QueueOrder
import swaydb.cache.CacheNoIO
import swaydb.core.cache.CacheNoIO
import swaydb.core.data.Persistent
import swaydb.utils.HashedMap
import swaydb.core.skiplist.SkipList
Expand All @@ -37,7 +37,7 @@ private[core] object Command {
val skipListRef: WeakReference[SkipList[_, _, Slice[Byte], _]]) extends Command

private[sweeper] class Cache(val weight: Int,
val cache: WeakReference[swaydb.cache.Cache[_, _, _]]) extends Command
val cache: WeakReference[swaydb.core.cache.Cache[_, _, _]]) extends Command

private[sweeper] class SkipListMap(val key: Slice[Byte],
val weight: Int,
Expand Down Expand Up @@ -213,11 +213,11 @@ private[core] object MemorySweeper extends LazyLogging {

sealed trait Cache extends On {

def add(weight: Int, cache: swaydb.cache.Cache[_, _, _]): Unit =
def add(weight: Int, cache: swaydb.core.cache.Cache[_, _, _]): Unit =
if (actor.isDefined) {
actor.get send new Command.Cache(
weight = weight,
cache = new WeakReference[swaydb.cache.Cache[_, _, _]](cache)
cache = new WeakReference[swaydb.core.cache.Cache[_, _, _]](cache)
)
} else {
val exception = new Exception("Cache is not enabled")
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/swaydb/core/TestCaseSweeper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package swaydb.core

import com.typesafe.scalalogging.LazyLogging
import swaydb.cache.{Cache, CacheNoIO}
import swaydb.core.cache.{Cache, CacheNoIO}
import swaydb.configs.level.DefaultExecutionContext
import swaydb.core.TestSweeper._
import swaydb.core.io.file.{DBFile, ForceSaveApplier}
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/scala/swaydb/core/TestData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.scalatest.matchers.should.Matchers._
import swaydb.Error.Segment.ExceptionHandler
import swaydb.IO.ExceptionHandler.Nothing
import swaydb.IOValues._
import swaydb.cache.Cache
import swaydb.core.cache.Cache
import swaydb.compression.CompressionInternal
import swaydb.compression.CompressionTestGen._
import swaydb.config.accelerate.Accelerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package swaydb.core.segment

import swaydb.cache.Cache
import swaydb.core.cache.Cache
import swaydb.core.TestBase
import swaydb.core.data.Persistent._
import swaydb.core.data.Value.FromValueOption
Expand Down

0 comments on commit ec5f447

Please sign in to comment.