Skip to content

Commit f195bdf

Browse files
committed
Improve code formatting across modules
1 parent b446d11 commit f195bdf

File tree

9 files changed

+18
-6
lines changed

9 files changed

+18
-6
lines changed

dataset/src/main/kotlin/com/cosmotech/dataset/DatasetApiServiceInterface.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface DatasetApiServiceInterface : DatasetApiService {
2323
/**
2424
* Find Dataset by Organization Id and Dataset Id (checking ONLY READ_PERMISSION on targeted
2525
* organization)
26+
*
2627
* @param organizationId an organization Id
2728
* @param datasetId a dataset Id
2829
* @return a Dataset or null
@@ -31,6 +32,7 @@ interface DatasetApiServiceInterface : DatasetApiService {
3132

3233
/**
3334
* Add a new entry (ou update existing one) on dataset passed in parameter
35+
*
3436
* @param organizationId an organization id
3537
* @param dataset a dataset to update
3638
* @param identity a user/application identity

dataset/src/main/kotlin/com/cosmotech/dataset/bulk/BulkQuery.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,25 @@ private constructor(
2121
private var typedBinaryEdges: Map<String, BinaryEntities> = mapOf()
2222
) {
2323
fun graphName(name: String) = apply { this.graphName = name }
24+
2425
fun first() = apply { this.begin = true }
2526

2627
fun addNodeTypeGroup(type: String, binaryEntities: BinaryEntities) = apply {
2728
if (type !in typedBinaryNodes) this.typedBinaryNodes += type to binaryEntities
2829
}
30+
2931
fun addNodeToNodeTypeGroup(type: String, node: Node) = apply {
3032
if (type in this.typedBinaryNodes) this.typedBinaryNodes[type]?.addEntity(node)
3133
}
3234

3335
fun addEdgeTypeGroup(type: String, typeEdge: BinaryEntities) = apply {
3436
if (type !in typedBinaryEdges) this.typedBinaryEdges += type to typeEdge
3537
}
38+
3639
fun addEdgeToEdgeTypeGroup(type: String, edge: Edge) = apply {
3740
if (type in this.typedBinaryEdges) this.typedBinaryEdges[type]?.addEntity(edge)
3841
}
42+
3943
// For ease, those sizes are not calculated as there are very small
4044
// GRAPH.BULK string to byteArray size
4145
// graphName string to byteArray size
@@ -73,6 +77,7 @@ private constructor(
7377

7478
private fun ByteArray.toHex(): String =
7579
joinToString(separator = "") { eachByte -> "%02x".format(eachByte) }
80+
7681
override fun toString(): String {
7782
return generateQueryArgs().joinToString(separator = " - ") { bytes -> bytes.toHex() }
7883
}

dataset/src/main/kotlin/com/cosmotech/dataset/bulk/QueryBuffer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class QueryBuffer(val unifiedJedis: UnifiedJedis, val graphName: String) {
2727

2828
private val nodeSet: HashSet<String> = hashSetOf()
2929
private val edgeSet: HashSet<String> = hashSetOf()
30+
3031
fun addNode(type: String, id: String, properties: Map<String, Any?>) {
3132
addEntity(type, properties) {
3233
if (id in nodeSet) return@addEntity null

dataset/src/main/kotlin/com/cosmotech/dataset/utils/Twingraph.ext.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ enum class CsmGraphEntityType {
2828
RELATION,
2929
NODE
3030
}
31+
3132
// To support simple quoted jsonstring from ADT
3233
val jsonObjectMapper: ObjectMapper =
3334
objectMapper().configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true)
@@ -41,7 +42,8 @@ fun GraphEntity.toCsmGraphEntity(type: CsmGraphEntityType): CsmGraphEntity {
4142
val label =
4243
when (type) {
4344
CsmGraphEntityType.RELATION -> (this as Edge).relationshipType
44-
CsmGraphEntityType.NODE -> (this as Node).takeIf { it.numberOfLabels > 0 }?.getLabel(0)
45+
CsmGraphEntityType.NODE ->
46+
(this as Node).takeIf { it.numberOfLabels > 0 }?.getLabel(0)
4547
?: throw IndexOutOfBoundsException("Node has no label: $entityId")
4648
}
4749

metrics/src/main/kotlin/com/cosmotech/metrics/MetricsService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.cosmotech.api.metrics.PersistentMetric
77
interface MetricsService {
88
/**
99
* Store a metric in the persistent database.
10+
*
1011
* @param metric The metric to store.
1112
*/
1213
fun storeMetric(metric: PersistentMetric)

run/src/main/kotlin/com/cosmotech/run/RunContainerFactory.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ class RunContainerFactory(
338338

339339
/**
340340
* Get scopes used by containers
341+
*
341342
* @return all scopes defined join by ","
342343
*/
343344
internal fun getContainerScopes(csmPlatformProperties: CsmPlatformProperties): String {

run/src/main/kotlin/com/cosmotech/run/RunEventServiceInterface.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ import org.springframework.context.event.EventListener
88

99
interface RunEventServiceInterface {
1010
@EventListener(AskRunStatusEvent::class) fun getRunStatus(askRunStatusEvent: AskRunStatusEvent)
11+
1112
@EventListener(HasRunningRuns::class) fun hasRunningRuns(hasRunningRuns: HasRunningRuns)
1213
}

run/src/main/kotlin/com/cosmotech/run/service/amqp/AmqpClientServiceInterface.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ package com.cosmotech.run.service.amqp
55
interface AmqpClientServiceInterface {
66

77
fun addNewQueue(exchangeName: String, queueName: String)
8+
89
fun removeQueue(exchangeName: String, queueName: String)
910
}

runner/src/main/kotlin/com/cosmotech/runner/service/RunnerService.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class RunnerService(
187187
fun listInstances(pageRequest: PageRequest): List<Runner> {
188188
val isPlatformAdmin =
189189
getCurrentAuthenticatedRoles(this.csmPlatformProperties).contains(ROLE_PLATFORM_ADMIN)
190-
var runners = listOf<Runner>()
190+
var runners: List<Runner>
191191
if (!this.csmPlatformProperties.rbac.enabled || isPlatformAdmin) {
192192
runners =
193193
runnerRepository
@@ -324,8 +324,7 @@ class RunnerService(
324324
runnerRepository
325325
.findBy(organization!!.id!!, workspace!!.id!!, it)
326326
.orElseThrow { IllegalArgumentException("Parent runner not found: ${it}") }
327-
.rootId
328-
?: this.runner.parentId
327+
.rootId ?: this.runner.parentId
329328
}
330329
}
331330
}
@@ -434,8 +433,7 @@ class RunnerService(
434433
runner.security
435434
?.accessControlList
436435
?.map { RbacAccessControl(it.id, it.role) }
437-
?.toMutableList()
438-
?: mutableListOf())
436+
?.toMutableList() ?: mutableListOf())
439437
}
440438

441439
@Suppress("NestedBlockDepth")

0 commit comments

Comments
 (0)