Skip to content

Commit 78dbe31

Browse files
committed
feat: Major rewrite to API and internals
This is the first step in rewriting to use a reactive API. These changes update the API and some internals but is not ready for use yet. Test coverage is lacking and reactive transaction support needs work
1 parent ef20031 commit 78dbe31

File tree

302 files changed

+9284
-12538
lines changed

Some content is hidden

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

302 files changed

+9284
-12538
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ target
22
.project
33
.classpath
44
.settings
5+
pom.xml.versionsBackup

pom.xml

+198-45
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,50 @@
4545
<version>1.7.19</version>
4646
</dependency>
4747

48-
<dependency>
49-
<groupId>junit</groupId>
50-
<artifactId>junit</artifactId>
48+
<dependency>
49+
<groupId>org.junit.jupiter</groupId>
50+
<artifactId>junit-jupiter-api</artifactId>
51+
<version>5.6.2</version>
52+
<scope>test</scope>
53+
</dependency>
54+
55+
<dependency>
56+
<groupId>org.junit.jupiter</groupId>
57+
<artifactId>junit-jupiter-engine</artifactId>
58+
<version>5.6.2</version>
5159
<scope>test</scope>
5260
</dependency>
5361

5462
<dependency>
55-
<groupId>com.carrotsearch.randomizedtesting</groupId>
56-
<artifactId>randomizedtesting-runner</artifactId>
57-
<version>2.7.3</version>
58-
<scope>test</scope>
63+
<groupId>org.junit.jupiter</groupId>
64+
<artifactId>junit-jupiter-params</artifactId>
65+
<version>5.6.2</version>
66+
<scope>test</scope>
5967
</dependency>
6068

6169
<dependency>
62-
<groupId>net.jodah</groupId>
63-
<artifactId>concurrentunit</artifactId>
64-
<version>0.4.6</version>
65-
<scope>test</scope>
70+
<groupId>org.hamcrest</groupId>
71+
<artifactId>hamcrest-core</artifactId>
72+
<version>2.2</version>
73+
<scope>test</scope>
74+
</dependency>
75+
76+
<dependency>
77+
<groupId>nl.jqno.equalsverifier</groupId>
78+
<artifactId>equalsverifier</artifactId>
79+
<version>3.4.1</version>
80+
<scope>test</scope>
6681
</dependency>
6782
</dependencies>
6883

6984
<dependencyManagement>
7085
<dependencies>
7186
<dependency>
72-
<groupId>junit</groupId>
73-
<artifactId>junit</artifactId>
74-
<version>4.12</version>
75-
<scope>test</scope>
76-
</dependency>
77-
78-
<dependency>
79-
<groupId>com.google.inject</groupId>
80-
<artifactId>guice</artifactId>
81-
<version>4.2.2</version>
87+
<groupId>io.projectreactor</groupId>
88+
<artifactId>reactor-bom</artifactId>
89+
<version>2020.0.0</version>
90+
<type>pom</type>
91+
<scope>import</scope>
8292
</dependency>
8393
</dependencies>
8494
</dependencyManagement>
@@ -89,32 +99,155 @@
8999
<groupId>org.apache.maven.plugins</groupId>
90100
<artifactId>maven-compiler-plugin</artifactId>
91101
<version>3.8.1</version>
102+
<configuration>
103+
<release>9</release>
104+
</configuration>
105+
</plugin>
106+
107+
<plugin>
108+
<artifactId>maven-surefire-plugin</artifactId>
109+
<version>2.22.2</version>
110+
</plugin>
111+
112+
<plugin>
113+
<artifactId>maven-failsafe-plugin</artifactId>
114+
<version>2.22.2</version>
115+
</plugin>
116+
117+
<plugin>
118+
<groupId>net.bytebuddy</groupId>
119+
<artifactId>byte-buddy-maven-plugin</artifactId>
120+
121+
<dependencies>
122+
<dependency>
123+
<groupId>io.projectreactor</groupId>
124+
<artifactId>reactor-tools</artifactId>
125+
<classifier>original</classifier>
126+
<scope>runtime</scope>
127+
<version>3.3.9.RELEASE</version>
128+
</dependency>
129+
</dependencies>
92130

93131
<configuration>
94-
<source>1.8</source>
95-
<target>1.8</target>
132+
<transformations>
133+
<transformation>
134+
<plugin>reactor.tools.agent.ReactorDebugByteBuddyPlugin</plugin>
135+
</transformation>
136+
</transformations>
96137
</configuration>
97138
</plugin>
98-
</plugins>
99-
</build>
100139

