Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ replay_pid*

.idea
.gradle
.vscode
build
jte-classes
105 changes: 32 additions & 73 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,91 +1,50 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.4'
id 'org.springframework.boot' version '3.5.4' apply false
id 'io.spring.dependency-management' version '1.1.7'
id 'gg.jte.gradle' version '3.2.1'
id 'com.google.protobuf' version '0.9.5'
}

ext {
set('springGrpcVersion', "0.9.0")
}

group = 'org.huebert'
version = file('version.txt').text.trim()
subprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(24)
repositories {
mavenCentral()
}
}

springBoot {
buildInfo()
}

jar {
enabled = false
}

jte {
generate()
}

dependencyManagement {
imports {
mavenBom "org.springframework.grpc:spring-grpc-dependencies:${springGrpcVersion}"
}
}
group = 'org.huebert.iotfsdb'
version = file('../version.txt').text.trim()

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(24)
}
}
generateProtoTasks {
all()*.plugins {
grpc {
option 'jakarta_omit'
option '@generated=omit'
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
tasks.named('test') {
useJUnitPlatform()
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'com.google.guava:guava:33.4.8-jre'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'
implementation 'io.grpc:grpc-services'
implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter'
implementation 'gg.jte:jte:3.2.1'
implementation 'gg.jte:jte-spring-boot-starter-3:3.2.1'
implementation("com.google.protobuf:protobuf-java:4.31.1")
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mapstruct:mapstruct:1.6.3'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
annotationProcessor"no.entur.mapstruct.spi:protobuf-spi-impl:1.49.0"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
dependencyManagement {
imports {
mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
}
}

tasks.named('test') {
useJUnitPlatform()
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mapstruct:mapstruct:1.6.3'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
annotationProcessor "no.entur.mapstruct.spi:protobuf-spi-impl:1.49.0"
implementation 'com.google.guava:guava:33.4.8-jre'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
}
40 changes: 40 additions & 0 deletions iotfsdb-app-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
plugins {
id 'org.springframework.boot'
id 'com.google.protobuf' version '0.9.5'
}

ext {
set('springGrpcVersion', "0.9.0")
}

springBoot {
buildInfo()
}

jar {
enabled = false
}

dependencyManagement {
imports {
mavenBom "org.springframework.grpc:spring-grpc-dependencies:${springGrpcVersion}"
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'com.google.guava:guava:33.4.8-jre'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'
implementation 'io.grpc:grpc-services'
implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter'
implementation 'gg.jte:jte:3.2.1'
implementation 'gg.jte:jte-spring-boot-starter-3:3.2.1'
implementation("com.google.protobuf:protobuf-java:4.31.1")
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
annotationProcessor"no.entur.mapstruct.spi:protobuf-spi-impl:1.49.0"
implementation project(':iotfsdb-rest')
implementation project(':iotfsdb-grpc')
implementation project(':iotfsdb-web')
}
File renamed without changes.
22 changes: 22 additions & 0 deletions iotfsdb-grpc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ext {
set('springGrpcVersion', "0.9.0")
}

dependencyManagement {
imports {
mavenBom "org.springframework.grpc:spring-grpc-dependencies:${springGrpcVersion}"
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter'

implementation project(':iotfsdb-persistence')
implementation project(':iotfsdb-proto')
implementation project(':iotfsdb-schema')
implementation project(':iotfsdb-service')
implementation project(':iotfsdb-stats')
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import org.huebert.iotfsdb.api.grpc.CommonMapper;
import org.huebert.iotfsdb.api.grpc.proto.v1.internal.PartitionPersistenceServiceGrpc;
import org.huebert.iotfsdb.api.grpc.proto.v1.internal.PartitionPersistenceServiceProto;
import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.persistence.PartitionByteBuffer;
import org.huebert.iotfsdb.persistence.PersistenceAdapter;
import org.huebert.iotfsdb.service.PartitionKey;
import org.huebert.iotfsdb.stats.CaptureStats;
import org.mapstruct.factory.Mappers;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import org.huebert.iotfsdb.api.grpc.CommonMapper;
import org.huebert.iotfsdb.api.grpc.proto.v1.CommonProto;
import org.huebert.iotfsdb.api.grpc.proto.v1.internal.PartitionPersistenceServiceProto;
import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.api.schema.SeriesFile;
import org.huebert.iotfsdb.persistence.PartitionByteBuffer;
import org.huebert.iotfsdb.persistence.PersistenceAdapter;
import org.huebert.iotfsdb.service.PartitionKey;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand Down
Empty file added iotfsdb-partition/build.gradle
Empty file.
7 changes: 7 additions & 0 deletions iotfsdb-persistence/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'

implementation project(':iotfsdb-properties')
implementation project(':iotfsdb-schema')
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.huebert.iotfsdb.IotfsdbProperties;
import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.api.schema.PartitionPeriod;
import org.huebert.iotfsdb.api.schema.SeriesDefinition;
import org.huebert.iotfsdb.api.schema.SeriesFile;
import org.huebert.iotfsdb.service.PartitionKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -141,7 +141,7 @@
@Override
public void deleteSeries(@NotBlank String seriesId) {
Preconditions.checkArgument(!zip);
if (!FileSystemUtils.deleteRecursively(getSeriesRoot(seriesId).toFile())) {

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
throw new RuntimeException("Unable to delete series: " + seriesId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import jakarta.validation.constraints.Positive;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.api.schema.SeriesFile;
import org.huebert.iotfsdb.service.PartitionKey;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.api.schema.SeriesFile;
import org.huebert.iotfsdb.service.PartitionKey;
import org.springframework.validation.annotation.Validated;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.huebert.iotfsdb.IotfsdbProperties;
import org.huebert.iotfsdb.api.schema.NumberType;
import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.api.schema.PartitionPeriod;
import org.huebert.iotfsdb.api.schema.SeriesDefinition;
import org.huebert.iotfsdb.api.schema.SeriesFile;
import org.huebert.iotfsdb.service.PartitionKey;
import org.junit.jupiter.api.Test;
import org.springframework.util.FileSystemUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static org.assertj.core.api.Assertions.assertThat;

import org.huebert.iotfsdb.api.schema.PartitionKey;
import org.huebert.iotfsdb.api.schema.SeriesDefinition;
import org.huebert.iotfsdb.api.schema.SeriesFile;
import org.huebert.iotfsdb.service.PartitionKey;
import org.junit.jupiter.api.Test;

public class MemoryPersistenceAdapterTest {
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions iotfsdb-properties/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'

implementation project(':iotfsdb-schema')
}
36 changes: 36 additions & 0 deletions iotfsdb-proto/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id 'com.google.protobuf' version '0.9.5'
}

ext {
set('springGrpcVersion', "0.9.0")
}

dependencyManagement {
imports {
mavenBom "org.springframework.grpc:spring-grpc-dependencies:${springGrpcVersion}"
}
}

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java'
}
}
generateProtoTasks {
all()*.plugins {
grpc {
option 'jakarta_omit'
option '@generated=omit'
}
}
}
}

dependencies {
implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter'
}
10 changes: 10 additions & 0 deletions iotfsdb-rest/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'

implementation project(':iotfsdb-properties')
implementation project(':iotfsdb-schema')
implementation project(':iotfsdb-service')
implementation project(':iotfsdb-stats')
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void createSeries(@Valid @RequestBody SeriesFile seriesFile) {
@Operation(tags = "Series", summary = "Delete a series")
@DeleteMapping("{id}")
@ResponseStatus(NO_CONTENT)
public void deleteSeries(@PathVariable @Pattern(regexp = ID_PATTERN) String id) {
public void deleteSeries(@PathVariable("id") @Pattern(regexp = ID_PATTERN) String id) {
seriesService.deleteSeries(id);
}

Expand All @@ -74,7 +74,7 @@ public void deleteSeries(@PathVariable @Pattern(regexp = ID_PATTERN) String id)
@Operation(tags = "Series", summary = "Updates metadata for a series")
@PutMapping("{id}/metadata")
@ResponseStatus(NO_CONTENT)
public void updateMetadata(@PathVariable @Pattern(regexp = ID_PATTERN) String id, @Valid @RequestBody Map<String, String> metadata) {
public void updateMetadata(@PathVariable("id") @Pattern(regexp = ID_PATTERN) String id, @Valid @RequestBody Map<String, String> metadata) {
seriesService.updateMetadata(id, metadata, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public List<SeriesFile> findSeries(@Valid @RequestBody FindSeriesRequest request
)
@Operation(tags = "Series", summary = "Get series details")
@GetMapping("{id}")
public SeriesFile getSeries(@PathVariable @Pattern(regexp = ID_PATTERN) String id) {
public SeriesFile getSeries(@PathVariable("id") @Pattern(regexp = ID_PATTERN) String id) {
return getSeriesFile(id);
}

Expand All @@ -73,7 +73,7 @@ public SeriesFile getSeries(@PathVariable @Pattern(regexp = ID_PATTERN) String i
)
@Operation(tags = "Series", summary = "Retrieves the metadata for a series")
@GetMapping("{id}/metadata")
public Map<String, String> getMetadata(@PathVariable @Pattern(regexp = ID_PATTERN) String id) {
public Map<String, String> getMetadata(@PathVariable("id") @Pattern(regexp = ID_PATTERN) String id) {
return getSeriesFile(id).getMetadata();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.huebert.iotfsdb.api.rest;

import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class TestConfiguration {

}
Binary file added iotfsdb-rest/src/test/resources/db.zip
Binary file not shown.
5 changes: 5 additions & 0 deletions iotfsdb-schema/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.huebert.iotfsdb.service;
package org.huebert.iotfsdb.api.schema;

import jakarta.validation.constraints.NotBlank;
import org.huebert.iotfsdb.api.schema.PartitionPeriod;

import java.time.LocalDateTime;

Expand Down
Loading