-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* m7l5 Gremlin/ArcadeDB * m7l5 ArcadeDB tiny fix (cherry picked from commit cdc05c32e1017ad016151030076da3722c7230a5)
- Loading branch information
Showing
30 changed files
with
723 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "3.3" | ||
services: | ||
arcadedb: | ||
image: "arcadedata/arcadedb:24.4.1" | ||
ports: | ||
- "2480:2480" | ||
- "2424:2424" | ||
- "8182:8182" | ||
# volumes: | ||
# - ./volumes/arcadedb:/home/arcadedb/databases | ||
# Здесь можно добавить доступные через gremlin графы и псевдонимы | ||
# - ./volumes/arcadedb:/home/arcadedb/config/gremlin-server.groovy | ||
environment: | ||
JAVA_OPTS: > | ||
-Darcadedb.server.rootPassword=root_root | ||
-Darcadedb.server.plugins=GremlinServer:com.arcadedb.server.gremlin.GremlinServerPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
ok-marketplace-be/ok-marketplace-app-ktor/src/jvmMain/kotlin/configs/GremlinConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package ru.otus.otuskotlin.marketplace.app.ktor.configs | ||
|
||
import io.ktor.server.config.* | ||
|
||
data class GremlinConfig( | ||
val host: String = "localhost", | ||
val port: Int = 8182, | ||
val user: String = "root", | ||
val pass: String, | ||
val enableSsl: Boolean = false, | ||
) { | ||
constructor(config: ApplicationConfig): this( | ||
host = config.property("$PATH.host").getString(), | ||
user = config.property("$PATH.user").getString(), | ||
pass = config.property("$PATH.password").getString(), | ||
enableSsl = config.property("$PATH.enableSsl").getString().toBoolean(), | ||
) | ||
|
||
companion object { | ||
const val PATH = "${ConfigPaths.repository}.gremlin" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...lace-be/ok-marketplace-common/src/commonMain/kotlin/repo/exceptions/UnknownDbException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package ru.otus.otuskotlin.marketplace.common.repo.exceptions | ||
|
||
class UnknownDbException(mes: String): RepoException(mes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/log/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Модуль `ok-marketplace-repo-gremlin` | ||
|
||
|
||
Модуль реализует интерфейс репозитория ArcadeDb с вариантом Apache TinkerPop Gremlin. | ||
|
||
Поддерживается только JVM платформа. | ||
|
47 changes: 47 additions & 0 deletions
47
ok-marketplace-be/ok-marketplace-repo-gremlin/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated | ||
|
||
plugins { | ||
id("build-jvm") | ||
} | ||
|
||
val generatedPath = layout.buildDirectory.dir("generated/main/kotlin").get() | ||
sourceSets { | ||
main { | ||
java.srcDir(generatedPath) | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(projects.okMarketplaceCommon) | ||
implementation(projects.okMarketplaceRepoCommon) | ||
|
||
implementation(libs.coroutines.core) | ||
implementation(libs.uuid) | ||
|
||
implementation(libs.gdb.gremlin.driver) | ||
implementation(libs.gdb.arcade.engine) | ||
implementation(libs.gdb.arcade.network) | ||
implementation(libs.gdb.arcade.gremlin) | ||
|
||
testImplementation(kotlin("test-junit")) | ||
testImplementation(libs.testcontainers.core) | ||
testImplementation(projects.okMarketplaceRepoTests) | ||
} | ||
|
||
val arcadeDbVersion: String by project | ||
|
||
tasks { | ||
val gradleConstants by creating { | ||
file("$generatedPath/GradleConstants.kt").apply { | ||
ensureParentDirsCreated() | ||
writeText( | ||
""" | ||
package ru.otus.otuskotlin.marketplace.backend.repository.gremlin | ||
const val ARCADEDB_VERSION = "${libs.versions.arcadedb.get()}" | ||
""".trimIndent() | ||
) | ||
} | ||
} | ||
compileKotlin.get().dependsOn(gradleConstants) | ||
} |
16 changes: 16 additions & 0 deletions
16
ok-marketplace-be/ok-marketplace-repo-gremlin/src/main/kotlin/AdGremlinConst.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ru.otus.otuskotlin.marketplace.backend.repository.gremlin | ||
|
||
object AdGremlinConst { | ||
const val RESULT_SUCCESS = "success" | ||
const val RESULT_LOCK_FAILURE = "lock-failure" | ||
|
||
const val FIELD_ID = "#id" | ||
const val FIELD_TITLE = "title" | ||
const val FIELD_DESCRIPTION = "description" | ||
const val FIELD_AD_TYPE = "adType" | ||
const val FIELD_OWNER_ID = "ownerId" | ||
const val FIELD_VISIBILITY = "visibility" | ||
const val FIELD_PRODUCT_ID = "productId" | ||
const val FIELD_LOCK = "lock" | ||
const val FIELD_TMP_RESULT = "_result" | ||
} |
Oops, something went wrong.