[james-site] branch asf-staging updated: Site checkin for project Apache James: Jenkins Tools

2023-04-21 Thread git-site-role
This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/james-site.git


The following commit(s) were added to refs/heads/asf-staging by this push:
 new 416270f9d Site checkin for project Apache James: Jenkins Tools
416270f9d is described below

commit 416270f9d5119ede581a000c3114faa3fd666262
Author: jenkins 
AuthorDate: Sat Apr 22 05:19:32 2023 +

Site checkin for project Apache James: Jenkins Tools
---
 sitemap-james-project.xml | 92 +++
 sitemap-james-site.xml|  4 +--
 2 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/sitemap-james-project.xml b/sitemap-james-project.xml
index 84c6ffa10..834ee0534 100644
--- a/sitemap-james-project.xml
+++ b/sitemap-james-project.xml
@@ -2,186 +2,186 @@
 http://www.sitemaps.org/schemas/sitemap/0.9;>
 
 
https://james.apache.org/james-project/3.7.4/community/contributing.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/community/download.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/community/guidelines.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/community/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/community/mailing-lists.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/community/release.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/community/support.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/community/website.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/configuration.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/concepts/glossary.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/concepts/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/mail/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/messages/imf.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/messages/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/messages/mime.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/processing/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/esmtp.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/imap.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/jmap.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/lmtp.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/pop.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/protocols/smtp.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/storage/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/storage/mailbox.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/storage/users.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/concepts/user/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/customization/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/development/deployment-tests.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 https://james.apache.org/james-project/3.7.4/development/index.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 
https://james.apache.org/james-project/3.7.4/development/logging.html
-2023-04-21T18:40:14.147Z
+2023-04-22T05:19:06.205Z
 
 
 

