This repository has been archived by the owner on May 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Changes to include local file as a valid fake data sink #127
Open
emartinezs44
wants to merge
29
commits into
Stratio:master
Choose a base branch
from
emartinezs44:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes are intended to Khermes to provide the capability of creating files with fake data. As the project was closely related to Kafka I include a new Akka Stream-based implementation of the SupervisorActor. Depending on AppConfig parameters, the stream is started with a flow which writes events to a local file or with a flow which sends event to Kafka. Events are generated in a Actor publisher and Twirl compiled template is cached in another actor which is spawn each time the Supervisor receives a Start message. In the last supervisor implementation there is a very bad performance, because each time a event is generated the template is again compiled.
This new implementation uses the Akka Stream api to avoid dealing with Threads. It uses GroupWithin and the Cats State monad to provide context generating events although this is not implemented yet.
The html console is changed to support file configuration and to ask the sink type, Kafka or file, starting the producer actor.
A CateryGenerator is included to support generating fields for a Category. Samples are included in the new Quickstart section.
Scripts to create and start a Khermes docker container and a Zookeeper are included in the directory scripts/quickstart. With that there is no need of Kafka to start generating events quickly.
Testing
Documentation
Scalastyle
Disabled in EventPublisher class due cyclomatic complexity although class looks very simple