Repository: carbondata Updated Branches: refs/heads/master c0d858139 -> e01916b6b
[HOTFIX] replace apache common log with carbondata log4j replace apache common log with carbondata log4j This closes #2999 Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/e01916b6 Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/e01916b6 Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/e01916b6 Branch: refs/heads/master Commit: e01916b6bff6daf6ccbc359d44baeabfadf6a0bf Parents: c0d8581 Author: brijoobopanna <brijoobopa...@huawei.com> Authored: Tue Dec 18 16:15:13 2018 +0530 Committer: xuchuanyin <xuchuan...@hust.edu.cn> Committed: Thu Dec 20 14:23:15 2018 +0800 ---------------------------------------------------------------------- .../org/apache/carbondata/core/datamap/TableDataMap.java | 7 ++++--- .../indexstore/blockletindex/BlockletDataMapFactory.java | 3 --- .../org/apache/carbondata/core/util/BlockletDataMapUtil.java | 7 ++++--- .../apache/carbondata/core/util/ObjectSerializationUtil.java | 8 +++++--- .../org/apache/carbondata/hadoop/api/CarbonInputFormat.java | 7 ++++--- .../apache/carbondata/hadoop/api/CarbonTableInputFormat.java | 7 ++++--- .../carbondata/hadoop/api/CarbonTableOutputFormat.java | 7 ++++--- .../apache/carbondata/hive/server/HiveEmbeddedServer2.java | 7 ++++--- .../loading/iterator/CarbonOutputIteratorWrapper.java | 7 ++++--- 9 files changed, 33 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java b/core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java index 4de7449..86390e8 100644 --- a/core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java +++ b/core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java @@ -29,6 +29,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.apache.carbondata.common.annotations.InterfaceAudience; +import org.apache.carbondata.common.logging.LogServiceFactory; import org.apache.carbondata.core.constants.CarbonCommonConstants; import org.apache.carbondata.core.datamap.dev.BlockletSerializer; import org.apache.carbondata.core.datamap.dev.DataMap; @@ -50,8 +51,7 @@ import org.apache.carbondata.events.Event; import org.apache.carbondata.events.OperationContext; import org.apache.carbondata.events.OperationEventListener; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.apache.log4j.Logger; /** * Index at the table level, user can add any number of DataMap for one table, by @@ -74,7 +74,8 @@ public final class TableDataMap extends OperationEventListener { private SegmentPropertiesFetcher segmentPropertiesFetcher; - private static final Log LOG = LogFactory.getLog(TableDataMap.class); + private static final Logger LOG = + LogServiceFactory.getLogService(TableDataMap.class.getName()); /** * It is called to initialize and load the required table datamap metadata. http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java b/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java index 096a5e3..5892f78 100644 --- a/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java +++ b/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java @@ -54,8 +54,6 @@ import org.apache.carbondata.core.util.BlockletDataMapUtil; import org.apache.carbondata.core.util.path.CarbonTablePath; import org.apache.carbondata.events.Event; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.Path; @@ -67,7 +65,6 @@ import org.apache.hadoop.fs.RemoteIterator; public class BlockletDataMapFactory extends CoarseGrainDataMapFactory implements BlockletDetailsFetcher, SegmentPropertiesFetcher, CacheableDataMap { - private static final Log LOG = LogFactory.getLog(BlockletDataMapFactory.class); private static final String NAME = "clustered.btree.blocklet"; /** * variable for cache level BLOCKLET http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/core/src/main/java/org/apache/carbondata/core/util/BlockletDataMapUtil.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/util/BlockletDataMapUtil.java b/core/src/main/java/org/apache/carbondata/core/util/BlockletDataMapUtil.java index fbdeff8..b81bc75 100644 --- a/core/src/main/java/org/apache/carbondata/core/util/BlockletDataMapUtil.java +++ b/core/src/main/java/org/apache/carbondata/core/util/BlockletDataMapUtil.java @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; +import org.apache.carbondata.common.logging.LogServiceFactory; import org.apache.carbondata.core.constants.CarbonCommonConstants; import org.apache.carbondata.core.datamap.Segment; import org.apache.carbondata.core.datastore.block.SegmentProperties; @@ -60,15 +61,15 @@ import org.apache.carbondata.core.scan.executor.util.QueryUtil; import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf; import org.apache.carbondata.core.util.path.CarbonTablePath; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; +import org.apache.log4j.Logger; public class BlockletDataMapUtil { - private static final Log LOG = LogFactory.getLog(BlockletDataMapUtil.class); + private static final Logger LOG = + LogServiceFactory.getLogService(BlockletDataMapUtil.class.getName()); public static Map<String, BlockMetaInfo> getBlockMetaInfoMap( TableBlockIndexUniqueIdentifierWrapper identifierWrapper, http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java b/core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java index 020787d..9a4c02d 100644 --- a/core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java +++ b/core/src/main/java/org/apache/carbondata/core/util/ObjectSerializationUtil.java @@ -24,15 +24,17 @@ import java.io.ObjectOutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.apache.carbondata.common.logging.LogServiceFactory; + +import org.apache.log4j.Logger; /** * It provides methods to convert object to Base64 string and vice versa. */ public class ObjectSerializationUtil { - private static final Log LOG = LogFactory.getLog(ObjectSerializationUtil.class); + private static final Logger LOG = + LogServiceFactory.getLogService(ObjectSerializationUtil.class.getName()); /** * Convert object to Base64 String http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java ---------------------------------------------------------------------- diff --git a/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java b/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java index 843f564..c35862a 100644 --- a/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java +++ b/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.lang.reflect.Constructor; import java.util.*; +import org.apache.carbondata.common.logging.LogServiceFactory; import org.apache.carbondata.core.constants.CarbonCommonConstants; import org.apache.carbondata.core.constants.CarbonCommonConstantsInternal; import org.apache.carbondata.core.datamap.DataMapChooser; @@ -69,8 +70,6 @@ import org.apache.carbondata.hadoop.readsupport.CarbonReadSupport; import org.apache.carbondata.hadoop.readsupport.impl.DictionaryDecodeReadSupport; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; @@ -82,6 +81,7 @@ import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.input.FileSplit; import org.apache.hadoop.mapreduce.security.TokenCache; +import org.apache.log4j.Logger; /** * Base class for carbondata input format, there are two input format implementations: @@ -100,7 +100,8 @@ public abstract class CarbonInputFormat<T> extends FileInputFormat<Void, T> { "mapreduce.input.carboninputformat.validsegments"; // comma separated list of input files private static final String ALTER_PARTITION_ID = "mapreduce.input.carboninputformat.partitionid"; - private static final Log LOG = LogFactory.getLog(CarbonInputFormat.class); + private static final Logger LOG = + LogServiceFactory.getLogService(CarbonInputFormat.class.getName()); private static final String FILTER_PREDICATE = "mapreduce.input.carboninputformat.filter.predicate"; private static final String COLUMN_PROJECTION = "mapreduce.input.carboninputformat.projection"; http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java ---------------------------------------------------------------------- diff --git a/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java b/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java index 86cbfec..ea1bcd3 100644 --- a/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java +++ b/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableInputFormat.java @@ -27,6 +27,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import org.apache.carbondata.common.logging.LogServiceFactory; import org.apache.carbondata.core.datamap.DataMapStoreManager; import org.apache.carbondata.core.datamap.Segment; import org.apache.carbondata.core.datamap.TableDataMap; @@ -60,8 +61,6 @@ import org.apache.carbondata.core.util.CarbonUtil; import org.apache.carbondata.core.util.path.CarbonTablePath; import org.apache.carbondata.hadoop.CarbonInputSplit; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.BlockLocation; import org.apache.hadoop.fs.FileStatus; @@ -71,6 +70,7 @@ import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.lib.input.FileSplit; +import org.apache.log4j.Logger; /** * InputFormat for reading carbondata files with table level metadata support, @@ -86,7 +86,8 @@ public class CarbonTableInputFormat<T> extends CarbonInputFormat<T> { // comma separated list of input files public static final String INPUT_FILES = "mapreduce.input.carboninputformat.files"; private static final String ALTER_PARTITION_ID = "mapreduce.input.carboninputformat.partitionid"; - private static final Log LOG = LogFactory.getLog(CarbonTableInputFormat.class); + private static final Logger LOG = + LogServiceFactory.getLogService(CarbonTableInputFormat.class.getName()); private static final String CARBON_READ_SUPPORT = "mapreduce.input.carboninputformat.readsupport"; private static final String CARBON_CONVERTER = "mapreduce.input.carboninputformat.converter"; private static final String CARBON_TRANSACTIONAL_TABLE = http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableOutputFormat.java ---------------------------------------------------------------------- diff --git a/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableOutputFormat.java b/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableOutputFormat.java index b109f30..85fb315 100644 --- a/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableOutputFormat.java +++ b/hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonTableOutputFormat.java @@ -25,6 +25,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicLong; +import org.apache.carbondata.common.logging.LogServiceFactory; import org.apache.carbondata.core.constants.CarbonCommonConstants; import org.apache.carbondata.core.constants.CarbonLoadOptionConstants; import org.apache.carbondata.core.datastore.compression.CompressorFactory; @@ -46,8 +47,6 @@ import org.apache.carbondata.processing.loading.model.CarbonDataLoadSchema; import org.apache.carbondata.processing.loading.model.CarbonLoadModel; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.NullWritable; @@ -55,6 +54,7 @@ import org.apache.hadoop.mapreduce.OutputCommitter; import org.apache.hadoop.mapreduce.RecordWriter; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; +import org.apache.log4j.Logger; /** * This is table level output format which writes the data to store in new segment. Each load @@ -116,7 +116,8 @@ public class CarbonTableOutputFormat extends FileOutputFormat<NullWritable, Obje */ public static final String OPERATION_CONTEXT = "mapreduce.carbontable.operation.context"; - private static final Log LOG = LogFactory.getLog(CarbonTableOutputFormat.class); + private static final Logger LOG = + LogServiceFactory.getLogService(CarbonTableOutputFormat.class.getName()); private CarbonOutputCommitter committer; http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/integration/hive/src/main/java/org/apache/carbondata/hive/server/HiveEmbeddedServer2.java ---------------------------------------------------------------------- diff --git a/integration/hive/src/main/java/org/apache/carbondata/hive/server/HiveEmbeddedServer2.java b/integration/hive/src/main/java/org/apache/carbondata/hive/server/HiveEmbeddedServer2.java index 5bc6461..0b42ab9 100644 --- a/integration/hive/src/main/java/org/apache/carbondata/hive/server/HiveEmbeddedServer2.java +++ b/integration/hive/src/main/java/org/apache/carbondata/hive/server/HiveEmbeddedServer2.java @@ -27,8 +27,8 @@ import java.util.Random; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.apache.carbondata.common.logging.LogServiceFactory; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; @@ -39,6 +39,7 @@ import org.apache.hive.service.Service; import org.apache.hive.service.cli.CLIService; import org.apache.hive.service.cli.SessionHandle; import org.apache.hive.service.server.HiveServer2; +import org.apache.log4j.Logger; /** * Utility starting a local/embedded Hive org.apache.carbondata.hive.server for testing purposes. @@ -48,7 +49,7 @@ import org.apache.hive.service.server.HiveServer2; */ public class HiveEmbeddedServer2 { private static final String SCRATCH_DIR = "/tmp/hive"; - private static final Log log = LogFactory.getLog(Hive.class); + private static final Logger log = LogServiceFactory.getLogService(Hive.class.getName()); private HiveServer2 hiveServer; private HiveConf config; private int port; http://git-wip-us.apache.org/repos/asf/carbondata/blob/e01916b6/processing/src/main/java/org/apache/carbondata/processing/loading/iterator/CarbonOutputIteratorWrapper.java ---------------------------------------------------------------------- diff --git a/processing/src/main/java/org/apache/carbondata/processing/loading/iterator/CarbonOutputIteratorWrapper.java b/processing/src/main/java/org/apache/carbondata/processing/loading/iterator/CarbonOutputIteratorWrapper.java index a00b562..3e29288 100644 --- a/processing/src/main/java/org/apache/carbondata/processing/loading/iterator/CarbonOutputIteratorWrapper.java +++ b/processing/src/main/java/org/apache/carbondata/processing/loading/iterator/CarbonOutputIteratorWrapper.java @@ -21,10 +21,10 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.TimeUnit; import org.apache.carbondata.common.CarbonIterator; +import org.apache.carbondata.common.logging.LogServiceFactory; import org.apache.carbondata.core.util.CarbonProperties; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.apache.log4j.Logger; /** * It is wrapper class to hold the rows in batches when record writer writes the data and allows @@ -32,7 +32,8 @@ import org.apache.commons.logging.LogFactory; */ public class CarbonOutputIteratorWrapper extends CarbonIterator<Object[]> { - private static final Log LOG = LogFactory.getLog(CarbonOutputIteratorWrapper.class); + private static final Logger LOG = + LogServiceFactory.getLogService(CarbonOutputIteratorWrapper.class.getName()); private boolean close;