Object

swaydb

SwayDB

Related Doc: package swaydb

Permalink

object SwayDB extends LazyLogging

Instance used for creating/initialising databases.

Linear Supertypes
LazyLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SwayDB
  2. LazyLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply[T](config: SwayDBMemoryConfig)(implicit serializer: Serializer[T], ordering: Ordering[Slice[Byte]], ec: ExecutionContext): Try[SwayDBSet[T]]

    Permalink
  5. def apply[K, V](config: SwayDBMemoryConfig)(implicit keySerializer: Serializer[K], valueSerializer: Serializer[V], ordering: Ordering[Slice[Byte]], ec: ExecutionContext): Try[SwayDBMap[K, V]]

    Permalink
  6. def apply[T](config: SwayDBPersistentConfig, maxSegmentsOpen: Int, cacheSize: Long, cacheCheckDelay: FiniteDuration, segmentsOpenCheckDelay: FiniteDuration)(implicit serializer: Serializer[T], ordering: Ordering[Slice[Byte]], ec: ExecutionContext): Try[SwayDBSet[T]]

    Permalink
  7. def apply[K, V](config: SwayDBPersistentConfig, maxSegmentsOpen: Int, cacheSize: Long, cacheCheckDelay: FiniteDuration, segmentsOpenCheckDelay: FiniteDuration)(implicit keySerializer: Serializer[K], valueSerializer: Serializer[V], ordering: Ordering[Slice[Byte]], ec: ExecutionContext): Try[SwayDBMap[K, V]]

    Permalink

    Creates a database based on the input config.

    Creates a database based on the input config.

    K

    Type of key

    V

    Type of value

    config

    Configuration to use to create the database

    maxSegmentsOpen

    Number of concurrent opened Segments

    cacheSize

    For persistent Levels only. This can property will be ignored for MemoryLevels. Size of in-memory key-values

    cacheCheckDelay

    For persistent Levels only. This can property will be ignored for MemoryLevels. Sets the max interval at which key-values get dropped from the cache. The delays are dynamically adjusted based on the current size of the cache to stay close the set cacheSize.

    segmentsOpenCheckDelay

    For persistent Levels only. This can property will be ignored for MemoryLevels. Sets the max interval at which Segments get closed. The delays are dynamically adjusted based on the current number of open Segments.

    keySerializer

    Converts keys to Bytes

    valueSerializer

    Converts values to Bytes

    ordering

    Sort order for keys

    ec

    ExecutionContext

    returns

    Database instance

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def defaultExecutionContext: ExecutionContext { val threadPool: scala.concurrent.forkjoin.ForkJoinPool }

    Permalink

    Default execution context for all databases.

    Default execution context for all databases.

    This can be overridden by provided an implicit parameter in the scope of where the database is initialized.

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  18. def memory[K, V](mapSize: Int = 4.mb, segmentSize: Int = 2.mb, bloomFilterFalsePositiveRate: Double = 0.01, minTimeLeftToUpdateExpiration: FiniteDuration = 10.seconds, acceleration: (Level0Meter) ⇒ Accelerator = Accelerator.noBrakes())(implicit keySerializer: Serializer[K], valueSerializer: Serializer[V], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[SwayDBMap[K, V]]

    Permalink

    A 2 Leveled (Level0 & Level1), in-memory database.

    A 2 Leveled (Level0 & Level1), in-memory database.

    For custom configurations read documentation on website: http://www.swaydb.io/configuring-levels

    mapSize

    size of Level0 maps before they are converted into Segments

    segmentSize

    size of Level1 Segments

    acceleration

    Controls the write speed.

    keySerializer

    Converts keys to Bytes

    valueSerializer

    Converts values to Bytes

    ordering

    Sort order for keys

  19. def memoryPersistent[K, V](dir: Path, maxOpenSegments: Int = 1000, mapSize: Int = 4.mb, maxMemoryLevelSize: Int = 100.mb, maxSegmentsToPush: Int = 10, memoryLevelSegmentSize: Int = 2.mb, persistentLevelSegmentSize: Int = 2.mb, persistentLevelAppendixFlushCheckpointSize: Int = 2.mb, mmapPersistentSegments: MMAP = MMAP.WriteAndRead, mmapPersistentAppendix: Boolean = true, cacheSize: Long = 100.mb, otherDirs: Seq[Dir] = Seq.empty, cacheCheckDelay: FiniteDuration = 5.seconds, segmentsOpenCheckDelay: FiniteDuration = 5.seconds, bloomFilterFalsePositiveRate: Double = 0.01, minTimeLeftToUpdateExpiration: FiniteDuration = 10.seconds, acceleration: (Level0Meter) ⇒ Accelerator = Accelerator.noBrakes())(implicit keySerializer: Serializer[K], valueSerializer: Serializer[V], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[SwayDBMap[K, V]]

    Permalink

    A 3 Leveled in-memory database where the 3rd is persistent.

    A 3 Leveled in-memory database where the 3rd is persistent.

    For custom configurations read documentation on website: http://www.swaydb.io/configuring-levels

    K

    Type of key

    V

    Type of value

    dir

    Root directory for all Level where appendix folder & files are created

    maxOpenSegments

    Number of concurrent Segments opened

    mapSize

    Size of LevelZero's maps (WAL)

    maxMemoryLevelSize

    Total size of in-memory Level (Level1) before Segments gets pushed to persistent Level (Level2)

    maxSegmentsToPush

    Numbers of Segments to push from in-memory Level (Level1) to persistent Level (Level2)

    memoryLevelSegmentSize

    Size of Level1's Segments

    persistentLevelSegmentSize

    Size of Level2's Segments

    mmapPersistentSegments

    Memory-maps Level2 Segments

    mmapPersistentAppendix

    Memory-maps Level2's appendix file

    cacheSize

    Size of

    otherDirs

    Secondary directories for all Levels where Segments get distributed.

    cacheCheckDelay

    Sets the max interval at which key-values get dropped from the cache. The delays are dynamically adjusted based on the current size of the cache to stay close the set cacheSize.

    segmentsOpenCheckDelay

    Sets the max interval at which Segments get closed. The delays are dynamically adjusted based on the current number of open Segments.

    acceleration

    Controls the write speed.

    keySerializer

    Converts keys to Bytes

    valueSerializer

    Converts values to Bytes

    ordering

    Sort order for keys

    ec

    ExecutionContext

    returns

    Database instance

  20. def memoryPersistentSet[T](dir: Path, maxOpenSegments: Int = 1000, mapSize: Int = 4.mb, maxMemoryLevelSize: Int = 100.mb, maxSegmentsToPush: Int = 10, memoryLevelSegmentSize: Int = 2.mb, persistentLevelSegmentSize: Int = 2.mb, persistentLevelAppendixFlushCheckpointSize: Int = 2.mb, mmapPersistentSegments: MMAP = MMAP.WriteAndRead, mmapPersistentAppendix: Boolean = true, cacheSize: Long = 100.mb, otherDirs: Seq[Dir] = Seq.empty, cacheCheckDelay: FiniteDuration = 5.seconds, segmentsOpenCheckDelay: FiniteDuration = 5.seconds, bloomFilterFalsePositiveRate: Double = 0.01, minTimeLeftToUpdateExpiration: FiniteDuration = 10.seconds, acceleration: (Level0Meter) ⇒ Accelerator = Accelerator.noBrakes())(implicit serializer: Serializer[T], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[SwayDBSet[T]]

    Permalink

    For custom configurations read documentation on website: http://www.swaydb.io/configuring-levels

  21. def memorySet[T](mapSize: Int = 4.mb, segmentSize: Int = 2.mb, bloomFilterFalsePositiveRate: Double = 0.01, minTimeLeftToUpdateExpiration: FiniteDuration = 10.seconds, acceleration: (Level0Meter) ⇒ Accelerator = Accelerator.noBrakes())(implicit serializer: Serializer[T], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[SwayDBSet[T]]

    Permalink

    For custom configurations read documentation on website: http://www.swaydb.io/configuring-levels

  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def persistent[K, V](dir: Path, maxOpenSegments: Int = 1000, cacheSize: Long = 100.mb, mapSize: Int = 4.mb, mmapMaps: Boolean = true, recoveryMode: RecoveryMode = RecoveryMode.ReportFailure, mmapAppendix: Boolean = true, mmapSegments: MMAP = MMAP.WriteAndRead, segmentSize: Int = 2.mb, appendixFlushCheckpointSize: Int = 2.mb, otherDirs: Seq[Dir] = Seq.empty, cacheCheckDelay: FiniteDuration = 5.seconds, segmentsOpenCheckDelay: FiniteDuration = 5.seconds, bloomFilterFalsePositiveRate: Double = 0.01, minTimeLeftToUpdateExpiration: FiniteDuration = 10.seconds, acceleration: (Level0Meter) ⇒ Accelerator = Accelerator.noBrakes())(implicit keySerializer: Serializer[K], valueSerializer: Serializer[V], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[SwayDBMap[K, V]]

    Permalink

    A pre-configured, 8 Leveled, persistent database where Level1 accumulates a minimum of 10 Segments before pushing Segments to lower Level.

    A pre-configured, 8 Leveled, persistent database where Level1 accumulates a minimum of 10 Segments before pushing Segments to lower Level.

    For custom configurations read documentation on website: http://www.swaydb.io/configuring-levels

    K

    Type of key

    V

    Type of value

    dir

    Root directory for all Level where appendix folder & files are created

    maxOpenSegments

    Number of concurrent Segments opened

    cacheSize

    Size of in-memory key-values

    mapSize

    Size of LevelZero's maps (WAL)

    mmapMaps

    Memory-maps LevelZero maps files if set to true else reverts java.nio.FileChannel

    mmapAppendix

    Memory-maps Levels appendix files if set to true else reverts java.nio.FileChannel

    mmapSegments

    Memory-maps Levels Segment files if set to true else reverts java.nio.FileChannel

    segmentSize

    Minimum size of Segment files in each Level

    appendixFlushCheckpointSize

    Size of the appendix file before it's flushed. Appendix files are append only log files. Flushing removes deleted entries in the file hence reducing the size of the file.

    otherDirs

    Secondary directories for all Levels where Segments get distributed.

    cacheCheckDelay

    Sets the max interval at which key-values get dropped from the cache. The delays are dynamically adjusted based on the current size of the cache to stay close the set cacheSize.

    segmentsOpenCheckDelay

    Sets the max interval at which Segments get closed. The delays are dynamically adjusted based on the current number of open Segments.

    acceleration

    Controls the write speed.

    keySerializer

    Converts keys to Bytes

    valueSerializer

    Converts values to Bytes

    ordering

    Sort order for keys

    ec

    ExecutionContext

    returns

    Database instance

  26. def persistentSet[T](dir: Path, maxOpenSegments: Int = 1000, cacheSize: Long = 100.mb, mapSize: Int = 4.mb, mmapMaps: Boolean = true, recoveryMode: RecoveryMode = RecoveryMode.ReportFailure, mmapAppendix: Boolean = true, mmapSegments: MMAP = MMAP.WriteAndRead, segmentSize: Int = 2.mb, appendixFlushCheckpointSize: Int = 2.mb, otherDirs: Seq[Dir] = Seq.empty, cacheCheckDelay: FiniteDuration = 5.seconds, segmentsOpenCheckDelay: FiniteDuration = 5.seconds, bloomFilterFalsePositiveRate: Double = 0.01, minTimeLeftToUpdateExpiration: FiniteDuration = 10.seconds, acceleration: (Level0Meter) ⇒ Accelerator = Accelerator.noBrakes())(implicit serializer: Serializer[T], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[SwayDBSet[T]]

    Permalink

    For custom configurations read documentation on website: http://www.swaydb.io/configuring-levels

  27. def repairAppendix[K](levelPath: Path, repairStrategy: AppendixRepairStrategy)(implicit serializer: Serializer[K], ordering: Ordering[Slice[Byte]] = KeyOrder.default, ec: ExecutionContext = defaultExecutionContext): Try[RepairResult[K]]

    Permalink

    Documentation: http://www.swaydb.io/api/repairAppendix

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from LazyLogging

Inherited from AnyRef

Inherited from Any

Ungrouped