There are two types of constraints: state constraints and transition constraints.
Currently state constraints are built directly into the state model: each state has an upper bound for how many replicas of a partition can be in that state, and these are ordered by priority (thus simulating a lower bound). It would be nice to be able to override this for a specific resource, and perhaps for a specific partition. This is optional to do for the initial work, though. Transition constraints (also referred to as "message constraints") dictate the upper bound in transitions that can be done in parallel at any scope. Actually, the current ClusterConstraints is even more generic in this way: it simply matches attributes (e.g. cluster, resource, partition, participant, state model) in pending messages to create a grouping, and then only sends up to the limit of messages from that group. However in practice, having a transition parallelism upper bound for the scopes we previously discussed is probably sufficient. Kanak ---------------------------------------- > Date: Sun, 13 Apr 2014 16:01:01 -0700 > Subject: Constraint Question > From: [email protected] > To: [email protected] > > Hey guys, > > Can someone give me an idea on what the two parts do and how they are > used together in the Constraints subject area namely > > * ConstraintAttribute > * ConstraintValue > > I looked at the LogicalModelExample and I see the transition > constraint but are there more examples which show how other > constraints are applied? I may have missed existing docs on this, so > feel free to link me to the wiki pages. > > In gist I understand that constraints can be applied at various levels > i.e. resource, cluster, member etc but need more examples on how > ConstraintAttribute and Value can be used to constrain different > aspects to move forward with the API reworkl. > > Thanks, > > Sandeep
