You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2020/07/23 07:53:25 UTC
[james-project] 14/18: JAMES-3313 Move GC class to a separate class
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 82206dcc2510595a4ab2571e47b0585c74f5dce3
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jul 17 16:29:04 2020 +0700
JAMES-3313 Move GC class to a separate class
This avoids a circular dependency
---
server/blob/blob-deduplicating/pom.xml | 44 +---------------------
.../doc/gc-properties.adoc | 0
.../blob/{blob-deduplicating => blob-gc}/pom.xml | 6 +--
.../james/server/blob/deduplication/GC.scala | 0
.../server/blob/deduplication/GCJsonReporter.scala | 0
.../src/test/resources/gcReport.json | 0
.../blob/deduplication/GCJsonReporterTest.scala | 2 -
.../blob/deduplication/GCPropertiesTest.scala | 0
.../james/server/blob/deduplication/State.scala | 0
server/blob/pom.xml | 1 +
10 files changed, 5 insertions(+), 48 deletions(-)
diff --git a/server/blob/blob-deduplicating/pom.xml b/server/blob/blob-deduplicating/pom.xml
index ebc0006..b4d2740 100644
--- a/server/blob/blob-deduplicating/pom.xml
+++ b/server/blob/blob-deduplicating/pom.xml
@@ -32,8 +32,7 @@
<name>Apache James :: Server :: Blob :: Deduplicating Blob Storage</name>
<description>
- An implementation of BlobStore which deduplicates the stored blobs and uses a garbage collector
- to ensure their effective deletion.
+ An implementation of BlobStore which deduplicates the stored blobs.
</description>
<dependencies>
@@ -43,34 +42,9 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
- <artifactId>blob-api</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${james.groupId}</groupId>
- <artifactId>blob-memory</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${james.groupId}</groupId>
- <artifactId>james-server-testing</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${james.groupId}</groupId>
<artifactId>james-server-util</artifactId>
</dependency>
<dependency>
- <groupId>${james.groupId}</groupId>
- <artifactId>testing-base</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.typesafe.play</groupId>
- <artifactId>play-json_${scala.base}</artifactId>
- </dependency>
- <dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-scala-extensions_${scala.base}</artifactId>
</dependency>
@@ -82,22 +56,6 @@
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-java8-compat_${scala.base}</artifactId>
</dependency>
- <dependency>
- <groupId>org.scalacheck</groupId>
- <artifactId>scalacheck_${scala.base}</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.scalactic</groupId>
- <artifactId>scalactic_${scala.base}</artifactId>
- <version>3.1.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.scalatest</groupId>
- <artifactId>scalatest_${scala.base}</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
diff --git a/server/blob/blob-deduplicating/doc/gc-properties.adoc b/server/blob/blob-gc/doc/gc-properties.adoc
similarity index 100%
rename from server/blob/blob-deduplicating/doc/gc-properties.adoc
rename to server/blob/blob-gc/doc/gc-properties.adoc
diff --git a/server/blob/blob-deduplicating/pom.xml b/server/blob/blob-gc/pom.xml
similarity index 95%
copy from server/blob/blob-deduplicating/pom.xml
copy to server/blob/blob-gc/pom.xml
index ebc0006..44e3d1b 100644
--- a/server/blob/blob-deduplicating/pom.xml
+++ b/server/blob/blob-gc/pom.xml
@@ -27,12 +27,12 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>blob-deduplicating</artifactId>
+ <artifactId>blob-gc</artifactId>
<packaging>jar</packaging>
- <name>Apache James :: Server :: Blob :: Deduplicating Blob Storage</name>
+ <name>Apache James :: Server :: Blob :: Deduplicating Blob Storage Garbage collection</name>
<description>
- An implementation of BlobStore which deduplicates the stored blobs and uses a garbage collector
+ Garbage collector for the deduplicating blob store
to ensure their effective deletion.
</description>
diff --git a/server/blob/blob-deduplicating/src/main/scala/org/apache/james/server/blob/deduplication/GC.scala b/server/blob/blob-gc/src/main/scala/org/apache/james/server/blob/deduplication/GC.scala
similarity index 100%
rename from server/blob/blob-deduplicating/src/main/scala/org/apache/james/server/blob/deduplication/GC.scala
rename to server/blob/blob-gc/src/main/scala/org/apache/james/server/blob/deduplication/GC.scala
diff --git a/server/blob/blob-deduplicating/src/main/scala/org/apache/james/server/blob/deduplication/GCJsonReporter.scala b/server/blob/blob-gc/src/main/scala/org/apache/james/server/blob/deduplication/GCJsonReporter.scala
similarity index 100%
rename from server/blob/blob-deduplicating/src/main/scala/org/apache/james/server/blob/deduplication/GCJsonReporter.scala
rename to server/blob/blob-gc/src/main/scala/org/apache/james/server/blob/deduplication/GCJsonReporter.scala
diff --git a/server/blob/blob-deduplicating/src/test/resources/gcReport.json b/server/blob/blob-gc/src/test/resources/gcReport.json
similarity index 100%
rename from server/blob/blob-deduplicating/src/test/resources/gcReport.json
rename to server/blob/blob-gc/src/test/resources/gcReport.json
diff --git a/server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/GCJsonReporterTest.scala b/server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/GCJsonReporterTest.scala
similarity index 99%
rename from server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/GCJsonReporterTest.scala
rename to server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/GCJsonReporterTest.scala
index 6988e00..742a34f 100644
--- a/server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/GCJsonReporterTest.scala
+++ b/server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/GCJsonReporterTest.scala
@@ -178,8 +178,6 @@ class GCJsonReporterTest extends AnyWordSpec with Matchers {
lastIteration = gcReportGenNPlus2.iteration,
targetedGeneration = generationPlusOne.next(2))
- import JsonReport._
-
val actualJson = Json.toJson(GCJsonReporter.report(ReferenceEvent(reference) :: GCIterationEvent(gcReportGenNPlus2) :: DereferenceEvent(dereference) :: GCIterationEvent(gcReportGenNPlus3) :: Nil))
actualJson should equal(Json.parse(ClassLoaderUtils.getSystemResourceAsString("gcReport.json")))
diff --git a/server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/GCPropertiesTest.scala b/server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/GCPropertiesTest.scala
similarity index 100%
rename from server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/GCPropertiesTest.scala
rename to server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/GCPropertiesTest.scala
diff --git a/server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/State.scala b/server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/State.scala
similarity index 100%
rename from server/blob/blob-deduplicating/src/test/scala/org/apache/james/server/blob/deduplication/State.scala
rename to server/blob/blob-gc/src/test/scala/org/apache/james/server/blob/deduplication/State.scala
diff --git a/server/blob/pom.xml b/server/blob/pom.xml
index 9744471..f62e027 100644
--- a/server/blob/pom.xml
+++ b/server/blob/pom.xml
@@ -39,6 +39,7 @@
<module>blob-common</module>
<module>blob-export-api</module>
<module>blob-export-file</module>
+ <module>blob-gc</module>
<module>blob-memory</module>
<module>blob-objectstorage</module>
<module>blob-union</module>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org