101-
<!-- Main Github repo -->
102-
<scm>
103-
<connection>scm:git:[email protected]:LevelFourAB/silo.git</connection>
104-
<url>scm:git:[email protected]:LevelFourAB/silo.git</url>
105-
<developerConnection>scm:git:[email protected]:LevelFourAB/silo.git</developerConnection>
106-
</scm>
140+
<plugin>
141+
<groupId>com.github.spotbugs</groupId>
142+
<artifactId>spotbugs-maven-plugin</artifactId>
143+
<version>4.0.0</version>
107144

108-
<distributionManagement>
109-
<snapshotRepository>
110-
<id>ossrh</id>
111-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
112-
</snapshotRepository>
113-
<repository>
114-
<id>ossrh</id>
115-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
116-
</repository>
117-
</distributionManagement>
145+
<dependencies>
146+
<dependency>
147+
<groupId>com.github.spotbugs</groupId>
148+
<artifactId>spotbugs</artifactId>
149+
<version>4.0.4</version>
150+
</dependency>
151+
</dependencies>
152+
<executions>
153+
<execution>
154+
<goals>
155+
<goal>check</goal>
156+
</goals>
157+
</execution>
158+
</executions>
159+
<configuration>
160+
<effort>max</effort>
161+
<failOnError>false</failOnError>
162+
</configuration>
163+
</plugin>
164+
165+
<plugin>
166+
<groupId>org.revapi</groupId>
167+
<artifactId>revapi-maven-plugin</artifactId>
168+
<version>0.11.5</version>
169+
<dependencies>
170+
<dependency>
171+
<groupId>org.revapi</groupId>
172+
<artifactId>revapi-java</artifactId>
173+
<version>0.21.0</version>
174+
</dependency>
175+
</dependencies>
176+
<executions>
177+
<execution>
178+
<goals>
179+
<goal>check</goal>
180+
</goals>
181+
</execution>
182+
</executions>
183+
<configuration>
184+
<reportSeverity>nonBreaking</reportSeverity>
185+
<failSeverity>breaking</failSeverity>
186+
187+
<analysisConfiguration>
188+
<revapi.java>
189+
<filter>
190+
<packages>
191+
<regex>true</regex>
192+
<include>
193+
<item>se\.l4\..*</item>
194+
</include>
195+
<exclude>
196+
<item>.*\.impl(\..+)?</item>
197+
<item>.*\.internal(\..+)?</item>
198+
</exclude>
199+
</packages>
200+
</filter>
201+
</revapi.java>
202+
203+
<revapi.semver.ignore>
204+
<enabled>true</enabled>
205+
<versionIncreaseAllows>
206+
<major>breaking</major>
207+
<minor>nonBreaking</minor>
208+
<patch>equivalent</patch>
209+
</versionIncreaseAllows>
210+
<passThroughDifferences>
211+
<item>java.class.nonPublicPartOfAPI</item>
212+
</passThroughDifferences>
213+
</revapi.semver.ignore>>
214+
215+
<revapi.ignore>
216+
<item>
217+
<code>java.annotation.added</code>
218+
<annotationType>edu.umd.cs.findbugs.annotations.NonNull</annotationType>
219+
<justification>SpotBugs annotations are for bug finding and not code generation</justification>
220+
</item>
221+
222+
<item>
223+
<code>java.annotation.added</code>
224+
<annotationType>edu.umd.cs.findbugs.annotations.Nullable</annotationType>
225+
<justification>SpotBugs annotations are for bug finding and not code generation</justification>
226+
</item>
227+
228+
<item>
229+
<code>java.annotation.added</code>
230+
<annotationType>edu.umd.cs.findbugs.annotations.UnknownNullness</annotationType>
231+
<justification>SpotBugs annotations are for bug finding and not code generation</justification>
232+
</item>
233+
234+
<item>
235+
<code>java.annotation.added</code>
236+
<annotationType>edu.umd.cs.findbugs.annotations.CheckReturnValue</annotationType>
237+
<justification>SpotBugs annotations are for bug finding and not code generation</justification>
238+
</item>
239+
240+
<item>
241+
<code>java.annotation.added</code>
242+
<annotationType>edu.umd.cs.findbugs.annotations.SuppressFBWarnings</annotationType>
243+
<justification>SpotBugs annotations are for bug finding and not code generation</justification>
244+
</item>
245+
</revapi.ignore>
246+
</analysisConfiguration>
247+
</configuration>
248+
</plugin>
249+
</plugins>
250+
</build>
118251

