-
Notifications
You must be signed in to change notification settings - Fork 229
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
Rest cache - property cache #2658
Rest cache - property cache #2658
Conversation
…GED. (apache#2621) Exclude on-operation instance from computing min active replica in WAGED.
_currentStateCache = null; | ||
} | ||
// TODO: consolidate EV from CSs | ||
public Map<String, ExternalView> consolidateExternalViews() { |
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.
Just to understand, if the stoppable check wants to get the external view from the cache, it should call consolidateExternalViews
which will generate EV by the data from RestCurrentStateCache
? Is that the plan?
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.
It should just call getEV. consolidateExternalViews will be called internal in this data provider
7fca663
to
5f1a3f7
Compare
Set<String> nodes) { | ||
return nodes.stream() | ||
.filter( | ||
instance -> !DelayedAutoRebalancer.INSTANCE_OPERATION_TO_EXCLUDE_FROM_ASSIGNMENT.contains(instanceConfigMap.get(instance).getInstanceOperation())) |
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.
We probably need checks before instanceConfigMap.get()
.equals("MASTER") && ev.getStateMap(partition) | ||
.get(evacuateInstanceName) | ||
.equals("LEADER")); | ||
|
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.
nit: empty line
5d6396e
to
3775e3d
Compare
/** Init, register listener and manager callback handler for different | ||
* clusters manage the providers lifecycle | ||
* | ||
*/ |
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.
Wrong place for comments.
} | ||
} | ||
|
||
public void close() { |
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.
Close should pair with connect / start. Do you want to make it as thread based class?
|
||
|
||
/** | ||
* Dara cache for each Helix cluster. Configs, ideal stats and current states are read from ZK and updated |
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.
Typo:
Dara -> Data
ideal stats -> ideal states
|
||
private HelixDataAccessor _accessor; | ||
|
||
private RealmAwareZkClient _zkclient; |
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.
Why not use meta client.
// Simple caches | ||
private final RestPropertyCache<InstanceConfig> _instanceConfigCache; | ||
private final RestPropertyCache<ClusterConfig> _clusterConfigCache; | ||
private final RestPropertyCache<ResourceConfig> _resourceConfigCache; |
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.
Do we need ResourceConfig cache?
private final RestPropertyCache<ResourceConfig> _resourceConfigCache; | ||
private final RestPropertyCache<LiveInstance> _liveInstanceCache; | ||
private final RestPropertyCache<IdealState> _idealStateCache; | ||
private final RestPropertyCache<StateModelDefinition> _stateModelDefinitionCache; |
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.
Do we need this?
|
||
public void init(final HelixDataAccessor accessor) { | ||
} | ||
} |
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.
NIT: extra new line.
|
||
|
||
/** | ||
* Special cache for instances current states. |
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.
Why not CurrentStateCache instead of building its own?
|
||
|
||
public class RestServiceDataProvider { | ||
protected Map<String, PerClusterDataProvider> _clusterDataProviders ; |
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.
make it concurrent? What if remove cluster and read together?
Is this still a valid change? |
Issues
#2659
Description
Structure for rest data provider. It supports concurrent read/update.
Tests
Test will be added in following prs.
(If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)
Changes that Break Backward Compatibility (Optional)
(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)
Documentation (Optional)
(Link the GitHub wiki you added)
Commits
Code Quality
(helix-style-intellij.xml if IntelliJ IDE is used)