Skip to content

Commit c6242e7

Browse files
authored
Java 17, bumping dependencies (#298)
Former-commit-id: 9884837
1 parent 60c3888 commit c6242e7

File tree

298 files changed

+4215
-5891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+4215
-5891
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ jobs:
4040
- name: Checkout repository
4141
uses: actions/checkout@v2
4242

43+
- name: Set up JDK
44+
uses: actions/setup-java@v2
45+
with:
46+
java-version: '17'
47+
distribution: 'adopt'
48+
4349
# Initializes the CodeQL tools for scanning.
4450
- name: Initialize CodeQL
4551
uses: github/codeql-action/init@v1

.github/workflows/gradle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
# Setup Cottontail DB service container
1818
services:
1919
cottontail:
20-
image: vitrivr/cottontaildb:0.15.0
20+
image: vitrivr/cottontaildb:0.15.1
2121
ports:
2222
- 1865:1865
2323
options: -it
@@ -35,10 +35,10 @@ jobs:
3535
run: nc -zv 127.0.0.1 1865
3636
- name: polypheny connection test
3737
run: nc -zv 127.0.0.1 13137
38-
- name: Set up JDK 11
38+
- name: Set up JDK
3939
uses: actions/setup-java@v2
4040
with:
41-
java-version: '11'
41+
java-version: '17'
4242
distribution: 'adopt'
4343
- name: Cleanup Gradle Cache
4444
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.

.github/workflows/release-maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Java
1717
uses: actions/setup-java@v1
1818
with:
19-
java-version: 11.0.6
19+
java-version: 17
2020
server-id: maven
2121
- id: get_version
2222
name: Extract publication version from tag.

.github/workflows/snapshot-maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Java
1515
uses: actions/setup-java@v1
1616
with:
17-
java-version: 11.0.6
17+
java-version: 17
1818
server-id: maven
1919
- id: publish-gradle
2020
name: Publish package to the OSS Snapshot Repository & GitHub Packages

build.gradle

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id 'com.github.johnrengelman.shadow' version '6.1.0'
3-
id 'de.undercouch.download' version "4.1.1"
4-
id 'com.google.osdetector' version '1.6.2'
2+
id 'com.github.johnrengelman.shadow' version '7.1.2'
3+
id 'de.undercouch.download' version "5.0.5"
4+
id 'com.google.osdetector' version '1.7.0'
55
id 'java-library'
66
id 'idea'
77
}
@@ -11,7 +11,7 @@ allprojects {
1111
group = 'org.vitrivr'
1212

1313
/* Our current version, on dev branch this should always be release+1-SNAPSHOT */
14-
version = '3.11.1'
14+
version = '3.11.2'
1515

1616
apply plugin: 'java-library'
1717
apply plugin: 'maven-publish'
@@ -28,9 +28,7 @@ subprojects {
2828
}
2929

3030
dependencies {
31-
classpath "gradle.plugin.com.google.gradle:osdetector-gradle-plugin:1.6.2"
32-
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.14"
33-
classpath "de.undercouch:gradle-download-task:4.1.1"
31+
classpath "gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18"
3432
}
3533
}
3634

@@ -40,8 +38,8 @@ subprojects {
4038
zip64 true // Required to allow more than 65535 entries in final archive
4139
}
4240

43-
sourceCompatibility = 1.11
44-
targetCompatibility = 1.11
41+
sourceCompatibility = 17
42+
targetCompatibility = 17
4543

