-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Innførte value klasser for arbeidssøker id og record key
- Loading branch information
Showing
11 changed files
with
61 additions
and
24 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
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
8 changes: 8 additions & 0 deletions
8
...tor/src/main/kotlin/no/nav/paw/kafkakeygenerator/api/oppslag/RecordKeyLookupResponseV1.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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
package no.nav.paw.kafkakeygenerator.api.oppslag | ||
|
||
import no.nav.paw.kafkakeygenerator.vo.RecordKey | ||
|
||
data class RecordKeyLookupResponseV1( | ||
val key: Long | ||
) | ||
|
||
fun recordKeyLookupResponseV1( | ||
key: RecordKey | ||
) = RecordKeyLookupResponseV1( | ||
key = key.value | ||
) |
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
7 changes: 5 additions & 2 deletions
7
...afka-key-generator/src/main/kotlin/no/nav/paw/kafkakeygenerator/api/v2/KeyCalculations.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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package no.nav.paw.kafkakeygenerator.api.v2 | ||
|
||
import no.nav.paw.kafkakeygenerator.vo.ArbeidssoekerId | ||
import no.nav.paw.kafkakeygenerator.vo.RecordKey | ||
|
||
//Endring av denne verdien krever replay av eventlog til nye topics!! | ||
const val PUBLIC_KEY_MODULO_VALUE = 7_500 | ||
|
||
//Endring av denne funksjonen krever replay av eventlog til nye topics!! | ||
fun publicTopicKeyFunction(internalKey: Long): Long = | ||
"internal_key_$internalKey".hashCode().toLong() % PUBLIC_KEY_MODULO_VALUE | ||
fun publicTopicKeyFunction(arbeidssoekerId: ArbeidssoekerId): RecordKey = | ||
RecordKey("internal_key_${arbeidssoekerId.value}".hashCode().toLong() % PUBLIC_KEY_MODULO_VALUE) |
11 changes: 11 additions & 0 deletions
11
apps/kafka-key-generator/src/main/kotlin/no/nav/paw/kafkakeygenerator/api/v2/ResponseV2.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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
package no.nav.paw.kafkakeygenerator.api.v2 | ||
|
||
import no.nav.paw.kafkakeygenerator.vo.ArbeidssoekerId | ||
import no.nav.paw.kafkakeygenerator.vo.RecordKey | ||
|
||
data class ResponseV2( | ||
val id: Long, | ||
val key: Long | ||
) | ||
|
||
fun responseV2( | ||
id: ArbeidssoekerId, | ||
key: RecordKey | ||
) = ResponseV2( | ||
id = id.value, | ||
key = key.value | ||
) |
4 changes: 4 additions & 0 deletions
4
apps/kafka-key-generator/src/main/kotlin/no/nav/paw/kafkakeygenerator/vo/ArbeidssoekerId.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,4 @@ | ||
package no.nav.paw.kafkakeygenerator.vo | ||
|
||
@JvmInline | ||
value class ArbeidssoekerId(val value: Long) |
4 changes: 4 additions & 0 deletions
4
apps/kafka-key-generator/src/main/kotlin/no/nav/paw/kafkakeygenerator/vo/RecordKey.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,4 @@ | ||
package no.nav.paw.kafkakeygenerator.vo | ||
|
||
@JvmInline | ||
value class RecordKey(val value: Long) |
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