Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Th2-5165] Use cache in BookInfo #364

Merged
merged 19 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
814c002
Added java-driver-metrics-micrometer
Nikita-Smirnov-Exactpro Nov 13, 2023
56273ed
Added 'session.enabled' and 'node.enabled' into application.conf
Nikita-Smirnov-Exactpro Nov 13, 2023
712e26c
use DropwizardMetricsFactory
Nikita-Smirnov-Exactpro Nov 13, 2023
fbf5013
change configuraton
Nikita-Smirnov-Exactpro Nov 13, 2023
faeb94f
change configuraton
Nikita-Smirnov-Exactpro Nov 13, 2023
376841f
corrected configuration
Nikita-Smirnov-Exactpro Nov 13, 2023
13cffe8
[TH2-5124] Bumped version, updated README.md
Nikita-Smirnov-Exactpro Nov 14, 2023
da23dde
[TH2-5124] disabled throttling metrics because they don't support
Nikita-Smirnov-Exactpro Nov 15, 2023
ac38093
Merge remote-tracking branch 'origin/dev-version-5' into TH2-5124
Nikita-Smirnov-Exactpro Feb 6, 2024
1cd4081
[TH2-5124] Refactored logging
Nikita-Smirnov-Exactpro Feb 7, 2024
1ef19df
[TH2-5165] Migrated to cradle api 5.2.0-...
Nikita-Smirnov-Exactpro Feb 27, 2024
1f78961
[TH2-5165] Bump-rebuild
Nikita-Smirnov-Exactpro Mar 1, 2024
0e16ecd
[TH2-5165] Bump-rebuild
Nikita-Smirnov-Exactpro Mar 1, 2024
105f0e3
[TH2-5165] bump rebuild
Nikita-Smirnov-Exactpro Mar 4, 2024
ac353c5
[TH2-5165] revert BOOK_LABEL to book
Nikita-Smirnov-Exactpro Mar 5, 2024
5976463
[TH2-5165] revert logic to skip register load for empty day page inte…
Nikita-Smirnov-Exactpro Mar 5, 2024
16d17d3
[TH2-5165] revert logic to skip register load for empty day page inte…
Nikita-Smirnov-Exactpro Mar 5, 2024
ce8e3da
[TH2-5165] Migrated to dev release cradle API version
Nikita-Smirnov-Exactpro Mar 6, 2024
3995013
[TH2-5165] Updated github workflow
Nikita-Smirnov-Exactpro Mar 6, 2024
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
@@ -1,17 +1,14 @@
name: Build and publish Docker distributions to Github Container Registry ghcr.io
name: Build and publish dev release Docker image to Github Container Registry ghcr.io

on:
workflow_dispatch:
push:
tags:
- \d+.\d+.\d+-dev
on: workflow_dispatch

jobs:
build-job:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
docker-username: ${{ github.actor }}
devRelease: true
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Build and publish release Docker image to Github Container Registry ghcr.io

on: workflow_dispatch

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
devRelease: false
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Dev build and publish Docker distributions to Github Container Registry ghcr.io
name: Build and publish Docker image to Github Container Registry ghcr.io

on:
push:
branches-ignore:
- master
- version-*
- dependabot**
paths-ignore:
- README.md

jobs:
build-job:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/docker-publish.yml

This file was deleted.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Report data provider (5.9.4)
# Report data provider (5.10.0)

# Overview
This component serves as a backend for rpt-viewer. It will connect to the cassandra database via cradle api and expose the data stored in there as REST resources.
Expand Down Expand Up @@ -295,6 +295,12 @@ spec:

# Release notes

## 5.10.0
+ Updated cradle api: `5.2.0-dev`
+ Updated common: `5.8.0-dev`
+ Updated common-utils: `2.2.2-dev`
+ Disabled unsupported [Cassandra driver metrics](https://docs.datastax.com/en/developer/java-driver/4.10/manual/core/metrics/)

## 5.9.4

+ Fix problem with incorrect events order when requesting search in previous direction
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id 'application'
id 'com.palantir.docker' version '0.25.0'
id "org.owasp.dependencycheck" version "8.3.1"
id "org.owasp.dependencycheck" version "9.0.9"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id 'com.github.jk1.dependency-license-report' version '2.5'
id "de.undercouch.download" version "5.4.0"
}

ext {
dockerImageVersion = release_version
cradleVersion = '5.1.4-dev'
cradleVersion = '5.2.0-dev'
}

