[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

classic Classic list List threaded Threaded
105 messages Options
123456
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2484: [WIP] added hadoop conf to thread local

qiuchenjian-2
Github user ravipesala commented on the issue:

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



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

[GitHub] carbondata issue #2484: [WIP] added hadoop conf to thread local

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

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



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

[GitHub] carbondata issue #2484: [WIP] added hadoop conf to thread local

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

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



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

[GitHub] carbondata issue #2484: [WIP] added hadoop conf to thread local

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

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



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

[GitHub] carbondata issue #2484: [WIP] added hadoop conf to thread local

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

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



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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484#discussion_r202580853
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java ---
    @@ -43,11 +45,19 @@
        */
       private static final LogService LOGGER =
           LogServiceFactory.getLogService(FileFactory.class.getName());
    -  private static Configuration configuration = null;
     
    -  static {
    -    configuration = new Configuration();
    +  public static Configuration getConfiguration() {
    +    Configuration configuration;
    +    if (ThreadLocalSessionInfo.getCarbonSessionInfo() == null) {
    +      configuration = new Configuration();
    +    } else {
    +      CarbonConfiguration carbonConfiguration =
    +          (CarbonConfiguration) ThreadLocalSessionInfo.getCarbonSessionInfo().getThreadParams()
    +              .getExtraInfo("carbonConf", new CarbonConfiguration());
    +      configuration = carbonConfiguration.getConfiguration();
    +    }
         configuration.addResource(new Path("../core-default.xml"));
    --- End diff --
   
    Move add resource from core-site.xml to the line just after new Configuration(); Otherwise it may overwrite the details got from thread.


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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484#discussion_r202580900
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonConfiguration.java ---
    @@ -0,0 +1,73 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.util;
    +
    +import java.io.ByteArrayInputStream;
    +import java.io.ByteArrayOutputStream;
    +import java.io.IOException;
    +import java.io.ObjectInputStream;
    +import java.io.ObjectOutputStream;
    +import java.io.Serializable;
    +
    +import org.apache.carbondata.core.datastore.compression.CompressorFactory;
    +
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.hadoop.fs.Path;
    +
    +public class CarbonConfiguration implements Serializable {
    +
    +  private static final long serialVersionUID = 3811544264223154007L;
    +  private transient Configuration configuration;
    +  private byte[] confBytes;
    +
    +  public CarbonConfiguration(Configuration configuration) {
    +    ByteArrayOutputStream bao = new ByteArrayOutputStream();
    +    try {
    +      ObjectOutputStream oos = new ObjectOutputStream(bao);
    +      configuration.write(oos);
    +      oos.close();
    +      this.confBytes =
    +          CompressorFactory.getInstance().getCompressor().compressByte(bao.toByteArray());
    +    } catch (IOException e) {
    +      throw new RuntimeException(e);
    +    }
    +  }
    +
    +  public CarbonConfiguration() {
    +    this.configuration = new Configuration();
    +  }
    +
    +  public Configuration getConfiguration() {
    +    if (configuration == null) {
    +      if (confBytes == null) {
    +        throw new RuntimeException("Configuration not specified");
    +      }
    +      configuration = new Configuration(false);
    +      ByteArrayInputStream bias = new ByteArrayInputStream(
    +          CompressorFactory.getInstance().getCompressor().unCompressByte(confBytes));
    +      try {
    +        ObjectInputStream ois = new ObjectInputStream(bias);
    +        configuration.readFields(ois);
    +        ois.close();
    +      } catch (IOException e) {
    +        throw new RuntimeException(e);
    +      }
    +    }
    +    configuration.addResource(new Path("../core-default.xml"));
    --- End diff --
   
    Move add resource from core-site.xml to the line just after new Configuration(); Otherwise it may overwrite the details got from de-serialized bytes


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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484#discussion_r202581713
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java ---
    @@ -43,11 +45,19 @@
        */
       private static final LogService LOGGER =
           LogServiceFactory.getLogService(FileFactory.class.getName());
    -  private static Configuration configuration = null;
     
    -  static {
    -    configuration = new Configuration();
    +  public static Configuration getConfiguration() {
    --- End diff --
   
    1) Please segregate all cofig handling to CarbonConfiguration. You can add a util function as getConfFromSession
    2) FileFactory.getDataInputStream already accepts the config parameter. I suggest to unify the callers of this method also through CarbonConfiguration


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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484#discussion_r202582047
 
    --- Diff: integration/spark-common/src/main/scala/org/apache/spark/rdd/UpdateCoalescedRDD.scala ---
    @@ -0,0 +1,89 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.rdd
    +
    +import scala.reflect.ClassTag
    +
    +import org.apache.spark._
    +
    +import org.apache.carbondata.spark.rdd.CarbonRDD
    +
    +
    +// This RDD distributes previous RDD data based on number of nodes. i.e., one partition for one node
    +
    +class UpdateCoalescedRDD[T: ClassTag](
    --- End diff --
   
    newly added class required?


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

[GitHub] carbondata issue #2484: [WIP] added hadoop conf to thread local

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

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



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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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/2484#discussion_r202585871
 
    --- Diff: integration/spark-common/src/main/scala/org/apache/spark/rdd/UpdateCoalescedRDD.scala ---
    @@ -0,0 +1,89 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.rdd
    +
    +import scala.reflect.ClassTag
    +
    +import org.apache.spark._
    +
    +import org.apache.carbondata.spark.rdd.CarbonRDD
    +
    +
    +// This RDD distributes previous RDD data based on number of nodes. i.e., one partition for one node
    +
    +class UpdateCoalescedRDD[T: ClassTag](
    --- End diff --
   
    removed


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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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/2484#discussion_r202585892
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java ---
    @@ -43,11 +45,19 @@
        */
       private static final LogService LOGGER =
           LogServiceFactory.getLogService(FileFactory.class.getName());
    -  private static Configuration configuration = null;
     
    -  static {
    -    configuration = new Configuration();
    +  public static Configuration getConfiguration() {
    --- End diff --
   
    removed config parameters from FileFactory


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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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/2484#discussion_r202585994
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonConfiguration.java ---
    @@ -0,0 +1,73 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.util;
    +
    +import java.io.ByteArrayInputStream;
    +import java.io.ByteArrayOutputStream;
    +import java.io.IOException;
    +import java.io.ObjectInputStream;
    +import java.io.ObjectOutputStream;
    +import java.io.Serializable;
    +
    +import org.apache.carbondata.core.datastore.compression.CompressorFactory;
    +
    +import org.apache.hadoop.conf.Configuration;
    +import org.apache.hadoop.fs.Path;
    +
    +public class CarbonConfiguration implements Serializable {
    +
    +  private static final long serialVersionUID = 3811544264223154007L;
    +  private transient Configuration configuration;
    +  private byte[] confBytes;
    +
    +  public CarbonConfiguration(Configuration configuration) {
    +    ByteArrayOutputStream bao = new ByteArrayOutputStream();
    +    try {
    +      ObjectOutputStream oos = new ObjectOutputStream(bao);
    +      configuration.write(oos);
    +      oos.close();
    +      this.confBytes =
    +          CompressorFactory.getInstance().getCompressor().compressByte(bao.toByteArray());
    +    } catch (IOException e) {
    +      throw new RuntimeException(e);
    +    }
    +  }
    +
    +  public CarbonConfiguration() {
    +    this.configuration = new Configuration();
    +  }
    +
    +  public Configuration getConfiguration() {
    +    if (configuration == null) {
    +      if (confBytes == null) {
    +        throw new RuntimeException("Configuration not specified");
    +      }
    +      configuration = new Configuration(false);
    +      ByteArrayInputStream bias = new ByteArrayInputStream(
    +          CompressorFactory.getInstance().getCompressor().unCompressByte(confBytes));
    +      try {
    +        ObjectInputStream ois = new ObjectInputStream(bias);
    +        configuration.readFields(ois);
    +        ois.close();
    +      } catch (IOException e) {
    +        throw new RuntimeException(e);
    +      }
    +    }
    +    configuration.addResource(new Path("../core-default.xml"));
    --- End diff --
   
    done


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

[GitHub] carbondata pull request #2484: [WIP] added hadoop conf to thread local

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/2484#discussion_r202586005
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java ---
    @@ -43,11 +45,19 @@
        */
       private static final LogService LOGGER =
           LogServiceFactory.getLogService(FileFactory.class.getName());
    -  private static Configuration configuration = null;
     
    -  static {
    -    configuration = new Configuration();
    +  public static Configuration getConfiguration() {
    +    Configuration configuration;
    +    if (ThreadLocalSessionInfo.getCarbonSessionInfo() == null) {
    +      configuration = new Configuration();
    +    } else {
    +      CarbonConfiguration carbonConfiguration =
    +          (CarbonConfiguration) ThreadLocalSessionInfo.getCarbonSessionInfo().getThreadParams()
    +              .getExtraInfo("carbonConf", new CarbonConfiguration());
    +      configuration = carbonConfiguration.getConfiguration();
    +    }
         configuration.addResource(new Path("../core-default.xml"));
    --- End diff --
   
    done


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

[GitHub] carbondata issue #2484: [HOTFIX] added hadoop conf to thread local

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

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



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

[GitHub] carbondata issue #2484: [HOTFIX] added hadoop conf to thread local

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

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



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

[GitHub] carbondata issue #2484: [HOTFIX] added hadoop conf to thread local

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

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



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

[GitHub] carbondata issue #2484: [HOTFIX] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484
 
    retest this please


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

[GitHub] carbondata issue #2484: [HOTFIX] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484
 
    retest sdv please



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

[GitHub] carbondata pull request #2484: [HOTFIX] added hadoop conf to thread local

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

    https://github.com/apache/carbondata/pull/2484#discussion_r203050151
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/impl/FileFactory.java ---
    @@ -43,11 +45,19 @@
        */
       private static final LogService LOGGER =
           LogServiceFactory.getLogService(FileFactory.class.getName());
    -  private static Configuration configuration = null;
     
    -  static {
    -    configuration = new Configuration();
    -    configuration.addResource(new Path("../core-default.xml"));
    +  public static Configuration getConfiguration() {
    +    Configuration configuration;
    +    if (ThreadLocalSessionInfo.getCarbonSessionInfo() == null) {
    +      configuration = new Configuration();
    +      configuration.addResource(new Path("../core-default.xml"));
    +    } else {
    +      CarbonConfiguration carbonConfiguration =
    +          (CarbonConfiguration) ThreadLocalSessionInfo.getCarbonSessionInfo().getThreadParams()
    --- End diff --
   
    Also handle case carbonConf not present even ThreadLocalSessionInfo is present, required for other than spark cases


---
123456