[ https://issues.apache.org/jira/browse/YARN-6593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16014767#comment-16014767 ]
Wangda Tan commented on YARN-6593: ---------------------------------- [~kkaranasos], thanks for updating the patch, some suggestions: 1) PlacementConstraint should be parent class of CompoundPlacementConstraint/SimplePlacementConstraint. Now it added one additional hierarchy to each node in the tree. 2) Suggest to move delay DelayUnit/delayValue from CompoundPlacementConstraint to a separate class such as DelayCriterion. 3) Suggest to introduce Builder to CompoundPlacementConstraint, with that, YARN app can call: {code} CompoundPlacementConstraint.newBuilder().and/or(<constraint-1>, <constraint-2>, ...) CompoundPlacementConstraint.newBuilder().and/or(<constraint-1>, <constraint-2>, ...) CompoundPlacementConstraint.newBuilder().and/or(List<DelayCriterion>, <constraint-1>, <constraint-2>, ...) {code} 4) SimplePlacementConstraint: Suggest to follow what we defined in doc, add two separate classes TargetConstraint​/CardinalityConstraint​, both extends PlacementConstraint. Limit to use 2 out of 3 fields is hard for app developer to understand/use. 5) Similarily, PlacementConstraintTarget. Suggest to introduce a Builder, which we can support following creations modes: {code} - toNodeAttributes(op, nodeAttributeKey, List<nodeAttibuteValue) - toAllocationTags(op, List<allocationTags>) {code} To your question: bq. // TODO: Should this be checked here or should it be part of a validation? I suggest treat allocationTags as value, and key of allocationTags is always empty. 6) Test: should add all PB classes to {{TestPBRecordImpl}}. > [API] Introduce Placement Constraint object > ------------------------------------------- > > Key: YARN-6593 > URL: https://issues.apache.org/jira/browse/YARN-6593 > Project: Hadoop YARN > Issue Type: Sub-task > Reporter: Konstantinos Karanasos > Assignee: Konstantinos Karanasos > Attachments: YARN-6593.001.patch > > > This JIRA introduces an object for defining placement constraints. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org