group 'com.exactpro.th2'
Expand Down Expand Up @@ -47,11 +47,11 @@ dependencies {

implementation 'org.apache.commons:commons-lang3'

implementation('com.exactpro.th2:common:5.4.0-dev') {
implementation('com.exactpro.th2:common:5.8.0-dev') {
exclude group: 'com.exactpro.th2', module: 'cradle-core'
exclude group: 'com.exactpro.th2', module: 'cradle-cassandra'
}
implementation 'com.exactpro.th2:common-utils:2.2.0-dev'
implementation 'com.exactpro.th2:common-utils:2.2.2-dev'

implementation "com.exactpro.th2:cradle-core:${cradleVersion}"

Expand All @@ -73,10 +73,10 @@ dependencies {
testImplementation('org.jetbrains.kotlin:kotlin-reflect') {
because('mockk needs it')
}
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.2"

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
}

tasks.withType(KotlinCompile).configureEach {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright 2009-2023 Exactpro (Exactpro Systems Limited)
# Copyright 2009-2024 Exactpro (Exactpro Systems Limited)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,6 @@

kotlin.code.style=official

release_version=5.9.4
release_version=5.10.0

docker_image_name=
docker_image_name=
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ abstract class RabbitMqService<B, G, PM>(
}
K_LOGGER.error(e) { "unexpected exception while trying to send a codec request" }
}
}.also { K_LOGGER.info { "${request.requestId} mqRequestSenderScope ${it}ms" } }
}.also { K_LOGGER.debug { "${request.requestId} mqRequestSenderScope ${it}ms" } }
}

pendingRequest
Expand Down
10 changes: 1 addition & 9 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright 2021-2023 Exactpro (Exactpro Systems Limited)
# Copyright 2021-2024 Exactpro (Exactpro Systems Limited)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,20 +28,12 @@ datastax-java-driver {
cql-requests,
cql-client-timeouts,
cql-prepared-cache-size,
throttling.delay,
throttling.queue-size,
throttling.errors
]
cql-requests {
highest-latency = 3 seconds
significant-digits = 3
refresh-interval = 5 minutes
}
throttling.delay {
highest-latency = 3 seconds
significant-digits = 3
refresh-interval = 5 minutes
}
}

node {
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/handlers/events/TestEventPipeline.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 Exactpro (Exactpro Systems Limited)
* Copyright 2022-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,7 @@ class TestEventPipeline {
private val endTimestamp = Instant.parse("2022-04-21T01:15:00Z")

private val batchSize = 4096
private val pageId = PageId(BookId("testBook"), "testPage")
private val pageId = PageId(BookId("testBook"), startTimestamp,"testPage")
private val scope = "testScope"

private val eventsFromStartToEnd11 = createEvents("1", startTimestamp, endTimestamp)
Expand Down
18 changes: 10 additions & 8 deletions src/test/kotlin/handlers/messages/ExtractorTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 Exactpro (Exactpro Systems Limited)
* Copyright 2022-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,6 +37,7 @@ import com.exactpro.th2.rptdataprovider.services.cradle.CradleService
import io.mockk.coEvery
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.cancelChildren
import kotlinx.coroutines.channels.Channel
Expand Down Expand Up @@ -65,7 +66,7 @@ class ExtractorTest {
private val baseStreamName = "test_stream"
private val streamDirection = "FIRST"

private val BOOK = BookId("")
private val bookId = BookId("")
private val fullStreamName = "${baseStreamName}:${streamDirection}"
private val streamNameObject = StreamName(baseStreamName, Direction.valueOf(streamDirection), BookId(""))

Expand Down Expand Up @@ -93,7 +94,7 @@ class ExtractorTest {
"direction" to listOf(streamDirection),
"startTimestamp" to listOf(startTimestamp.toEpochMilli().toString()),
"endTimestamp" to listOf(endTimestamp.toEpochMilli().toString()),
"bookId" to listOf(BOOK.name)
"bookId" to listOf(bookId.name)
)
if (resumeId != null) {
parameters["messageId"] = listOf(resumeId.toString())
Expand All @@ -113,10 +114,10 @@ class ExtractorTest {
every { msg.sessionAlias } answers { fullStreamName }
every { msg.protocol } answers { "protocol" }
every { msg.direction } answers { Direction.FIRST }
every { msg.getContent() } answers { byteArrayOf(1, 1, 1) }
every { msg.getId() } answers {
every { msg.content } answers { byteArrayOf(1, 1, 1) }
every { msg.id } answers {
StoredMessageId(
BOOK,
bookId,
baseStreamName,
Direction.valueOf(streamDirection),
timestamp,
Expand All @@ -128,6 +129,7 @@ class ExtractorTest {
return msg
}

@OptIn(DelicateCoroutinesApi::class)
private fun mockContextWithCradleService(batch: StoredMessageBatch): ProtoContext {
val context: ProtoContext = mockk()

Expand Down Expand Up @@ -187,7 +189,7 @@ class ExtractorTest {
startTimestamp = endTimestamp.plusNanos(1)
}

return StoredMessageBatch(allMessages, PageId(BookId("1"), "1"), Instant.now())
return StoredMessageBatch(allMessages, PageId(BookId("1"), start,"1"), Instant.now())
}


Expand Down Expand Up @@ -250,7 +252,7 @@ class ExtractorTest {

allMessages.add(getMessage(endTimestamp, index))

return StoredMessageBatch(allMessages, PageId(BookId("1"), "1"), Instant.now())
return StoredMessageBatch(allMessages, PageId(BookId("1"), startTimestamp, "1"), Instant.now())
}

private fun testBorders(
Expand Down
Loading