119252
<profiles>
120253
<profile>
@@ -124,7 +257,7 @@
124257
<plugin>
125258
<groupId>org.apache.maven.plugins</groupId>
126259
<artifactId>maven-source-plugin</artifactId>
127-
<version>3.1.0</version>
260+
<version>3.2.1</version>
128261
<executions>
129262
<execution>
130263
<id>attach-sources</id>
@@ -138,10 +271,12 @@
138271
<plugin>
139272
<groupId>org.apache.maven.plugins</groupId>
140273
<artifactId>maven-javadoc-plugin</artifactId>
141-
<version>3.1.1</version>
274+
<version>3.2.0</version>
142275
<configuration>
143276
<doclint>none</doclint>
144-
<source>8</source>
277+
<source>9</source>
278+
279+
<excludePackageNames>*.internal.*</excludePackageNames>
145280
</configuration>
146281
<executions>
147282
<execution>
@@ -166,7 +301,7 @@
166301
</goals>
167302
</execution>
168303
</executions>
169-
</plugin>
304+
</plugin>
170305

171306
<plugin>
172307
<groupId>org.sonatype.plugins</groupId>
@@ -184,6 +319,24 @@
184319
</profile>
185320
</profiles>
186321

322+
<!-- Main Github repo -->
323+
<scm>
324+
<connection>scm:git:[email protected]:LevelFourAB/silo.git</connection>
325+
<url>scm:git:[email protected]:LevelFourAB/silo.git</url>
326+
<developerConnection>scm:git:[email protected]:LevelFourAB/silo.git</developerConnection>
327+
</scm>
328+
329+
<distributionManagement>
330+
<snapshotRepository>
331+
<id>ossrh</id>
332+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
333+
</snapshotRepository>
334+
<repository>
335+
<id>ossrh</id>
336+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
337+
</repository>
338+
</distributionManagement>
339+
187340
<developers>
188341
<developer>
189342
<id>aholstenson</id>

silo-api/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
</dependency>
3939

4040
<dependency>
41-
<groupId>com.google.guava</groupId>
42-
<artifactId>guava</artifactId>
43-
<version>29.0-jre</version>
41+
<groupId>io.projectreactor</groupId>
42+
<artifactId>reactor-core</artifactId>
4443
</dependency>
4544
</dependencies>
4645

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package se.l4.silo;
2+
3+
import java.io.InputStream;
4+
5+
import se.l4.silo.internal.BlobImpl;
6+
import se.l4.ylem.io.Bytes;
7+
import se.l4.ylem.io.IOSupplier;
8+
9+
/**
10+
* Binary Large OBject for simplifying storing binary data.
11+
*/
12+
public interface Blob<ID>
13+
{
14+
/**
15+
* Get the identifier of this blob.
16+
*
17+
* @return
18+
*/
19+
ID getId();
20+
21+
/**
22+
* Open a stream with the data of this blob. For blobs fetched from an
23+
* {@link Entity} this will open data as it exists within the current
24+
* {@link Transaction}. If called outside an existing transaction this may
25+
* error if the blob has been deleted.
26+
*
27+
* @return
28+
* stream with data
29+
* @throws SiloException
30+
* if unable to open the data
31+
*/
32+
InputStream openStream();
33+
34+
/**
35+
* Create an instance.
36+
*
37+
* @param <ID>
38+
* type of id
39+
* @param id
40+
* the identifier of the blob
41+
* @param stream
42+
* supplier for getting the binary data of the blob
43+
* @return
44+
*/
45+
static <ID> Blob<ID> create(ID id, IOSupplier<InputStream> stream)
46+
{
47+
return new BlobImpl<ID>(id, stream);
48+
}
49+
50+
/**
51+
* Create an instance.
52+
*
53+
* @param <ID>
54+
* type of id
55+
* @param id
56+
* the identifier of the blob
57+
* @param bytes
58+
* instance of bytes
59+
* @return
60+
*/
61+
static <ID> Blob<ID> create(ID id, Bytes bytes)
62+
{
63+
return create(id, bytes::asInputStream);
64+
}
65+
}

0 commit comments

Comments
 (0)