Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2484#discussion_r203057588 --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonConfiguration.java --- @@ -0,0 +1,74 @@ +/* + * 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(); + configuration.addResource(new Path("../core-default.xml")); + } + + public Configuration getConfiguration() { --- End diff -- Better to have explicit methods to serialize and de-serialize, otherwise every configuration call needs to deserialize, which is not required --- |
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_r203061344 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonRDD.scala --- @@ -79,14 +66,11 @@ abstract class CarbonRDD[T: ClassTag](@transient sc: SparkContext, } def getConf: Configuration = { - val configuration = new Configuration(false) - val bai = new ByteArrayInputStream(CompressorFactory.getInstance().getCompressor - .unCompressByte(confBytes)) - val ois = new ObjectInputStream(bai) - configuration.readFields(ois) - ois.close() - configuration + val carbonConfiguration = carbonSessionInfo.getThreadParams.getExtraInfo("carbonConf") --- End diff -- Also need to handle InputFormat and OutputFormat cases where configuration is explicitly passed using job interface. --- |
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_r203071359 --- Diff: core/src/main/java/org/apache/carbondata/core/util/CarbonConfiguration.java --- @@ -0,0 +1,74 @@ +/* + * 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(); + configuration.addResource(new Path("../core-default.xml")); + } + + public Configuration getConfiguration() { --- End diff -- Once CarbonConfiguration is set into ThreadLocal only FileFactory and CarbonRDD will try to deserialize the configuration. This will be done once per instance of CarbonConfiguration. If configuration is already deserialized we will return the same object. --- |
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/5891/ --- |
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/7265/ --- |
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/6033/ --- |
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_r203263435 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonRDD.scala --- @@ -79,14 +66,11 @@ abstract class CarbonRDD[T: ClassTag](@transient sc: SparkContext, } def getConf: Configuration = { - val configuration = new Configuration(false) - val bai = new ByteArrayInputStream(CompressorFactory.getInstance().getCompressor - .unCompressByte(confBytes)) - val ois = new ObjectInputStream(bai) - configuration.readFields(ois) - ois.close() - configuration + val carbonConfiguration = carbonSessionInfo.getThreadParams.getExtraInfo("carbonConf") --- End diff -- done --- |
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_r203263551 --- 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 -- already handled If carbonConf is not present taking new CarbonConfiguration as default value --- |
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/7276/ --- |
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/6045/ --- |
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/7281/ --- |
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/6048/ --- |
In reply to this post by qiuchenjian-2
Github user kunal642 commented on the issue:
https://github.com/apache/carbondata/pull/2484 retest this please --- |
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/7287/ --- |
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/6054/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2484 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5910/ --- |
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/6085/ --- |
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/6091/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/2484 retest this please --- |
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/6094/ --- |
Free forum by Nabble | Edit this page |