Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Conversation

@ishark
Copy link
Contributor

@ishark ishark commented Feb 29, 2016

Added list of affinity rules as attribute in DAGContext
Added validation for affinity, anti-affinity and locality rules in dag validate phase
Added handling of Container and Node affinity rules. Rack affinity is not supported at this point
Also added Changes for supporting Node specific request in Cloudera
Added Unit tests for affinity rules and dag validation for the same
Added Json String codec for setting affinity rules through properties.xml
Added Set Affinity and anti -affinity APIs to dag

@ishark ishark force-pushed the APEXCORE-10 branch 2 times, most recently from 6be49eb to 93fbd6a Compare March 3, 2016 01:45
@ishark
Copy link
Contributor Author

ishark commented Mar 3, 2016

@tweise Pleas review

@ishark
Copy link
Contributor Author

ishark commented Mar 3, 2016

Testing Done:

  1. Unit tests for Dag Validation scenarios
  2. Unit tests for host allocation based on affinity rules
  3. Tested following scenarios on Cloudera and Hortonworks:
    • Anti-affinity between partitions of operators
    • Anti-affinity between any two operators (stream connected and not connected)
    • Anti-affinity between parallel partitioned operators
    • Node and Container Affinity between operators not connected by stream
    • Node affinity between 2 Stream connected operators when the stream is not Node Local
    • Container affinity between 2 Stream connected operators when the stream is not Node Local
    • Affinity and Anti-affinity rules with Locality_host set for operator
    • Out of resources condition in case of Strict Anti-affinity. Application should keep waiting till resources are allocated as per rules
    • Checked preferred anti-affinity rules are dropped if resources are not available

@tweise
Copy link
Contributor

tweise commented Mar 26, 2016

@ishark there are merge conflicts, can you please rebase.

<artifactId>commons-beanutils-core</artifactId>
<groupId>commons-beanutils</groupId>
</exclusion>
<exclusion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added for supporting setting of Affinity Rules from properties.xml. Added a JsonStringCodec for reading Affinity Rule Json..

@tweise
Copy link
Contributor

tweise commented Mar 26, 2016

Haven't looked at the plan changes yet, rest looks good so far.

@ishark ishark force-pushed the APEXCORE-10 branch 3 times, most recently from 2bb1eb2 to a47829a Compare April 1, 2016 18:41
@ishark
Copy link
Contributor Author

ishark commented Apr 5, 2016

Have addressed most of the review comments except convenience APIs in DAG. Did quick sanity testing on Cloudera after changes.
@tweise Could you please review?

@tweise
Copy link
Contributor

tweise commented Apr 5, 2016

Looking at it.

this.setRelaxLocality(relaxLocality);
}

public AffinityRule(Type type, Locality locality, boolean relaxLocality, String... operators)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it require at least 2 operators? Is so, maybe make it String, String...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to String, String ..

@ishark ishark force-pushed the APEXCORE-10 branch 3 times, most recently from e6c27a8 to dbcbddc Compare April 6, 2016 00:19
List<String> blacklistNodes = resourceRequestor.getNodesExceptHost(requests.get(0).getNodes());
amRmClient.updateBlacklist(blacklistNodes, requests.get(0).getNodes());
blacklistedNodesForHostSpecificRequests = blacklistNodes;
LOG.info("Sending {} request(s) after blacklisting nodes {} and removed host from request {}", requests.size(), blacklistNodes, requests.get(0).getNodes());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have a concern with the logging of potentially very large collections of nodes (consider cluster size).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.

@ishark ishark force-pushed the APEXCORE-10 branch 3 times, most recently from 6d7f416 to 32c2ad2 Compare April 7, 2016 23:49
@ishark
Copy link
Contributor Author

ishark commented Apr 8, 2016

Have addressed review comments and updated diff.
Tests ran fine locally.

@tweise
Copy link
Contributor

tweise commented Apr 8, 2016

@ishark please resolve the merge conflict

ObjectReader reader = mapper.reader(clazz);
return reader.readValue(string);
} catch (IOException e) {
Throwables.propagate(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception propagation. No need for subsequent return null

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to fix the other occurrences in this file also and remove usage of DTThrowable.

@tweise
Copy link
Contributor

tweise commented Apr 8, 2016

Are the affinity sets updated when containers are added or removed due to dynamic partitioning? If they are not, please create a follow up JIRA so we can address it later.

…rators

Added list of affinity rules as attribute in DAGContext
Added validation for affinity, anti-affinity and locality rules in dag validate phase
Added handling of Container and Node affinity rules. Rack affinity is not supported at this point
Also added Changes for supporting Node specific request in Cloudera
Added Unit tests for affinity rules and dag validation for the same
Added Json String codec for setting affinity rules through properties.xml
Added Set Affinity and anti -affinity APIs to dag

Update node reports regularly and keep waiting on requests if host cannot be allocated
@ishark
Copy link
Contributor Author

ishark commented Apr 8, 2016

I have added reassigning of anti-affinity sets for containers in assignContainers after repartitioning is done. But will create a follow up Jira to validate dynamic update scenarios.

@asfgit asfgit merged commit 7167aac into apache:master Apr 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants