Separated T in nodeData from Criteria #42
Merged
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.
This is a subset of the MR: #41, which is an extension of MR #31. The intention is to break #41 into smaller components to make it easy to track changes in the future.
Key Changes
ShardSelector<T, C extends Criteria<T>> implements ShardSelector<T, C, R extends Registry<T>>
orShardSelector<T> implements ShardSelector<T, Criteria<T>, R extends Registry<T>>
. Chose the former to keep the Criteria implementation fluid and to be able to have clients define their shardSelector within the bound of any Criteria implementation.Why separate T and Criteria
To facilitate for clients to dynamically bind inline criteria when implementing shard selectors, to decouple the type of such criteria bound with the generic T type that has been saved as a part of
serviceNode
.This will help clients further wing out their own implementations of criteria basis their individual parameters and supply a matcher during node group (shard) selection.