Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package eu.cloudnetservice.cloudnet.gradle.util
object Files {

const val driver = "driver.jar"
const val common = "common.jar"
const val wrapper = "wrapper.jar"
const val launcher = "launcher.jar"
const val launcherPatcher = "launcher-patcher.jar"
Expand All @@ -33,10 +32,9 @@ object Files {
const val cloudflare = "cloudnet-cloudflare.jar"
const val dockerizedServices = "cloudnet-dockerized-services.jar"
const val databaseMongo = "cloudnet-database-mongodb.jar"
const val databaseMysql = "cloudnet-database-mysql.jar"
const val databaseSql = "cloudnet-database-sql.jar"
const val labymod = "cloudnet-labymod.jar"
const val npcs = "cloudnet-npcs.jar"
const val rest = "cloudnet-rest.jar"
const val signs = "cloudnet-signs.jar"
const val smart = "cloudnet-smart.jar"
const val syncproxy = "cloudnet-syncproxy.jar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@
*/
public interface DatabaseProvider {

/**
* Gets if this database provider produces databases that are synced to the cluster. This means that every change made
* to the database will be directly visible to all components in the cluster rather than requiring a special sync.
* Normally synced databases are databases which are running as an external process, like MySQL or MongoDB.
*
* @return true if all modify operations are directly visible to all components in a cluster, false otherwise.
*/
boolean synced();
Comment thread
0utplay marked this conversation as resolved.

/**
* Retrieves or creates non-blocking a facade for a database to write and read data to. The name of the database
* should be unique for later identification.
Expand Down
10 changes: 9 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ stringSimilarity = "2.0.0"
cloudConfirmation = "1.0.0-rc.1"

# databases
jooq = "3.20.10"
h2 = "1.4.197" # do not update, leads to database incompatibility
xodus = "2.0.1"
mongodb = "5.6.5"
hikariCp = "7.0.2"
mysqlConnector = "9.7.0"
sqliteConnector = "3.51.1.0"
postgresqlConnector = "42.7.9"
mariadbConnector = "3.5.7"

# general
oshi = "6.9.2"
Expand Down Expand Up @@ -158,11 +162,15 @@ aerogelAuto = { group = "dev.derklaro.aerogel", name = "aerogel-auto", version.r
aerogelScopedValues = { group = "dev.derklaro.aerogel", name = "aerogel-scoped-value-context-scope", version.ref = "aerogel" }

# databases
jooq = { group = "org.jooq", name = "jooq", version.ref = "jooq" }
h2 = { group = "com.h2database", name = "h2", version.ref = "h2" }
hikariCp = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikariCp" }
mongodb = { group = "org.mongodb", name = "mongodb-driver-sync", version.ref = "mongodb" }
xodus = { group = "org.jetbrains.xodus", name = "xodus-environment", version.ref = "xodus" }
mysqlConnector = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysqlConnector" }
sqliteConnector = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqliteConnector" }
postgresqlConnector = { group = "org.postgresql", name = "postgresql", version.ref = "postgresqlConnector" }
mariadbConnector = { group = "org.mariadb.jdbc", name = "mariadb-java-client", version.ref = "mariadbConnector" }

# platform api
nukkitX = { group = "cn.nukkit", name = "nukkit", version.ref = "nukkitX" }
Expand Down Expand Up @@ -203,7 +211,7 @@ aerogel = ["aerogel", "aerogelScopedValues", "aerogelAuto"]
aerogelApi = ["aerogel", "aerogelAuto"]
npcLib = ["npcLib", "npcLibLabymod"]
unirest = ["unirest", "unirestGson"]
mysql = ["mysqlConnector", "hikariCp"]
sql = ["mysqlConnector", "hikariCp", "postgresqlConnector", "sqliteConnector", "mariadbConnector", "jooq"]
jline = ["jlineReader", "jlineTerminal"]
cloud = ["cloudCore", "cloudAnnotations", "cloudConfirmationProcessor"]
cloudApi = ["cloudCoreApi", "cloudAnnotationsApi", "cloudConfirmationProcessor"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import lombok.NonNull;
import org.bson.conversions.Bson;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -169,11 +168,6 @@ public boolean delete(@NonNull String key) {
return entries;
}

@Override
public void iterate(@NonNull BiConsumer<String, Document> consumer) {
this.entries().forEach(consumer);
}

@Override
public void clear() {
this.collection.deleteMany(new org.bson.Document());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public boolean init() {
return true;
}

@Override
public boolean synced() {
return true;
}

@Override
public @NonNull LocalDatabase database(@NonNull String name) {
return this.databaseCache.get(name, $ -> {
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading