-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOTFIX] Listeners not getting registered to the bus in CarbonSessionState Implementations #1821
Conversation
b95da5b
to
5b41ec5
Compare
if (null == operationEventListeners) { | ||
operationEventListeners = new CopyOnWriteArrayList<>(); | ||
operationEventListeners = new CopyOnWriteArraySet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Insertion order of listeners is important. Please use LinkedHashSet
- Also, we need ensure only one object for listener type is added. One way is to use wrapper object with equals, hashcode on Qualified Class name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Changed the code to use addIfAbsent method instead of add. This will take care of dublicate entries.
- changed the OperationEventListener interface to abstract class with equals and hashcode which will compare the class name.
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2890/ |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1657/ |
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2893/ |
5b41ec5
to
74cbba0
Compare
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1668/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2899/ |
74cbba0
to
49bc938
Compare
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1673/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2905/ |
@kunal642 Please fix checkstyle issues |
49bc938
to
411c7a1
Compare
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1686/ |
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2919/ |
@@ -75,6 +75,8 @@ class CarbonSessionCatalog( | |||
env | |||
} | |||
|
|||
CarbonEnv.initListeners() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a CarbonEnv.init function, can you put this initialization inside that
return getClass().getName(); | ||
} | ||
|
||
@Override public int hashCode() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move @OverRide to previous line
411c7a1
to
21bd909
Compare
@jackylk handled all the review comments. |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2954/ |
@@ -216,6 +216,8 @@ class CarbonSessionStateBuilder(sparkSession: SparkSession, | |||
new CarbonUDFTransformRule, | |||
new CarbonLateDecodeRule) | |||
|
|||
CarbonEnv.initListeners() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same, this is moved to CarbonEnv.init
21bd909
to
8a87d82
Compare
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1710/ |
8a87d82
to
cd78e0c
Compare
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2944/ |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2973/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1719/ |
cd78e0c
to
04d23d9
Compare
retest this please |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2983/ |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1735/ |
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2969/ |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1739/ |
@kunal642 It is better to remove lazy val for carbonenv in carbonsessionstate to make sure it registers while creating session. |
b353edb
to
e9458b2
Compare
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2994/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2981/ |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1751/ |
815b8e1
to
2f5a69a
Compare
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1755/ |
2f5a69a
to
2d684c9
Compare
Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2985/ |
SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2998/ |
retest sdv please |
Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1758/ |
2d684c9
to
db2240c
Compare
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2999/ |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2988/ |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/3000/ |
LGTM |
Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2991/ |
Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1761/ |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/3002/ |
SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/3003/ |
…State Implementations Problem: Listeners are not getting registered if you create a new implementation of CarbonSessionState and add it to spark using configuration. In this case CarbonSession would not be created and thus listeners are not registered. Solution: Register listeners in CarbonSessionState instead of CarbonSession. This closes apache#1821
Problem: Listeners are not getting registered if you create a new implementation of CarbonSessionState and add it to spark using configuration. In this case CarbonSession would not be created and thus listeners are not registered.
Solution: Register listeners in CarbonSessionState instead of CarbonSession.
Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:
Any interfaces changed?
Any backward compatibility impacted?
Document update required?
Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance test report.
- Any additional information to help reviewers in testing this change.
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.