Skip to content

Highlights and load#126

Merged
asfgit merged 3 commits intoapache:masterfrom
ahgittin:highlights-and-load
Oct 5, 2017
Merged

Highlights and load#126
asfgit merged 3 commits intoapache:masterfrom
ahgittin:highlights-and-load

Conversation

@ahgittin
Copy link
Copy Markdown
Contributor

uses apache/brooklyn-server#818 to add highlights for software-specific entities. also adds new perf test.

Copy link
Copy Markdown
Member

@tbouron tbouron left a comment

Choose a reason for hiding this comment

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

Thanks @ahgittin, in general LGTM but I added a few comments.


public static class MemberTrackingPolicy extends AbstractMembershipTrackingPolicy {
@Override protected void onEntityEvent(EventType type, Entity member) {
defaultHighlightAction(type, entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not needed as this policy extends AbstractMembershipTrackingPolicy and onEntityEvent already call defaultHighlightAction

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this method overrides that method and doesn't call super so it has to redo it here, doesn't it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Meh, you're right, I didn't see the missing super call for some reason.

}
@Override protected void onEntityRemoved(Entity member) {
// TODO shouldn't be invoked - remove
log.warn("Removal handler should be hidden by event handler", new Throwable("Trace for unexpected mongo node handler"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure I understand what this is for: is this an error per se? Looks like a removal is handled correctly so why the warn message? Can you give a bit more details ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

more a note to developer (it caught me out) - due to the onEntityEvent handler being overridden this method is not used

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That make sense now, as onEntityEvent does not call super

}
@Override protected void onEntityChange(Entity member) {
// TODO shouldn't be invoked - remove
log.warn("Change handler should be hidden by event handler", new Throwable("Trace for unexpected mongo node handler"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above

public static class MemberTrackingPolicy extends AbstractMembershipTrackingPolicy {
@Override
protected void onEntityEvent(EventType type, Entity entity) {
defaultHighlightAction(type, entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not needed as this policy extends AbstractMembershipTrackingPolicy and onEntityEvent already call defaultHighlightAction

public static class ServerPoolMemberTrackerPolicy extends AbstractMembershipTrackingPolicy {
@Override
protected void onEntityEvent(EventType type, Entity entity) {
defaultHighlightAction(type, entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above


public static class MemberTrackingPolicy extends AbstractMembershipTrackingPolicy {
@Override protected void onEntityEvent(EventType type, Entity member) {
defaultHighlightAction(type, entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above

public static class UrlMappingsMemberTrackerPolicy extends AbstractMembershipTrackingPolicy {
@Override
protected void onEntityEvent(EventType type, Entity entity) {
defaultHighlightAction(type, entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above

public static class ServerPoolMemberTrackerPolicy extends AbstractMembershipTrackingPolicy {
@Override
protected void onEntityEvent(EventType type, Entity entity) {
defaultHighlightAction(type, entity);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above

.persistMode(PersistMode.CLEAN)
.highAvailabilityMode(HighAvailabilityMode.MASTER)
.persistMode(doPersistence() ? PersistMode.CLEAN : PersistMode.DISABLED)
.highAvailabilityMode(doPersistence() ? HighAvailabilityMode.MASTER : HighAvailabilityMode.DISABLED)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think for a flag, a field would be cleaner than a method to override

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

due to how tests are structured and annotated methods run by the framework, methods for this sort of thing are easier to work with i find. happy if you want to spike an alternative with fields but i doubt it's better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good point, didn't think of the complexity due to the framework and annotation. Your solution works so let's go with that, we can iterate on it later on

@ahgittin
Copy link
Copy Markdown
Contributor Author

ahgittin commented Oct 4, 2017

thanks for the comments @tbouron - i've replied, and think the PR as it stands is correct. wdyt?

@ahgittin
Copy link
Copy Markdown
Contributor Author

ahgittin commented Oct 4, 2017

Retest this please.

@tbouron
Copy link
Copy Markdown
Member

tbouron commented Oct 4, 2017

@ahgittin Yup, looks good but I would like Jenkins to be happy before merging it.

Looking at the logs, looks like the failure is unrelated though

@ahgittin
Copy link
Copy Markdown
Contributor Author

ahgittin commented Oct 4, 2017

hmm, failure is related:

[ERROR] /home/jenkins/jenkins-slave/workspace/brooklyn-library-pull-requests/software/network/src/test/java/org/apache/brooklyn/entity/network/bind/PrefixAndIdEnricher.java:[56,9] cannot find symbol
  symbol:   method highlightTriggers(org.apache.brooklyn.api.sensor.AttributeSensor<capture#1 of ?>,<nulltype>)
  location: class org.apache.brooklyn.entity.network.bind.PrefixAndIdEnricher

it's trying to reference org.apache.brooklyn:brooklyn-parent:0.12.0-SNAPSHOT. have merged in master branch which changes deps to 0.13.0, retest will now hopefully be happy.

@ahgittin
Copy link
Copy Markdown
Contributor Author

ahgittin commented Oct 5, 2017

tests good after merging master, so merging this

@asfgit asfgit merged commit 582d2b6 into apache:master Oct 5, 2017
asfgit pushed a commit that referenced this pull request Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants