Skip to content

Commit

Permalink
Updated cottontail dependency to 0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaro committed Dec 11, 2023
1 parent 3e44ee2 commit 7aa78fc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version_jackson_kotlin=2.15.2
version_javacv=1.5.9
version_javalin=5.6.3
version_jline=3.23.0
version_grpc=1.57.2
version_grpc=1.60.0
version_kotlin=1.9.21
version_kotlinx_coroutines=1.7.3
version_kotlinlogging = 5.1.0
version_log4j2=2.20.0
version_picnic=0.7.0
version_protobuf=3.24.0
version_protobuf=3.25.1
version_scrimage=4.1.1
version_slf4j=2.0.9
2 changes: 1 addition & 1 deletion vitrivr-engine-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
api project(':vitrivr-engine-core')

/** Cottontail DB Client. */
implementation group: 'org.vitrivr', name: 'cottontaildb-client', version: '0.16.0-SNAPSHOT'
implementation group: 'org.vitrivr', name: 'cottontaildb-client', version: '0.16.0'

/** gRPC and Protobuf. */
implementation group: 'io.grpc', name: 'grpc-all', version: version_grpc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import org.vitrivr.engine.core.model.metamodel.Schema
*/
abstract class AbstractDescriptorInitializer<D : Descriptor>(final override val field: Schema.Field<*, D>, protected val connection: CottontailConnection) : DescriptorInitializer<D> {
/** The [Name.EntityName] used by this [Descriptor]. */
protected val entityName: Name.EntityName = Name.EntityName(this.field.schema.name, "${CottontailConnection.DESCRIPTOR_ENTITY_PREFIX}_${this.field.fieldName.lowercase()}")
protected val entityName: Name.EntityName = Name.EntityName.create(this.field.schema.name, "${CottontailConnection.DESCRIPTOR_ENTITY_PREFIX}_${this.field.fieldName.lowercase()}")

/**
* Checks if the schema for this [AbstractDescriptorInitializer] has been properly initialized.
*
* @return True if entity has been initialized, false otherwise.
*/
override fun isInitialized(): Boolean = try {
this.connection.client.list(ListEntities(this.entityName.schemaName)).asSequence().any {
this.connection.client.list(ListEntities(this.entityName.schema)).asSequence().any {
Name.EntityName.parse(it.asString(0)!!) == this.entityName
}
} catch (e: StatusRuntimeException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private val logger: KLogger = KotlinLogging.logger {}
abstract class AbstractDescriptorReader<D : Descriptor>(final override val field: Schema.Field<*, D>, protected val connection: CottontailConnection) : DescriptorReader<D> {

/** The [Name.EntityName] used by this [Descriptor]. */
protected val entityName: Name.EntityName = Name.EntityName(this.field.schema.name, "${CottontailConnection.DESCRIPTOR_ENTITY_PREFIX}_${this.field.fieldName.lowercase()}")
protected val entityName: Name.EntityName = Name.EntityName.create(this.field.schema.name, "${CottontailConnection.DESCRIPTOR_ENTITY_PREFIX}_${this.field.fieldName.lowercase()}")

/**
* Returns a single [Descriptor]s of type [D] that has the provided [UUID].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private val logger: KLogger = KotlinLogging.logger {}
*/
abstract class AbstractDescriptorWriter<D : Descriptor>(final override val field: Schema.Field<*, D>, protected val connection: CottontailConnection) : DescriptorWriter<D> {
/** The [Name.EntityName] used by this [Descriptor]. */
protected val entityName: Name.EntityName = Name.EntityName(this.field.schema.name, "${CottontailConnection.DESCRIPTOR_ENTITY_PREFIX}_${this.field.fieldName.lowercase()}")
protected val entityName: Name.EntityName = Name.EntityName.create(this.field.schema.name, "${CottontailConnection.DESCRIPTOR_ENTITY_PREFIX}_${this.field.fieldName.lowercase()}")

/**
* Deletes (writes) a [Descriptor] of type [D] using this [AbstractDescriptorWriter].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ private val logger: KLogger = KotlinLogging.logger {}
internal class RetrievableInitializer(private val connection: CottontailConnection) : RetrievableInitializer {

/** The [Name.EntityName] for this [RetrievableInitializer]. */
private val entityName: Name.EntityName = Name.EntityName(this.connection.schemaName, CottontailConnection.RETRIEVABLE_ENTITY_NAME)
private val entityName: Name.EntityName = Name.EntityName.create(this.connection.schemaName, CottontailConnection.RETRIEVABLE_ENTITY_NAME)

/** The [Name.EntityName] of the relationship entity. */
private val relationshipEntityName: Name.EntityName = Name.EntityName(this.connection.schemaName, CottontailConnection.RELATIONSHIP_ENTITY_NAME)
private val relationshipEntityName: Name.EntityName = Name.EntityName.create(this.connection.schemaName, CottontailConnection.RELATIONSHIP_ENTITY_NAME)

/**
* Initializes the entity that is used to store [Retrievable]s in Cottontail DB.
*/
override fun initialize() {
/* Create schema. */
val createSchema = CreateSchema(this.entityName.schemaName).ifNotExists()
val createSchema = CreateSchema(this.entityName.schema).ifNotExists()
try {
this.connection.client.create(createSchema)
} catch (e: StatusRuntimeException) {
Expand Down Expand Up @@ -79,7 +79,7 @@ internal class RetrievableInitializer(private val connection: CottontailConnecti
* @return True if entity has been initialized, false otherwise.
*/
override fun isInitialized(): Boolean = try {
this.connection.client.list(ListEntities(this.entityName.schemaName)).asSequence().any {
this.connection.client.list(ListEntities(this.entityName.schema)).asSequence().any {
Name.EntityName.parse(it.asString(0)!!) == this.entityName
}
} catch (e: StatusRuntimeException) {
Expand Down

0 comments on commit 7aa78fc

Please sign in to comment.