Skip to content

Commit

Permalink
Add Fury instance and mapdb serializer with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoering committed Jan 29, 2025
1 parent 3e440f6 commit 858284d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
4 changes: 4 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
</dependency>
<dependency>
<groupId>org.apache.fury</groupId>
<artifactId>fury-core</artifactId>
</dependency>

<!-- citeproc CSL / BibTeX -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,26 @@ public void serde() {
.keySerializer(Serializer.LONG)
.valueSerializer(new MapDbObjectSerializer(VerbatimRecord.class, pool, 128))
.create();


final int repeat = 100;
StopWatch watch = new StopWatch();
verbatim.put(0l, gen(0));
watch.start();
System.out.println(watch.getNanoTime());
for (long x=1; x<1000; x++) {
for (long x=1; x<repeat; x++) {
verbatim.put(x, gen(x));
}
watch.suspend();
System.out.println(watch.getNanoTime());

watch.stop();
System.out.println(watch);

watch.reset();
watch.start();
System.out.println("Reading...");
for (long x=1; x<repeat; x++) {
var obj = verbatim.get(x);
}
watch.stop();
System.out.println(watch);

mapDb.close();
}

Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<dwca-io.version>2.16</dwca-io.version>
<elasticsearch.version>8.1.3</elasticsearch.version>
<fastutil.version>8.5.14</fastutil.version>
<fury.version>0.9.0</fury.version>
<ganglia.version>1.0.7</ganglia.version>
<gbif-api.version>1.16.12</gbif-api.version>
<hikaricp.version>6.0.0</hikaricp.version>
Expand Down Expand Up @@ -541,6 +542,11 @@
<version>${kryo-reflectasm.version}</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>org.apache.fury</groupId>
<artifactId>fury-core</artifactId>
<version>${fury.version}</version>
</dependency>

<!-- docker -->
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions webservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
</dependency>
<dependency>
<groupId>org.apache.fury</groupId>
<artifactId>fury-core</artifactId>
</dependency>

<!-- Elasticsearch / Lucene -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* Neo4j does not perform well storing large propLabel in its node and it is recommended to keep
* large BLOBs or strings externally: https://neo4j.com/blog/dark-side-neo4j-worst-practices/
* <p>
* We use the Kryo library for a very performant binary
* We use the Fury library for a very performant binary
* serialisation with the data keyed under the neo4j node value.
*/
public class NeoDb {
Expand Down

0 comments on commit 858284d

Please sign in to comment.