Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory consumption of ThingPersistenceActor #194

Merged
merged 55 commits into from
Jul 26, 2018

Conversation

dguggemos
Copy link
Contributor

The ThingPersistenceActor handles thing commands and events using inner class strategies, which access and modify the internal state of the actor. This requires these command strategies and event handlers to be instantiated for every single persistence actor, which does not scale very well. With this PR the strategies and handlers were moved out of the persistence actor into separate packages, so that they only need to be instantiated once per actor system. This brings several improvements:

  • reduced memory consumption
  • a much smaller and cleaner ThingPersistenceActor
  • strategies and handlers can be tested independent of the actor

dguggemos and others added 30 commits July 3, 2018 09:49
…ng events to separate class

Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
…x/things-memory

# Conflicts:
#	services/things/persistence/src/main/java/org/eclipse/ditto/services/things/persistence/actors/ThingPersistenceActor.java
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
…y a singleton

Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Johannes Schneider <johannes.schneider@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
dguggemos and others added 24 commits July 10, 2018 10:00
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch-si.com>
* Moved methods for creating exceptions from AbstractCommandStrategy to ExceptionFactory.
* Moved ImmutableResult to ResultFactory to inhibit direct instantiation of ImmutableResult.
* Moved some files to reduce cyclic dependencies of packages.
* Added unit test for some command strategies.
* Redesigned some strategies to be more fluent and easier to understand.

Work in progress!

Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
…ierarchy with composition.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
…dling possible null Thing and get rid of redundancy.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
…gies to be more fluent.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
…atatype; enable async notification

Signed-off-by: Cai Yufei (INST/ECS1) <yufei.cai@bosch-si.com>
Copy link
Member

@thjaeckle thjaeckle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool 👍
exciting times :)

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
@thjaeckle thjaeckle merged commit 1e607c3 into eclipse-ditto:master Jul 26, 2018
@thjaeckle thjaeckle deleted the bugfix/things-memory branch July 26, 2018 07:03
@thjaeckle thjaeckle added this to the 0.3.0-M3 milestone Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants