Skip to content

Commit

Permalink
Upgrade dependencies, apply code style, retry to contact seeds, recor…
Browse files Browse the repository at this point in the history
…d classes, move to Apache Fury and fix for duplicated entries in lww set (#36)

* Applied Google/AOSP code style. (#35)

Refactored the way seeds are contacted, so we can retry again after some backoff time up to a maximum number of attempts.
Turned some classes into record classes.
Moved from Kryo to Apache Fury.
Fixed issue Entry::equals that would lead to unwanted data duplication as ConcurrentSet::addAll wouldn't recognize duplicated entries.

* Bump org.mapstruct.version from 1.5.3.Final to 1.5.5.Final (#30)

Bumps `org.mapstruct.version` from 1.5.3.Final to 1.5.5.Final.

Updates `org.mapstruct:mapstruct` from 1.5.3.Final to 1.5.5.Final
- [Release notes](/~https://github.com/mapstruct/mapstruct/releases)
- [Commits](mapstruct/mapstruct@1.5.3.Final...1.5.5.Final)

Updates `org.mapstruct:mapstruct-processor` from 1.5.3.Final to 1.5.5.Final
- [Release notes](/~https://github.com/mapstruct/mapstruct/releases)
- [Commits](mapstruct/mapstruct@1.5.3.Final...1.5.5.Final)

---
updated-dependencies:
- dependency-name: org.mapstruct:mapstruct
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.mapstruct:mapstruct-processor
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rafael Silvério <rafael.silverio11@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
rafaelsilverioit and dependabot[bot] authored Feb 25, 2024
1 parent f226916 commit dbaf630
Show file tree
Hide file tree
Showing 115 changed files with 1,401 additions and 1,274 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

## Work in progress - Not ready for production yet

### Removed
- GRPC interface
- Async stubs for runners
- ~~Rename SyncService to something else (do we really need it?)~~ - we didn't

### Done
- FIFO cache
- Locking
Expand All @@ -15,18 +10,19 @@
- Leader election
- Use Netty for TCP server
- Use Java Sockets for TCP client
- Implement node statuses so that when a node becomes unreachable, it is ignored until it becomes available again and state is synchronized (remove leader status too)
- Retry contacting seeds until a node replies, up to a maximum number of attempts
- Move from Kryo to Apache Fury

### Doing
- Implement node statuses so that when a node becomes unreachable, it is ignored until it becomes available again and state is synchronized (remove leader status too)
- TESTS (unit & acceptance)!

### TODO
- Retry contacting seeds until a node is retrieved - or should we just fail to initialize?
- LBing - Consistent hashing
- Deal with virtual clocks
- TTL
- Payload compression/decompression when talking between nodes
- Authentication
- Support multiple cache eviction policies
- Change how synchronization works today


- Create a Spring Boot app to observe nodes and expose data through a REST API
- Create a node gateway app to receive requests from clients, and load balance requests between nodes
12 changes: 7 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
<packaging>pom</packaging>
<properties>
<java.version>17</java.version>
<org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
<!-- automatically run annotation processors within the incremental compilation -->
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
<junit.version>5.10.2</junit.version>
<surefire.version>3.2.5</surefire.version>
<lombok.version>1.18.30</lombok.version>
<jacoco.version>0.8.10</jacoco.version>
<skipTests>false</skipTests>
Expand Down Expand Up @@ -50,7 +52,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
<version>2.0.12</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand All @@ -73,7 +75,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.1</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -85,7 +87,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.1</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -150,7 +152,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>${surefire.version}</version>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions stundb/acceptance-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.1</version>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -147,7 +147,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>${surefire.version}</version>
<configuration>
<properties>
<!-- Work around. Surefire does not include enough
Expand Down
18 changes: 14 additions & 4 deletions stundb/acceptance-tests/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ name: StunDB
ip: 127.0.0.1
port: 8000
capacity:
publicCache: 10
internalCache: 10
publicCache: 9999
internalCache: 256
timeouts:
tcpReadTimeout: 10
tcpWriteTimeout: 10
tcpClient:
threads: 10
digestAlgorithm: SHA-256
executors:
tcpClient:
threads: 10
initializer:
threads: 5
mainServerLoop:
threads: 10
secondaryServerLoop:
threads: 10
backoffSettings:
maximumBackoffInSeconds: 15
maximumRetries: 5
seeds:
- 127.0.0.1:8000
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.stundb.modules;

import com.google.inject.AbstractModule;
import com.stundb.core.codecs.Codec;
import com.stundb.core.configuration.ConfigurationLoader;
import com.stundb.core.mappers.ApplicationConfigMapper;
import com.stundb.core.models.ApplicationConfig;
import com.stundb.core.modules.providers.ApplicationConfigProvider;
import com.stundb.modules.providers.PropertiesProvider;
import com.stundb.net.client.modules.ClientModule;
import com.stundb.net.core.codecs.Codec;
import com.stundb.net.core.modules.providers.CodecProvider;

import java.util.Properties;
Expand All @@ -16,8 +16,7 @@ public class Module extends AbstractModule {

@Override
protected void configure() {
bind(Codec.class).toProvider(CodecProvider.class)
.asEagerSingleton();
bind(Codec.class).toProvider(CodecProvider.class).asEagerSingleton();

bind(Properties.class).toProvider(PropertiesProvider.class);
bind(ConfigurationLoader.class).toInstance(new ConfigurationLoader());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.stundb.modules.providers;

import lombok.SneakyThrows;

import jakarta.inject.Provider;
import jakarta.inject.Singleton;

import lombok.SneakyThrows;

import java.io.FileInputStream;
import java.util.Properties;

Expand Down
Loading

0 comments on commit dbaf630

Please sign in to comment.