[GitHub] carbondata pull request #1821: [WIP]refactored code to support external sess...

classic Classic list List threaded Threaded
47 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1821: [WIP]refactored code to support external sess...

qiuchenjian-2
GitHub user kunal642 opened a pull request:

    https://github.com/apache/carbondata/pull/1821

    [WIP]refactored code to support external session state impl

    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.
   


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kunal642/carbondata preagg_refactor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1821.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1821
   
----
commit b95da5bed4be937b5d02890f9e279ee59b933fd9
Author: kunal642 <kunalkapoor642@...>
Date:   2018-01-17T10:03:25Z

    refactored code to support external session state impl

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1821: [WIP]refactored code to support external sess...

qiuchenjian-2
Github user KanakaKumar commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1821#discussion_r162035296
 
    --- Diff: core/src/main/java/org/apache/carbondata/events/OperationListenerBus.java ---
    @@ -57,9 +57,9 @@ public OperationListenerBus addListener(Class<? extends Event> eventClass,
           OperationEventListener operationEventListener) {
     
         String eventType = eventClass.getName();
    -    List<OperationEventListener> operationEventListeners = eventMap.get(eventType);
    +    Set<OperationEventListener> operationEventListeners = eventMap.get(eventType);
         if (null == operationEventListeners) {
    -      operationEventListeners = new CopyOnWriteArrayList<>();
    +      operationEventListeners = new CopyOnWriteArraySet<>();
    --- End diff --
   
    Insertion order of listeners is important.  Please use LinkedHashSet


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [WIP]refactored code to support external session sta...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2890/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [WIP]refactored code to support external session sta...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1657/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [WIP]refactored code to support external session sta...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2893/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1821: [HOTFIX] Listeners not getting registered to ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1821#discussion_r162052102
 
    --- Diff: core/src/main/java/org/apache/carbondata/events/OperationListenerBus.java ---
    @@ -57,9 +57,9 @@ public OperationListenerBus addListener(Class<? extends Event> eventClass,
           OperationEventListener operationEventListener) {
     
         String eventType = eventClass.getName();
    -    List<OperationEventListener> operationEventListeners = eventMap.get(eventType);
    +    Set<OperationEventListener> operationEventListeners = eventMap.get(eventType);
         if (null == operationEventListeners) {
    -      operationEventListeners = new CopyOnWriteArrayList<>();
    +      operationEventListeners = new CopyOnWriteArraySet<>();
    --- End diff --
   
    1) Changed the code to use addIfAbsent method instead of add. This will take care of dublicate entries.
    2) changed the OperationEventListener interface to abstract class with equals and hashcode which will compare the class name.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1668/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2899/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1673/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2905/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    @kunal642 Please fix checkstyle issues


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1686/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2919/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1821: [HOTFIX] Listeners not getting registered to ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1821#discussion_r162264804
 
    --- Diff: integration/spark2/src/main/spark2.1/CarbonSessionState.scala ---
    @@ -75,6 +75,8 @@ class CarbonSessionCatalog(
         env
       }
     
    +  CarbonEnv.initListeners()
    --- End diff --
   
    There is a CarbonEnv.init function, can you put this initialization inside that


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1821: [HOTFIX] Listeners not getting registered to ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1821#discussion_r162264895
 
    --- Diff: core/src/main/java/org/apache/carbondata/events/OperationEventListener.java ---
    @@ -19,13 +19,29 @@
     /**
      * Event listener interface which describes the possible events
      */
    -public interface OperationEventListener {
    +public abstract class OperationEventListener {
     
       /**
        * Called on a specified event occurrence
        *
        * @param event
        * @param operationContext
        */
    -  void onEvent(Event event, OperationContext operationContext) throws Exception;
    +  protected abstract void onEvent(Event event, OperationContext operationContext) throws Exception;
    +
    +  @Override
    +  public boolean equals(Object obj) {
    +    if (obj == null || !(obj instanceof OperationEventListener)) {
    +      return false;
    +    }
    +    return getComparisonName().equals(((OperationEventListener) obj).getComparisonName());
    +  }
    +
    +  private String getComparisonName() {
    +    return getClass().getName();
    +  }
    +
    +  @Override public int hashCode() {
    --- End diff --
   
    move @Override to previous line


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    @jackylk handled all the review comments.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2954/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1821: [HOTFIX] Listeners not getting registered to ...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1821#discussion_r162273088
 
    --- Diff: integration/spark2/src/main/spark2.2/CarbonSessionState.scala ---
    @@ -216,6 +216,8 @@ class CarbonSessionStateBuilder(sparkSession: SparkSession,
         new CarbonUDFTransformRule,
         new CarbonLateDecodeRule)
     
    +  CarbonEnv.initListeners()
    --- End diff --
   
    The same, this is moved to CarbonEnv.init


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1710/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1821: [HOTFIX] Listeners not getting registered to the bus...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1821
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2944/



---
123