Skip to content

Commit

Permalink
Fixes for Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Apr 17, 2024
1 parent b0e8161 commit eab9df4
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .jvmopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-Xms1024M
-Xmx4096M
-Xss512M
-XX:MaxMetaspaceSize=4096M
-XX:ReservedCodeCacheSize=500M
-XX:+TieredCompilation
-XX:-UseGCOverheadLimit
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# lightdb
Prototype database concept using Lucene and HaloDB
Prototype database concept using pluggable store + indexer

First working release with minimal functionality in `0.1.0`
## Provided Stores
- Yahoo's HaloDB (https://github.com/yahoo/HaloDB) - Preferred for performance
- MapDB (https://mapdb.org)
- Facebook's RocksDB (https://rocksdb.org)

## 0.2 TODO
- [X] Support ObjectStore.all to iterate over the entire database
## Provided Indexers
- Apache Lucene (https://lucene.apache.org) - Most featureful
- SQLite (https://www.sqlite.org) - Fastest

## 1.0 TODO
- [ ] Full implementations for indexers
- [ ] Apache Lucene index types
- [ ] SQLite index types
- [ ] More performance improvements to SQLite integration
- [ ] Better RocksDB performance
- [ ] Create backup and restore features
- [ ] Real-time backup (write changes to incremental file)
- [ ] Complete dump and restore
- [ ] Post-restore incremental restore
- [ ] Testing of empty database loads from backups if available
- [ ] Data integrity checks
- [ ] Verify data identical between store and index
- [ ] Rebuild index from store

## 1.0 TODO
- [ ] Complete Lucene type support
- [ ] Create benchmark tool to evaluate performance of basic operations to see how well this performs
- [ ] Create an SBT plugin to update base traits for case classes (ex. Person would generate PersonFields trait to be mixed into Person companion)
- [ ] Rebuild index from store
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Scala versions
val scala213 = "2.13.13"
val scala3 = "3.3.3"
val scala3 = "3.4.1"
val scala2 = List(scala213)
val allScalaVersions = scala3 :: scala2

Expand All @@ -18,7 +18,7 @@ ThisBuild / organization := org
ThisBuild / version := "0.4.0-SNAPSHOT"
ThisBuild / scalaVersion := scala213
ThisBuild / crossScalaVersions := allScalaVersions
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation")
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation", "-Yno-decode-stacktraces")
ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8")

ThisBuild / publishTo := sonatypePublishTo.value
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/Collection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ abstract class Collection[D <: Document[D]](val collectionName: String,
name = name,
createKey = createKey,
createV = createV,
store = db.createStoreInternal(s"$collectionName.indexed.$name"),
loadStore = () => db.createStoreInternal(s"$collectionName.indexed.$name"),
collection = this,
maxLinks = maxLinks
)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/IndexedLink.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package lightdb

import fabric.rw.RW
import fabric.rw._

case class IndexedLink[D <: Document[D]](_id: Id[IndexedLink[D]],
links: List[Id[D]]) extends Document[IndexedLink[D]]
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/scala/lightdb/IndexedLinks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import cats.effect.IO
case class IndexedLinks[V, D <: Document[D]](name: String,
createKey: V => String,
createV: D => V,
store: Store,
loadStore: () => Store,
collection: Collection[D],
maxLinks: MaxLinks) {
lazy val store: Store = loadStore()

protected[lightdb] def add(doc: D): IO[Unit] = {
val v = createV(doc)
for {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/KeyValue.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package lightdb

import fabric.Json
import fabric.rw.RW
import fabric.rw._

case class KeyValue(_id: Id[KeyValue], value: Json) extends Document[KeyValue]

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/lightdb/LightDB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package lightdb

import cats.effect.IO
import cats.implicits.{catsSyntaxApplicativeByName, catsSyntaxParallelSequence1}
import fabric.rw.RW
import fabric.rw._
import lightdb.upgrade.DatabaseUpgrade

import java.nio.file.Path
Expand Down

0 comments on commit eab9df4

Please sign in to comment.