You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/01/22 12:37:24 UTC

[GitHub] ravipesala commented on a change in pull request #3089: [HOTFIX] presto carbon doesn't work with Hadoop conf in cluster.

ravipesala commented on a change in pull request #3089: [HOTFIX] presto carbon doesn't work with Hadoop conf in cluster. 
URL: https://github.com/apache/carbondata/pull/3089#discussion_r249761819
 
 

 ##########
 File path: integration/presto/src/main/java/org/apache/carbondata/presto/impl/CarbonTableReader.java
 ##########
 @@ -209,20 +207,21 @@ public TBase create() {
               tablePath);
 
       wrapperTableInfo.setTransactionalTable(isTransactionalTable);
-
-      CarbonMetadata.getInstance().removeTable(wrapperTableInfo.getTableUniqueName());
-      // Step 4: Load metadata info into CarbonMetadata
-      CarbonMetadata.getInstance().loadTableMetadata(wrapperTableInfo);
-      CarbonTable carbonTable = Objects.requireNonNull(
-          CarbonMetadata.getInstance().getCarbonTable(table.getSchemaName(), table.getTableName()),
-          "carbontable is null");
-      // If table is not previously cached, then:
-      if (cache == null) {
-        cache = new CarbonTableCacheModel(modifiedTime, carbonTable);
-        // cache the table
-        carbonCache.get().put(table, cache);
-      } else {
-        cache.setCarbonTable(carbonTable);
+      // multiple tasks can be launched in a worker concurrently. Hence need to synchronize this.
+      synchronized (this) {
 
 Review comment:
   Better keep schema reading also in synchronized block
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services