[james-project] branch master updated: JAMES-3900 Snapshots for polled updates (#1533)

2023-04-21 Thread btellier
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


The following commit(s) were added to refs/heads/master by this push:
 new 334db08121 JAMES-3900 Snapshots for polled updates (#1533)
334db08121 is described below

commit 334db08121e42b5b04ee587858f05482a0f27a9c
Author: Benoit TELLIER 
AuthorDate: Sat Apr 22 07:26:41 2023 +0700

JAMES-3900 Snapshots for polled updates (#1533)

They fully capture the state of the aggregate.

This prevents loading the full history for looong
running tasks and prevents timeouts upon polling updates.
---
 .../task/eventsourcing/DecisionProjection.scala |  9 +++--
 .../apache/james/task/eventsourcing/Events.scala|  4 +++-
 .../james/task/eventsourcing/TaskAggregate.scala| 21 -
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git 
a/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/DecisionProjection.scala
 
b/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/DecisionProjection.scala
index ce2f6d2208..d42fb9a4ca 100644
--- 
a/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/DecisionProjection.scala
+++ 
b/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/DecisionProjection.scala
@@ -32,7 +32,7 @@ case class DecisionProjection(status: Status, 
latestUpdateAdditionalInformationU
 case event: Cancelled => DecisionProjection(Status.CANCELLED, 
event.additionalInformation.map(_.timestamp))
 case event: Completed => DecisionProjection(Status.COMPLETED, 
event.additionalInformation.map(_.timestamp))
 case event: Failed => DecisionProjection(Status.FAILED, 
event.additionalInformation.map(_.timestamp))
-case event: AdditionalInformationUpdated => DecisionProjection(status, 
Some(event.additionalInformation.timestamp))
+case event: AdditionalInformationUpdated => 
DecisionProjection(Status.IN_PROGRESS, 
Some(event.additionalInformation.timestamp))
   }
   }
 
@@ -41,6 +41,11 @@ case class DecisionProjection(status: Status, 
latestUpdateAdditionalInformationU
 }
 
 object DecisionProjection {
-  def initial(created : Created): DecisionProjection = 
DecisionProjection(Status.WAITING, None)
+  def initial(taskEvent : TaskEvent): DecisionProjection = {
+taskEvent match {
+  case _: Created => DecisionProjection(Status.WAITING, None)
+  case updated: AdditionalInformationUpdated => 
DecisionProjection(Status.IN_PROGRESS, 
Some(updated.additionalInformation.timestamp))
+}
+  }
 }
 
diff --git 
a/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/Events.scala
 
b/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/Events.scala
index 1f5ff6fbd6..45e5683f38 100644
--- 
a/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/Events.scala
+++ 
b/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/Events.scala
@@ -33,7 +33,9 @@ case class Created(aggregateId: TaskAggregateId, override val 
eventId: EventId,
 
 case class Started(aggregateId: TaskAggregateId, override val eventId: 
EventId, hostname: Hostname) extends TaskEvent(aggregateId, eventId)
 
-case class AdditionalInformationUpdated(aggregateId: TaskAggregateId, override 
val eventId: EventId, additionalInformation: AdditionalInformation) extends 
TaskEvent(aggregateId, eventId)
+case class AdditionalInformationUpdated(aggregateId: TaskAggregateId, override 
val eventId: EventId, additionalInformation: AdditionalInformation) extends 
TaskEvent(aggregateId, eventId) {
+  override val isASnapshot = true
+}
 
 case class CancelRequested(aggregateId: TaskAggregateId, override val eventId: 
EventId, hostname: Hostname) extends TaskEvent(aggregateId, eventId)
 
diff --git 
a/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/TaskAggregate.scala
 
b/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/TaskAggregate.scala
index 04c36bfff4..197b700e6e 100644
--- 
a/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/TaskAggregate.scala
+++ 
b/server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/TaskAggregate.scala
@@ -25,12 +25,23 @@ import 
org.apache.james.task.TaskExecutionDetails.AdditionalInformation
 import org.apache.james.task.TaskManager.Status
 import org.apache.james.task.{Hostname, Task}
 
-class TaskAggregate private(val aggregateId: TaskAggregateId, private val 
history: History) {
+import scala.util.{Failure, Success}
 
-  val initialEvent = history.getEvents.headOption match {
-case Some(created @ Created(_, _, _, _)) => created
-case _ => throw new IllegalArgumentException("History must start with 
Created event")
-  }
+class TaskAggregate private(val aggregateId: TaskAggregateId, 

[GitHub] [james-project] chibenwa merged pull request #1533: JAMES-3900 Snapshots for polled updates

2023-04-21 Thread via GitHub


chibenwa merged PR #1533:
URL: https://github.com/apache/james-project/pull/1533


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-site] branch asf-staging updated: Site checkin for project Apache James: Jenkins Tools

2023-04-21 Thread git-site-role
This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/james-site.git


The following commit(s) were added to refs/heads/asf-staging by this push:
 new 13a3e8205 Site checkin for project Apache James: Jenkins Tools
13a3e8205 is described below

commit 13a3e8205dfd9adb05f9c10e3db826957c70e818
Author: jenkins 
AuthorDate: Fri Apr 21 18:40:26 2023 +

Site checkin for project Apache James: Jenkins Tools
---
 sitemap-james-distributed-app.xml | 134 +-
 sitemap-james-project.xml | 286 +++---
 sitemap-james-site.xml|   4 +-
 3 files changed, 212 insertions(+), 212 deletions(-)

diff --git a/sitemap-james-distributed-app.xml 
b/sitemap-james-distributed-app.xml
index d2707249e..1aa8639b0 100644
--- a/sitemap-james-distributed-app.xml
+++ b/sitemap-james-distributed-app.xml
@@ -2,270 +2,270 @@
 http://www.sitemaps.org/schemas/sitemap/0.9;>
 
 
https://james.apache.org/james-distributed-app/3.7.4/architecture/consistency-model.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/architecture/implemented-standards.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/architecture/index.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/architecture/specialized-instances.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/benchmark/db-benchmark.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/benchmark/index.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/benchmark/james-benchmark.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/batchsizes.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/blobstore.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/cassandra.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/collecting-contacts.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/collecting-events.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/dns.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/domainlist.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/dsn.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/extensions.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/healthcheck.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/imap.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/index.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/jmap.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/jmx.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/jvm.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/listeners.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/mailetcontainer.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/mailets.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/mailrepositorystore.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/matchers.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/opensearch.html
-2023-04-21T08:23:26.872Z
+2023-04-21T18:39:59.215Z
 
 
 
https://james.apache.org/james-distributed-app/3.7.4/configure/pop3.html
-2023-04-21T08:23:26.872Z

[GitHub] [james-project] chibenwa closed pull request #988: JAMES-2080 Use flattened type for indexing headers

2023-04-21 Thread via GitHub


chibenwa closed pull request #988: JAMES-2080 Use flattened type for indexing 
headers
URL: https://github.com/apache/james-project/pull/988


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa commented on pull request #988: JAMES-2080 Use flattened type for indexing headers

2023-04-21 Thread via GitHub


chibenwa commented on PR #988:
URL: https://github.com/apache/james-project/pull/988#issuecomment-1518018048

   Let's be serious, pushing tokenisation on James side is not a good idea...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] 01/02: JAMES-3777 Snapshots for Filter event sourcing

2023-04-21 Thread btellier
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 812875de7124ef524f7c8e19c0a0c40883244e44
Author: Benoit Tellier 
AuthorDate: Wed Apr 19 14:15:57 2023 +0700

JAMES-3777 Snapshots for Filter event sourcing

Snapshots are stored as events. The offset of the event is
stored in a static column.

Non-invasive and easy to use.
---
 .../org/apache/james/eventsourcing/Event.scala |  2 +
 .../eventstore/cassandra/CassandraEventStore.scala | 17 +++---
 .../cassandra/CassandraEventStoreModule.scala  |  1 +
 .../cassandra/CassandraEventStoreTable.scala   |  1 +
 .../eventstore/cassandra/EventStoreDao.scala   | 71 ++
 ...CassandraEventStoreExtensionForTestEvents.scala |  2 +-
 .../cassandra/CassandraEventStoreTest.scala| 37 ++-
 .../SnapshotEvent.scala}   | 21 ---
 .../{TestEventDTO.scala => SnapshotEventDTO.scala} | 15 +++--
 .../eventstore/cassandra/dto/TestEventDTO.scala|  7 +--
 .../cassandra/dto/TestEventDTOModules.scala| 12 
 .../sample-configuration/jvm.properties|  5 +-
 .../sample-configuration/jvm.properties|  3 +-
 .../api/filtering/impl/FilteringAggregate.java | 16 -
 .../jmap/api/filtering/impl/RuleSetDefined.java|  5 ++
 15 files changed, 165 insertions(+), 50 deletions(-)

diff --git 
a/event-sourcing/event-sourcing-pojo/src/main/scala/org/apache/james/eventsourcing/Event.scala
 
b/event-sourcing/event-sourcing-pojo/src/main/scala/org/apache/james/eventsourcing/Event.scala
index 5440ab03a2..4fbb7f8215 100644
--- 
a/event-sourcing/event-sourcing-pojo/src/main/scala/org/apache/james/eventsourcing/Event.scala
+++ 
b/event-sourcing/event-sourcing-pojo/src/main/scala/org/apache/james/eventsourcing/Event.scala
@@ -33,5 +33,7 @@ trait Event extends Comparable[Event] {
 
   def getAggregateId: AggregateId
 
+  def isASnapshot: Boolean = false
+
   override def compareTo(o: Event): Int = eventId.compareTo(o.eventId)
 }
\ No newline at end of file
diff --git 
a/event-sourcing/event-store-cassandra/src/main/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStore.scala
 
b/event-sourcing/event-store-cassandra/src/main/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStore.scala
index bdd3f713f0..f05d54b2d3 100644
--- 
a/event-sourcing/event-store-cassandra/src/main/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStore.scala
+++ 
b/event-sourcing/event-store-cassandra/src/main/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStore.scala
@@ -20,25 +20,23 @@ package org.apache.james.eventsourcing.eventstore.cassandra
 
 import com.google.common.base.Preconditions
 import javax.inject.Inject
-
 import org.apache.james.eventsourcing.eventstore.{EventStore, 
EventStoreFailedException, History}
-import org.apache.james.eventsourcing.{AggregateId, Event}
+import org.apache.james.eventsourcing.{AggregateId, Event, EventId}
 import org.reactivestreams.Publisher
-
 import reactor.core.scala.publisher.SMono
 
 class CassandraEventStore @Inject() (eventStoreDao: EventStoreDao) extends 
EventStore {
-  override def appendAll(events: Iterable[Event]): Publisher[Void] = {
+  override def appendAll(events: Iterable[Event]): Publisher[Void] =
 if (events.nonEmpty) {
   doAppendAll(events)
 } else {
   SMono.empty
 }
-  }
 
   private def doAppendAll(events: Iterable[Event]): SMono[Void] = {
 Preconditions.checkArgument(Event.belongsToSameAggregate(events))
-eventStoreDao.appendAll(events)
+val snapshotId = events.filter(_.isASnapshot).map(_.eventId).headOption
+eventStoreDao.appendAll(events, snapshotId)
   .filter(success => success)
   .single()
   .onErrorMap({
@@ -48,9 +46,10 @@ class CassandraEventStore @Inject() (eventStoreDao: 
EventStoreDao) extends Event
   .`then`(SMono.empty)
   }
 
-  override def getEventsOfAggregate(aggregateId: AggregateId): SMono[History] 
= {
-eventStoreDao.getEventsOfAggregate(aggregateId)
-  }
+  override def getEventsOfAggregate(aggregateId: AggregateId): SMono[History] =
+eventStoreDao.getSnapshot(aggregateId)
+  .flatMap(snapshotId => eventStoreDao.getEventsOfAggregate(aggregateId, 
snapshotId))
+  .switchIfEmpty(eventStoreDao.getEventsOfAggregate(aggregateId))
 
   override def remove(aggregateId: AggregateId): Publisher[Void] = 
eventStoreDao.delete(aggregateId)
 }
diff --git 
a/event-sourcing/event-store-cassandra/src/main/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStoreModule.scala
 
b/event-sourcing/event-store-cassandra/src/main/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStoreModule.scala
index c92e350ba6..ad2a7eb2b5 100644
--- 

[james-project] 02/02: JAMES-3777 Upgrade instructions for event store snapshots

2023-04-21 Thread btellier
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 1bf460936aa263bd2e048c966c228965afccc426
Author: Benoit Tellier 
AuthorDate: Wed Apr 19 16:40:43 2023 +0700

JAMES-3777 Upgrade instructions for event store snapshots
---
 upgrade-instructions.md | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/upgrade-instructions.md b/upgrade-instructions.md
index a7d8d80bed..378839a95c 100644
--- a/upgrade-instructions.md
+++ b/upgrade-instructions.md
@@ -36,6 +36,12 @@ JIRA: https://issues.apache.org/jira/browse/JAMES-3777
 
 Concerned products: Distributed James, Cassandra James Server
 
+Cassandra Event store table needs to be modified in order to support snapshots:
+
+```
+ALTER TABLE james_keyspace.eventStore ADD snapshot int static;
+```
+
 We recommend disabling increments during rolling updates (as older nodes in 
the cluster won't support them).
 This can be done with the following system property:
 


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] branch master updated (3361957762 -> 1bf460936a)

2023-04-21 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


from 3361957762 JAMES-3777 Upgrade instructions for filter increments
 new 812875de71 JAMES-3777 Snapshots for Filter event sourcing
 new 1bf460936a JAMES-3777 Upgrade instructions for event store snapshots

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/james/eventsourcing/Event.scala |  2 +
 .../eventstore/cassandra/CassandraEventStore.scala | 17 +++---
 .../cassandra/CassandraEventStoreModule.scala  |  1 +
 .../cassandra/CassandraEventStoreTable.scala   |  1 +
 .../eventstore/cassandra/EventStoreDao.scala   | 71 ++
 ...CassandraEventStoreExtensionForTestEvents.scala |  2 +-
 .../cassandra/CassandraEventStoreTest.scala| 37 ++-
 .../dto/{OtherEvent.scala => SnapshotEvent.scala}  |  4 +-
 .../{TestEventDTO.scala => SnapshotEventDTO.scala} | 15 +++--
 .../eventstore/cassandra/dto/TestEventDTO.scala|  7 +--
 .../cassandra/dto/TestEventDTOModules.scala| 12 
 .../sample-configuration/jvm.properties|  5 +-
 .../sample-configuration/jvm.properties|  3 +-
 .../api/filtering/impl/FilteringAggregate.java | 16 -
 .../jmap/api/filtering/impl/RuleSetDefined.java|  5 ++
 upgrade-instructions.md|  6 ++
 16 files changed, 161 insertions(+), 43 deletions(-)
 copy 
event-sourcing/event-store-cassandra/src/test/scala/org/apache/james/eventsourcing/eventstore/cassandra/dto/{OtherEvent.scala
 => SnapshotEvent.scala} (89%)
 copy 
event-sourcing/event-store-cassandra/src/test/scala/org/apache/james/eventsourcing/eventstore/cassandra/dto/{TestEventDTO.scala
 => SnapshotEventDTO.scala} (73%)


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa merged pull request #1532: JAMES-3777 Snapshots for eventSourcing JMAP filters

2023-04-21 Thread via GitHub


chibenwa merged PR #1532:
URL: https://github.com/apache/james-project/pull/1532


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa commented on a diff in pull request #1525: Support `start-dev` argument when running Memory James server

2023-04-21 Thread via GitHub


chibenwa commented on code in PR #1525:
URL: https://github.com/apache/james-project/pull/1525#discussion_r1173467634


##
server/apps/memory-app/README.md:
##
@@ -32,6 +32,14 @@ keytool -genkey -alias james -keyalg RSA -keystore keystore
 docker run -v $PWD/keystore:/root/conf/keystore docker run 
apache/james:cassandra-latest
 ```
 
+In the case of quick start James without manually creating a keystore (e.g. 
for development), just input the command argument `start-dev` when running,
+James will auto-generate keystore file with the default setting:
+
+```
+docker run apache/james:memory-latest start-dev

Review Comment:
   ```suggestion
   docker run apache/james:memory-latest --generate-keystore
   ```
   
   Is more idiomatic from command line, and likely more self explanatory.



##
server/apps/memory-app/README.md:
##
@@ -32,6 +32,14 @@ keytool -genkey -alias james -keyalg RSA -keystore keystore
 docker run -v $PWD/keystore:/root/conf/keystore docker run 
apache/james:cassandra-latest
 ```
 
+In the case of quick start James without manually creating a keystore (e.g. 
for development), just input the command argument `start-dev` when running,
+James will auto-generate keystore file with the default setting:
+
+```
+docker run apache/james:memory-latest start-dev

Review Comment:
   We should document first how to auto-generate the keystore, then explain how 
to set up your own...



##
server/apps/memory-app/README.md:
##
@@ -32,6 +32,14 @@ keytool -genkey -alias james -keyalg RSA -keystore keystore
 docker run -v $PWD/keystore:/root/conf/keystore docker run 
apache/james:cassandra-latest
 ```
 
+In the case of quick start James without manually creating a keystore (e.g. 
for development), just input the command argument `start-dev` when running,
+James will auto-generate keystore file with the default setting:
+
+```
+docker run apache/james:memory-latest start-dev

Review Comment:
   Please document `--generate-keystore` in all other applications.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org