Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Add builder patter and deprecate some APIs #424

Merged

Conversation

pavolloffay
Copy link
Member

@pavolloffay pavolloffay commented May 23, 2018

Related to #395
Continuation of #414 (review)

Signed-off-by: Pavol Loffay ploffay@redhat.com

@ghost ghost assigned pavolloffay May 23, 2018
@ghost ghost added the review label May 23, 2018
@pavolloffay
Copy link
Member Author

After this we could release 0.28.0 and then remove these deprecations. WDYT?

@codecov
Copy link

codecov bot commented May 23, 2018

Codecov Report

Merging #424 into master will decrease coverage by 0.14%.
The diff coverage is 90%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #424      +/-   ##
============================================
- Coverage     87.21%   87.07%   -0.15%     
+ Complexity      512      510       -2     
============================================
  Files            66       66              
  Lines          1955     1980      +25     
  Branches        258      258              
============================================
+ Hits           1705     1724      +19     
- Misses          160      166       +6     
  Partials         90       90
Impacted Files Coverage Δ Complexity Δ
...main/java/io/jaegertracing/senders/HttpSender.java 92.72% <ø> (ø) 6 <0> (ø) ⬇️
...acing/baggage/RemoteBaggageRestrictionManager.java 93.44% <100%> (-6.56%) 10 <0> (-2)
...ava/io/jaegertracing/reporters/RemoteReporter.java 83.33% <50%> (-1.86%) 7 <0> (ø)
...re/src/main/java/io/jaegertracing/SpanContext.java 89.79% <0%> (+1.42%) 25% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed5791d...8242acf. Read the comment docs.

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

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

LGTM - only some minor comments


/**
* @param denyBaggageOnInitializationFailure determines the startup failure mode of
* RemoteBaggageRestrictionManager. If denyBaggageOnInitializationFailure is true,
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: would it not be better to move the bulk of the text above, to provide a description, and leave the @param line brief?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am fine with as it is. The text is copied from the constructor as it was. If you have the text add it here and I will update it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point - although I think because now the parameters are separated into their own "with..." methods, each method now has the opportunity to clearly describe what it represents. One possible way to change would be move all text from "If denyBaggageOn...." to the main description block, e.g.

    /**
     * If denyBaggageOnInitializationFailure is true,
     * {@link RemoteBaggageRestrictionManager} will not allow any baggage to be written until
     * baggage restrictions have been retrieved from agent. If denyBaggageOnInitializationFailure is
     * false, {@link RemoteBaggageRestrictionManager} will allow any baggage to be written until
     * baggage restrictions have been retrieved from agent.
     *
     * @param denyBaggageOnInitializationFailure determines the startup failure mode of RemoteBaggageRestrictionManager
     */

/**
* @param serviceName restrictions for this service are kept track of
*/
public Builder(String serviceName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this now the general convention being used - as the serviceName is essentially mandatory it is a constructor parameter, but all other info is optional so provided via with... methods?

Copy link
Member Author

Choose a reason for hiding this comment

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

Look at other builders requiring serviceName - Tracer.Builder, RemoteControllerSampler.Builder . Configuration. All require service name as mandatory parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, I have also changed the other one

}

/**
* @param initialDelayMs delay before first fetch of restrictions. It is only exposed for testing
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: as above, might be better to put the explanation above as part of a description block, and just have some brief text on the param.

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@pavolloffay pavolloffay force-pushed the deprecate-apis-baggage-manager branch from 11456d0 to e5360a0 Compare May 23, 2018 10:45
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@pavolloffay pavolloffay merged commit ac8bd93 into jaegertracing:master May 23, 2018
@ghost ghost removed the review label May 23, 2018
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.

2 participants