-
Notifications
You must be signed in to change notification settings - Fork 12
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
Delivery improvements #1153
Merged
Merged
Delivery improvements #1153
Changes from 30 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
9d80eec
Use Guava's `Hashing` to calculate the shard index consistently.
armiol a8798e5
Remove a redundant suppression of the warning.
armiol 195a2f7
Extract the `Delivery.Builder` into a top-level class.
armiol 094d885
Introduce a `DeliveryMonitor`.
armiol 2967153
Remove a redundant line.
armiol a63a3cf
Fix the Javadoc method reference.
armiol b78ef8b
Do not allow to dispatch any other message than what's wrapped by the…
armiol 8df19e0
Deliver messages to the same target/label/tenant in a batch (in progr…
armiol a244403
Do not allow to call `EntityMessageEndpoint.onEmptyResult(..)` with t…
armiol 63384d9
Implement a batch dispatching of message from `Inbox` by introducing …
armiol 67c08c6
Call proper `load`/`store` methods for `ProcessManager` and `Projecti…
armiol f72b9c9
Resolve test issues related to over-mocking.
armiol ad46c9c
Start testing the batched delivery (in progress).
armiol d16d8e0
Test the delivery in batches.
armiol 056b24c
Fix the display name.
armiol 2be21c2
Clear the stat counters.
armiol 18c142f
Get rid of `System.out` call.
armiol 917b87d
Calculate the shard index without using `Stringifiers`.
armiol f4f6ef9
Allow to release the node values from the shard indexes if a node has…
armiol e38ae60
Allow to customize the page size for a `DeliveryStage`.
armiol 7a24405
Add the tests for `InboxStorage` and `InboxIds`.
armiol 18d72ad
Allow to monitor the delivery stages after each page is delivered.
armiol 7572ad8
Rename and document the class.
armiol 4503891
Document the class.
armiol 71a819c
Kill the redundant lines.
armiol cf30b35
Merge remote-tracking branch 'origin/master' into delivery-improvements
armiol dc54ab9
Use the charset explicitly.
armiol beb8315
Update the Spine version.
armiol 2602fd4
Improve the code layout.
armiol be073df
Pass the proper value to the monitor.
armiol e917e82
Avoid the flow-control exception.
armiol e08ee1e
Update the license report and pom.xml
armiol 6fd3083
Fix the alignment.
armiol 3fa8534
Fix the tag and format properly.
armiol 2e07e49
Get rid of a space character.
armiol fe4c6c1
Address the discrepancy between the docs and the implementation.
armiol 270e6f2
Use the default factory method instead of seeding the default value.
armiol 3de308e
Remove the unused generic parameter.
armiol 637da8f
Add a note on cache usage.
armiol 360aba1
Fix the test flow.
armiol 3153ff2
Turn the `DeliveryStage` into Protobuf message.
armiol feb7f61
Mark `RepositoryCache`'s nested interfaces as functional.
armiol 0ab5620
Notify the batch delivery listener in any case.
armiol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
49 changes: 49 additions & 0 deletions
49
server/src/main/java/io/spine/server/delivery/BatchDeliveryListener.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2019, TeamDev. All rights reserved. | ||
* | ||
* Redistribution and use in source and/or binary forms, with or without | ||
* modification, must retain the above copyright notice and the following | ||
* disclaimer. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
package io.spine.server.delivery; | ||
|
||
/** | ||
* Listens to start and end of the {@code Inbox} batch delivery. | ||
* | ||
* <p>When the consequent messages in the {@code Inbox} are targeting the same entity, | ||
* the delivery may be optimized by using either the same transaction or caching the storage | ||
* operations while the batch is delivered. | ||
* | ||
* <p>The implementing classes may define their own behavior and react upon such use cases. | ||
*/ | ||
public interface BatchDeliveryListener<I> { | ||
|
||
/** | ||
* Invoked before the batch delivery to the target with the given ID is started. | ||
* | ||
* @param id | ||
* the ID of the delivery target | ||
*/ | ||
void onStart(I id); | ||
|
||
/** | ||
* Invoked after the batch delivery to the target with the given ID is ended. | ||
* | ||
* @param id | ||
* the ID of the delivery target | ||
*/ | ||
void onEnd(I id); | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make these methods package-private? For a user, it is strange to see them when subclassing
AggregateRepository
.