4644
repositories {
4745
mavenCentral()
@@ -69,8 +67,8 @@ subprojects {
6967
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: version_jackson
7068

7169
/** Protobuf */
72-
implementation group: 'io.grpc', name: 'grpc-stub', version: '1.45.0'
73-
implementation group: 'io.grpc', name: 'grpc-netty', version: '1.45.0'
70+
implementation group: 'io.grpc', name: 'grpc-stub', version: '1.45.1'
71+
implementation group: 'io.grpc', name: 'grpc-netty', version: '1.45.1'
7472

7573
/** Test dependencies (JUnit 5) */
7674
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: version_junit
@@ -97,7 +95,7 @@ task getExternalFiles {
9795
fileList.eachLine { String line ->
9896
def split = line.split(",")
9997
def destination = split[1]
100-
download {
98+
download.run {
10199
src split[0]
102100
dest destination
103101
}

cineast-api/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ dependencies {
111111
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: version_jackson
112112
implementation group: 'de.svenkubiak', name: 'jBCrypt', version: version_jbcrypt
113113
implementation group: 'org.vitrivr', name: 'cineast-proto', version: version_cineast_proto
114-
implementation group: 'it.unimi.dsi', name: 'fastutil', version: '8.5.8'
115114

116115
}
117116

cineast-api/src/main/java/org/vitrivr/cineast/api/APIEndpoint.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.eclipse.jetty.util.thread.QueuedThreadPool;
1919
import org.vitrivr.cineast.api.rest.OpenApiCompatHelper;
2020
import org.vitrivr.cineast.api.rest.handlers.actions.StatusInvocationHandler;
21+
import org.vitrivr.cineast.api.rest.handlers.actions.bool.CountRowsGetHandler;
2122
import org.vitrivr.cineast.api.rest.handlers.actions.bool.FindDistinctElementsByColumnPostHandler;
2223
import org.vitrivr.cineast.api.rest.handlers.actions.bool.SelectFromTablePostHandler;
2324
import org.vitrivr.cineast.api.rest.handlers.actions.feature.FindFeaturesByCategoryPostHandler;
@@ -281,16 +282,17 @@ public Javalin dispatchService(boolean secure) {
281282
}
282283
/* Serve the UI if requested statically*/
283284
if (config.getServeUI()) {
285+
LOGGER.info("UI serving is enabled");
284286
/* Add css, js and other static files */
285287
serviceConfig.addStaticFiles(config.getUiLocation(), Location.EXTERNAL);
286-
/* Add index.html - the ui's front page as default route. Anything reroutes to thre */
287-
serviceConfig
288-
.addSinglePageRoot("/", config.getUiLocation() + "/index.html", Location.EXTERNAL);
288+
/* Add index.html - the ui's front page as default route. Anything reroutes to there */
289+
serviceConfig.addSinglePageRoot("/", config.getUiLocation() + "/index.html", Location.EXTERNAL);
289290
}
290291
});
291292

292293
/* Enable WebSocket (if configured). */
293294
if (config.getEnableWebsocket()) {
295+
LOGGER.info("Starting WS API");
294296
this.webSocketApi = new WebsocketAPI();
295297

296298
service.ws(String.format("%s/websocket", namespace()), handler -> {
@@ -308,6 +310,7 @@ public Javalin dispatchService(boolean secure) {
308310

309311
/* Setup HTTP/RESTful connection (if configured). */
310312
if (config.getEnableRest() || config.getEnableRestSecure()) {
313+
LOGGER.info("Starting REST API");
311314
this.restHandlers.forEach(handler -> registerRestHandler(service, handler));
312315
this.registerServingRoutes(service, config);
313316
}
@@ -326,8 +329,7 @@ public Javalin dispatchService(boolean secure) {
326329
service.start();
327330
}
328331
} catch (Exception ex) {
329-
LOGGER.log(Level.FATAL,
330-
"Failed to start HTTP endpoint due to an exception. Cineast will shut down now!", ex);
332+
LOGGER.log(Level.FATAL, "Failed to start HTTP endpoint due to an exception. Cineast will shut down now!", ex);
331333
System.exit(100);
332334
}
333335

@@ -441,6 +443,7 @@ private void registerRestOperations() {
441443
*/
442444
private void registerServingRoutes(final Javalin service, final APIConfig config) {
443445
if (config.getServeContent()) {
446+
LOGGER.info("Serving content is enabled");
444447
service.get("/thumbnails/{id}", new ResolvedContentRoute(
445448
new FileSystemThumbnailResolver(
446449
new File(Config.sharedConfig().getApi().getThumbnailLocation()))));

cineast-api/src/main/java/org/vitrivr/cineast/api/GRPCEndpoint.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515
public class GRPCEndpoint {
1616

17-
private static Server server;
18-
1917
private static final Logger LOGGER = LogManager.getLogger();
18+
private static Server server;
2019

2120
public static void start() throws IOException {
2221

cineast-api/src/main/java/org/vitrivr/cineast/api/Main.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,23 @@ public static void main(String[] args) {
3131
try {
3232
APIEndpoint.getInstance().start();
3333
} catch (Throwable e) {
34+
e.printStackTrace();
3435
System.err.println("Failed to initialize API endpoint due to an exception: " + e.getMessage());
3536
}
3637

3738
/* Start gRPC endpoint. */
3839
try {
3940
GRPCEndpoint.start();
4041
} catch (Throwable e) {
42+
e.printStackTrace();
4143
System.err.println("Failed to initialize gRPC endpoint due to an exception: " + e.getMessage());
4244
}
4345

4446
/* Initialize Monitoring */
4547
try {
4648
PrometheusServer.initialize();
4749
} catch (Throwable e) {
50+
e.printStackTrace();
4851
System.err.println("Failed to initialize Monitoring due to an exception: " + e.getMessage());
4952
}
5053

cineast-api/src/main/java/org/vitrivr/cineast/api/SessionExtractionContainer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.io.File;
55
import java.io.IOException;
66
import java.util.Arrays;
7+
import java.util.List;
78
import org.apache.logging.log4j.LogManager;
89
import org.apache.logging.log4j.Logger;
910
import org.vitrivr.cineast.core.util.json.JacksonJsonProvider;
@@ -19,8 +20,8 @@
1920
*/
2021
public class SessionExtractionContainer {
2122

22-
private static SessionContainerProvider provider;
2323
private static final Logger LOGGER = LogManager.getLogger();
24+
private static SessionContainerProvider provider;
2425
private static boolean open = false;
2526
private static Counter submittedPaths;
2627
private static File configFile;
@@ -85,10 +86,10 @@ public static void endSession() {
8586
getProviderOrExit().endSession();
8687
}
8788

88-
public static void addPaths(ExtractionItemContainer[] items) {
89-
getOpenProviderOrExit().addPaths(Arrays.asList(items));
89+
public static void addPaths(List<ExtractionItemContainer> items) {
90+
getOpenProviderOrExit().addPaths(items);
9091
if (submittedPaths != null) {
91-
submittedPaths.inc(items.length);
92+
submittedPaths.inc(items.size());
9293
}
9394
}
9495

cineast-api/src/main/java/org/vitrivr/cineast/api/grpc/CineastQueryService.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@
3737
public class CineastQueryService extends CineastQueryGrpc.CineastQueryImplBase {
3838

3939
private static final int DEFAULT_NEIGHBORING_SEGMENTS = 10;
40-
41-
private final ContinuousRetrievalLogic continuousRetrievalLogic;
42-
4340
private static final Logger LOGGER = LogManager.getLogger();
41+
private final ContinuousRetrievalLogic continuousRetrievalLogic;
4442

4543
public CineastQueryService(ContinuousRetrievalLogic continuousRetrievalLogic) {
4644
this.continuousRetrievalLogic = continuousRetrievalLogic;
@@ -114,7 +112,7 @@ public void getMediaSegmentScores(CineastGrpc.Query query, StreamObserver<Cineas
114112
break stages;
115113
}
116114

117-
results.stream().forEach(x -> relevantSegments.add(x.key));
115+
results.forEach(x -> relevantSegments.add(x.key()));
118116
}
119117
}
120118
}
@@ -203,7 +201,7 @@ public void getSimilar(CineastGrpc.TemporalQuery query, StreamObserver<CineastGr
203201
/* Transform raw results into list of StringDoublePairs (segmentId -> score) */
204202
final List<StringDoublePair> results = scores.stream()
205203
.map(elem -> new StringDoublePair(elem.getSegmentId(), elem.getScore()))
206-
.filter(p -> p.value > 0d)
204+
.filter(p -> p.value() > 0d)
207205
.sorted(StringDoublePair.COMPARATOR)
208206
.limit(max)
209207
.collect(Collectors.toList());
@@ -215,7 +213,7 @@ public void getSimilar(CineastGrpc.TemporalQuery query, StreamObserver<CineastGr
215213
LOGGER.error("Category {} was used twice in stage {}. This erases the results of the previous category... ", category, finalStageIndex);
216214
}
217215
cache.get(finalStageIndex).put(category, results);
218-
results.forEach(res -> relevantSegments.add(res.key));
216+
results.forEach(res -> relevantSegments.add(res.key()));
219217
LOGGER.trace("Category {} at stage {} executed @ {} ms", category, finalStageIndex, watch.getTime(TimeUnit.MILLISECONDS));
220218

221219
/* If this is the last stage, we can send relevant results per category back to the UI.
@@ -231,7 +229,7 @@ public void getSimilar(CineastGrpc.TemporalQuery query, StreamObserver<CineastGr
231229
results
232230
)));
233231

234-
List<String> segmentIds = results.stream().map(x -> x.key).filter(x -> !sentSegmentIds.contains(x)).collect(Collectors.toList());
232+
List<String> segmentIds = results.stream().map(StringDoublePair::key).filter(x -> !sentSegmentIds.contains(x)).collect(Collectors.toList());
235233
if (segmentIds.isEmpty()) {
236234
continue;
237235
}
@@ -313,7 +311,7 @@ public void getSimilar(CineastGrpc.TemporalQuery query, StreamObserver<CineastGr
313311
/* At this point, we have iterated over all stages. Now, we need to go back for all stages and send the results for the relevant ids. */
314312
for (int stageIndex = 0; stageIndex < stages.size() - 1; stageIndex++) {
315313
cache.get(stageIndex).forEach((category, results) -> {
316-
results.removeIf(pair -> !stageQConf.getRelevantSegmentIds().contains(pair.key));
314+
results.removeIf(pair -> !stageQConf.getRelevantSegmentIds().contains(pair.key()));
317315

318316
responseObserver.onNext(
319317
QueryContainerUtil.queryResult(

cineast-api/src/main/java/org/vitrivr/cineast/api/grpc/util/QueryContainerUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public static CineastGrpc.MediaSegmentId mediaSegmentId(String id) {
266266
}
267267

268268
public static CineastGrpc.MediaSegmentIdScore mediaSegmentIdScore(StringDoublePair pair) {
269-
return CineastGrpc.MediaSegmentIdScore.newBuilder().setId(mediaSegmentId(pair.key)).setScore(pair.value).build();
269+
return CineastGrpc.MediaSegmentIdScore.newBuilder().setId(mediaSegmentId(pair.key())).setScore(pair.value()).build();
270270
}
271271

272272
public static CineastGrpc.QueryId queryId(String id) {

cineast-api/src/main/java/org/vitrivr/cineast/api/messages/abstracts/AbstractQueryResultMessage.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)