[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

qiuchenjian-2
GitHub user qiuchenjian opened a pull request:

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

    [CARBONDATA-3142]Add timestamp with thread name which created by CarbonThreadFactory

    [CARBONDATA-3142]Add timestamp with thread name which created by CarbonThreadFactory
   
    Be sure to do all of the following checklist to help us incorporate
    your contribution quickly and easily:
   
     - [NA] 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/qiuchenjian/carbondata BugFix

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

    https://github.com/apache/carbondata/pull/2970.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 #2970
   
----
commit 33d10ecdafe0cbe4bc7de2f4a9346173f11eacb6
Author: qiuchenjian <807169000@...>
Date:   2018-12-03T07:19:37Z

    [CARBONDATA-3142]Add timestamp with thread name which created by CarbonThreadFactory

----


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2970
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1615/



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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    Please add more description , why we need this pr. thanks.


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    Build Success with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9875/



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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1826/



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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    > Please add more description , why we need this pr. thanks.
   
    Done


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    @KanakaKumar @ravipesala @jackylk @kunal642 @ajantha-bhat  @xubo245  @QiangCai  CI pass, Please review it.


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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

    https://github.com/apache/carbondata/pull/2970#discussion_r240444131
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonThreadFactory.java ---
    @@ -34,14 +34,26 @@
        */
       private String name;
     
    +  private boolean withTime = false;
    +
       public CarbonThreadFactory(String name) {
         this.defaultFactory = Executors.defaultThreadFactory();
         this.name = name;
       }
     
    +  public CarbonThreadFactory(String name, boolean withTime) {
    +    this(name);
    +    this.withTime = withTime;
    +  }
    +
       @Override public Thread newThread(Runnable r) {
         final Thread thread = defaultFactory.newThread(r);
    -    thread.setName(name);
    +    if (withTime) {
    +      thread.setName(name + "_" + System.currentTimeMillis());
    --- End diff --
   
    timestamp maybe the same for different newThread, UUID is better.


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
     @qiuchenjian the checklist should be select correctly, you can refer https://github.com/apache/carbondata/pull/2981


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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

    https://github.com/apache/carbondata/pull/2970#discussion_r240447425
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonThreadFactory.java ---
    @@ -34,14 +34,26 @@
        */
       private String name;
     
    +  private boolean withTime = false;
    +
       public CarbonThreadFactory(String name) {
         this.defaultFactory = Executors.defaultThreadFactory();
         this.name = name;
       }
     
    +  public CarbonThreadFactory(String name, boolean withTime) {
    +    this(name);
    +    this.withTime = withTime;
    +  }
    +
       @Override public Thread newThread(Runnable r) {
         final Thread thread = defaultFactory.newThread(r);
    -    thread.setName(name);
    +    if (withTime) {
    +      thread.setName(name + "_" + System.currentTimeMillis());
    --- End diff --
   
    @xubo245  
    timestamp is different for diff thread, bacause ms is fine-gained and  Thread pool creates thread one by one normally。
    timestamp is more useful than uuid, it indicates creation time


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    > @qiuchenjian the checklist should be select correctly, you can refer #2981 or other PR
   
    done


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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/2970#discussion_r244005707
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonThreadFactory.java ---
    @@ -34,14 +34,26 @@
        */
       private String name;
     
    +  private boolean withTime = false;
    +
       public CarbonThreadFactory(String name) {
         this.defaultFactory = Executors.defaultThreadFactory();
         this.name = name;
       }
     
    +  public CarbonThreadFactory(String name, boolean withTime) {
    +    this(name);
    +    this.withTime = withTime;
    +  }
    +
       @Override public Thread newThread(Runnable r) {
         final Thread thread = defaultFactory.newThread(r);
    -    thread.setName(name);
    +    if (withTime) {
    +      thread.setName(name + "_" + System.currentTimeMillis());
    +    }
    +    else {
    --- End diff --
   
    move to previous line


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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/2970#discussion_r244005751
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerColumnar.java ---
    @@ -144,14 +144,14 @@ private void initParameters(CarbonFactDataHandlerModel model) {
         blockletProcessingCount = new AtomicInteger(0);
         producerExecutorService = Executors.newFixedThreadPool(model.getNumberOfCores(),
             new CarbonThreadFactory(
    -            "ProducerPool_" + System.nanoTime() + ":" + model.getTableName() + ", range: " + model
    -                .getBucketId()));
    +            "ProducerPool:" + model.getTableName() + ", range: " + model
    --- End diff --
   
    better to use String.format


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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/2970#discussion_r244005776
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerColumnar.java ---
    @@ -144,14 +144,14 @@ private void initParameters(CarbonFactDataHandlerModel model) {
         blockletProcessingCount = new AtomicInteger(0);
         producerExecutorService = Executors.newFixedThreadPool(model.getNumberOfCores(),
             new CarbonThreadFactory(
    -            "ProducerPool_" + System.nanoTime() + ":" + model.getTableName() + ", range: " + model
    -                .getBucketId()));
    +            "ProducerPool:" + model.getTableName() + ", range: " + model
    +                .getBucketId(), true));
         producerExecutorServiceTaskList =
             new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
         LOGGER.debug("Initializing writer executors");
         consumerExecutorService = Executors.newFixedThreadPool(1, new CarbonThreadFactory(
    -        "ConsumerPool_" + System.nanoTime() + ":" + model.getTableName() + ", range: " + model
    -            .getBucketId()));
    +        "ConsumerPool:" + model.getTableName() + ", range: " + model
    --- End diff --
   
    better to use String.format()


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1946/



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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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

    https://github.com/apache/carbondata/pull/2970#discussion_r244013962
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonThreadFactory.java ---
    @@ -34,14 +34,26 @@
        */
       private String name;
     
    +  private boolean withTime = false;
    +
       public CarbonThreadFactory(String name) {
         this.defaultFactory = Executors.defaultThreadFactory();
         this.name = name;
       }
     
    +  public CarbonThreadFactory(String name, boolean withTime) {
    +    this(name);
    +    this.withTime = withTime;
    +  }
    +
       @Override public Thread newThread(Runnable r) {
         final Thread thread = defaultFactory.newThread(r);
    -    thread.setName(name);
    +    if (withTime) {
    +      thread.setName(name + "_" + System.currentTimeMillis());
    +    }
    +    else {
    --- End diff --
   
    done


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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

    https://github.com/apache/carbondata/pull/2970#discussion_r244013967
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerColumnar.java ---
    @@ -144,14 +144,14 @@ private void initParameters(CarbonFactDataHandlerModel model) {
         blockletProcessingCount = new AtomicInteger(0);
         producerExecutorService = Executors.newFixedThreadPool(model.getNumberOfCores(),
             new CarbonThreadFactory(
    -            "ProducerPool_" + System.nanoTime() + ":" + model.getTableName() + ", range: " + model
    -                .getBucketId()));
    +            "ProducerPool:" + model.getTableName() + ", range: " + model
    --- End diff --
   
    done


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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

    https://github.com/apache/carbondata/pull/2970#discussion_r244013978
 
    --- Diff: processing/src/main/java/org/apache/carbondata/processing/store/CarbonFactDataHandlerColumnar.java ---
    @@ -144,14 +144,14 @@ private void initParameters(CarbonFactDataHandlerModel model) {
         blockletProcessingCount = new AtomicInteger(0);
         producerExecutorService = Executors.newFixedThreadPool(model.getNumberOfCores(),
             new CarbonThreadFactory(
    -            "ProducerPool_" + System.nanoTime() + ":" + model.getTableName() + ", range: " + model
    -                .getBucketId()));
    +            "ProducerPool:" + model.getTableName() + ", range: " + model
    +                .getBucketId(), true));
         producerExecutorServiceTaskList =
             new ArrayList<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
         LOGGER.debug("Initializing writer executors");
         consumerExecutorService = Executors.newFixedThreadPool(1, new CarbonThreadFactory(
    -        "ConsumerPool_" + System.nanoTime() + ":" + model.getTableName() + ", range: " + model
    -            .getBucketId()));
    +        "ConsumerPool:" + model.getTableName() + ", range: " + model
    --- End diff --
   
    done


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

[GitHub] carbondata pull request #2970: [CARBONDATA-3142]Add timestamp with thread na...

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

    https://github.com/apache/carbondata/pull/2970#discussion_r244015783
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonThreadFactory.java ---
    @@ -34,14 +34,26 @@
        */
       private String name;
     
    +  private boolean withTime = false;
    +
       public CarbonThreadFactory(String name) {
         this.defaultFactory = Executors.defaultThreadFactory();
         this.name = name;
       }
     
    +  public CarbonThreadFactory(String name, boolean withTime) {
    +    this(name);
    +    this.withTime = withTime;
    +  }
    +
       @Override public Thread newThread(Runnable r) {
         final Thread thread = defaultFactory.newThread(r);
    -    thread.setName(name);
    +    if (withTime) {
    +      thread.setName(name + "_" + System.currentTimeMillis());
    --- End diff --
   
    Why not use nanotime, since the caller below used nanotime previously?


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

[GitHub] carbondata issue #2970: [CARBONDATA-3142]Add timestamp with thread name whic...

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

    https://github.com/apache/carbondata/pull/2970
 
    Build Success with Spark 2.3.2, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/10199/



---
12