carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [carbondata] branch master updated: [CARBONDATA-3656] set Default TaskNo To Avoid Conflicts when concurrently write data by SDK
Date Sat, 11 Jan 2020 13:40:17 GMT
This is an automated email from the ASF dual-hosted git repository.

jackylk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new c52e90d  [CARBONDATA-3656] set Default TaskNo To Avoid Conflicts when concurrently
write data by SDK
c52e90d is described below

commit c52e90d3403c60d752edb7e2dbad5405b7025ac7
Author: xubo245 <601450868@qq.com>
AuthorDate: Wed Jan 8 22:20:01 2020 +0800

    [CARBONDATA-3656] set Default TaskNo To Avoid Conflicts when concurrently write data by
SDK
    
    Why is this PR needed?
    
    Fix Conflicts when concurrently write data by SDK and didn't set taskNo
    
    What changes were proposed in this PR?
    
    set Default TaskNo when TaskNo is null
    
    Does this PR introduce any user interface change?
    
    No
    
    Is any new testcase added?
    
    No
    
    This closes #3567
---
 .../main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
index cbf899f..2284cb9 100644
--- a/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
+++ b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.TreeMap;
+import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
@@ -629,6 +630,9 @@ public class CarbonWriterBuilder {
     if (this.schema == null) {
       throw new RuntimeException("schema should be set");
     }
+    if (taskNo == null) {
+      taskNo = UUID.randomUUID().toString().replace("-", "");
+    }
     CarbonLoadModel loadModel = buildLoadModel(schema);
     loadModel.setSdkWriterCores(numOfThreads);
     CarbonProperties.getInstance()


Mime
View raw message