carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [6/9] incubator-carbondata git commit: clean up core
Date Wed, 04 Jan 2017 13:35:00 GMT
http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/FileHolderImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/FileHolderImpl.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/FileHolderImpl.java
index 5fefb7b..9a5c06a 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/FileHolderImpl.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/FileHolderImpl.java
@@ -20,6 +20,7 @@
 package org.apache.carbondata.core.datastorage.store.impl;
 
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
@@ -27,18 +28,11 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.core.datastorage.store.FileHolder;
 
 public class FileHolderImpl implements FileHolder {
   /**
-   * Attribute for Carbon LOGGER
-   */
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(FileHolderImpl.class.getName());
-  /**
    * cache to hold filename and its stream
    */
   private Map<String, FileChannel> fileNameAndStreamCache;
@@ -65,7 +59,8 @@ public class FileHolderImpl implements FileHolder {
    * @param length   number of bytes to be read
    * @return read byte array
    */
-  @Override public byte[] readByteArray(String filePath, long offset, int length) {
+  @Override public byte[] readByteArray(String filePath, long offset, int length)
+      throws IOException {
     FileChannel fileChannel = updateCache(filePath);
     ByteBuffer byteBffer = read(fileChannel, length, offset);
     return byteBffer.array();
@@ -74,19 +69,13 @@ public class FileHolderImpl implements FileHolder {
   /**
    * This method will be used to close all the streams currently present in the cache
    */
-  @Override public void finish() {
-
+  @Override public void finish() throws IOException {
     for (Entry<String, FileChannel> entry : fileNameAndStreamCache.entrySet()) {
-      try {
-        FileChannel channel = entry.getValue();
-        if (null != channel) {
-          channel.close();
-        }
-      } catch (IOException exception) {
-        LOGGER.error(exception, exception.getMessage());
+      FileChannel channel = entry.getValue();
+      if (null != channel) {
+        channel.close();
       }
     }
-
   }
 
   /**
@@ -97,7 +86,7 @@ public class FileHolderImpl implements FileHolder {
    * @param offset   reading start position,
    * @return read int
    */
-  @Override public int readInt(String filePath, long offset) {
+  @Override public int readInt(String filePath, long offset) throws IOException {
     FileChannel fileChannel = updateCache(filePath);
     ByteBuffer byteBffer = read(fileChannel, CarbonCommonConstants.INT_SIZE_IN_BYTE, offset);
     return byteBffer.getInt();
@@ -110,7 +99,7 @@ public class FileHolderImpl implements FileHolder {
    * @param filePath fully qualified file path
    * @return read int
    */
-  @Override public int readInt(String filePath) {
+  @Override public int readInt(String filePath) throws IOException {
     FileChannel fileChannel = updateCache(filePath);
     ByteBuffer byteBffer = read(fileChannel, CarbonCommonConstants.INT_SIZE_IN_BYTE);
     return byteBffer.getInt();
@@ -124,7 +113,7 @@ public class FileHolderImpl implements FileHolder {
    * @param offset   reading start position,
    * @return read int
    */
-  @Override public long readDouble(String filePath, long offset) {
+  @Override public long readDouble(String filePath, long offset) throws IOException {
     FileChannel fileChannel = updateCache(filePath);
     ByteBuffer byteBffer = read(fileChannel, CarbonCommonConstants.LONG_SIZE_IN_BYTE, offset);
     return byteBffer.getLong();
@@ -138,16 +127,12 @@ public class FileHolderImpl implements FileHolder {
    * @param filePath fully qualified file path
    * @return channel
    */
-  private FileChannel updateCache(String filePath) {
+  private FileChannel updateCache(String filePath) throws FileNotFoundException {
     FileChannel fileChannel = fileNameAndStreamCache.get(filePath);
-    try {
-      if (null == fileChannel) {
-        FileInputStream stream = new FileInputStream(filePath);
-        fileChannel = stream.getChannel();
-        fileNameAndStreamCache.put(filePath, fileChannel);
-      }
-    } catch (IOException e) {
-      LOGGER.error(e, e.getMessage());
+    if (null == fileChannel) {
+      FileInputStream stream = new FileInputStream(filePath);
+      fileChannel = stream.getChannel();
+      fileNameAndStreamCache.put(filePath, fileChannel);
     }
     return fileChannel;
   }
@@ -160,14 +145,10 @@ public class FileHolderImpl implements FileHolder {
    * @param offset  position
    * @return byte buffer
    */
-  private ByteBuffer read(FileChannel channel, int size, long offset) {
+  private ByteBuffer read(FileChannel channel, int size, long offset) throws IOException {
     ByteBuffer byteBffer = ByteBuffer.allocate(size);
-    try {
-      channel.position(offset);
-      channel.read(byteBffer);
-    } catch (Exception e) {
-      LOGGER.error(e, e.getMessage());
-    }
+    channel.position(offset);
+    channel.read(byteBffer);
     byteBffer.rewind();
     return byteBffer;
   }
@@ -179,13 +160,9 @@ public class FileHolderImpl implements FileHolder {
    * @param size    number of bytes
    * @return byte buffer
    */
-  private ByteBuffer read(FileChannel channel, int size) {
+  private ByteBuffer read(FileChannel channel, int size) throws IOException {
     ByteBuffer byteBffer = ByteBuffer.allocate(size);
-    try {
-      channel.read(byteBffer);
-    } catch (Exception e) {
-      LOGGER.error(e, e.getMessage());
-    }
+    channel.read(byteBffer);
     byteBffer.rewind();
     return byteBffer;
   }
@@ -198,7 +175,7 @@ public class FileHolderImpl implements FileHolder {
    * @param length   number of bytes to be read
    * @return read byte array
    */
-  @Override public byte[] readByteArray(String filePath, int length) {
+  @Override public byte[] readByteArray(String filePath, int length) throws IOException {
     FileChannel fileChannel = updateCache(filePath);
     ByteBuffer byteBffer = read(fileChannel, length);
     return byteBffer.array();
@@ -212,7 +189,7 @@ public class FileHolderImpl implements FileHolder {
    * @param offset   reading start position,
    * @return read long
    */
-  @Override public long readLong(String filePath, long offset) {
+  @Override public long readLong(String filePath, long offset) throws IOException {
     FileChannel fileChannel = updateCache(filePath);
     ByteBuffer byteBffer = read(fileChannel, CarbonCommonConstants.LONG_SIZE_IN_BYTE, offset);
     return byteBffer.getLong();

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/MemoryMappedFileHolderImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/MemoryMappedFileHolderImpl.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/MemoryMappedFileHolderImpl.java
deleted file mode 100644
index 98d0039..0000000
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/MemoryMappedFileHolderImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.datastorage.store.impl;
-
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.carbondata.common.logging.LogService;
-import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.core.constants.CarbonCommonConstants;
-import org.apache.carbondata.core.datastorage.store.FileHolder;
-
-public class MemoryMappedFileHolderImpl implements FileHolder {
-
-  private static final LogService LOGGER =
-      LogServiceFactory.getLogService(MemoryMappedFileHolderImpl.class.getName());
-
-  private Map<String, FileChannel> fileNameAndStreamCache;
-  private Map<String, MappedByteBuffer> fileNameAndMemoryMappedFileCache;
-
-  public MemoryMappedFileHolderImpl() {
-    this(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
-  }
-
-  public MemoryMappedFileHolderImpl(int capacity) {
-    this.fileNameAndStreamCache = new HashMap<String, FileChannel>(capacity);
-    this.fileNameAndMemoryMappedFileCache = new HashMap<String, MappedByteBuffer>(capacity);
-  }
-
-  private MappedByteBuffer updateCache(String filePath) {
-    MappedByteBuffer byteBuffer = fileNameAndMemoryMappedFileCache.get(filePath);
-    try {
-      if (null == byteBuffer) {
-        FileChannel fileChannel = new RandomAccessFile(filePath, "r").getChannel();
-        byteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size());
-        fileNameAndStreamCache.put(filePath, fileChannel);
-        fileNameAndMemoryMappedFileCache.put(filePath, byteBuffer);
-      }
-    } catch (IOException e) {
-      LOGGER.error(e, e.getMessage());
-    }
-    return byteBuffer;
-  }
-
-  @Override
-  public byte[] readByteArray(String filePath, long offset, int length) {
-    byte[] dst = new byte[length];
-    updateCache(filePath).get(dst, (int)offset, length);
-    return dst;
-  }
-
-  @Override
-  public byte[] readByteArray(String filePath, int length) {
-    byte[] dst = new byte[length];
-    updateCache(filePath).get(dst);
-    return dst;
-  }
-
-  @Override
-  public int readInt(String filePath, long offset) {
-    byte[] dst = readByteArray(filePath, offset, CarbonCommonConstants.INT_SIZE_IN_BYTE);
-    return ByteBuffer.wrap(dst).getInt();
-  }
-
-  @Override
-  public long readLong(String filePath, long offset) {
-    byte[] dst = readByteArray(filePath, offset, CarbonCommonConstants.LONG_SIZE_IN_BYTE);
-    return ByteBuffer.wrap(dst).getLong();
-  }
-
-  @Override
-  public int readInt(String filePath) {
-    return updateCache(filePath).getInt();
-  }
-
-  @Override
-  public long readDouble(String filePath, long offset) {
-    byte[] dst = readByteArray(filePath, offset, CarbonCommonConstants.LONG_SIZE_IN_BYTE);
-    return ByteBuffer.wrap(dst).getLong();
-  }
-
-  @Override
-  public void finish() {
-    fileNameAndMemoryMappedFileCache.clear();
-    for (Entry<String, FileChannel> entry : fileNameAndStreamCache.entrySet()) {
-      try {
-        FileChannel channel = entry.getValue();
-        if (null != channel) {
-          channel.close();
-        }
-      } catch (IOException exception) {
-        LOGGER.error(exception, exception.getMessage());
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
index 3adc888..55ed307 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/AbstractHeavyCompressedDoubleArrayDataStore.java
@@ -64,8 +64,8 @@ public abstract class AbstractHeavyCompressedDoubleArrayDataStore
       values[i] = compressionModel.getUnCompressValues()[i].getNew();
       if (type[i] != CarbonCommonConstants.BYTE_VALUE_MEASURE) {
         values[i].setValue(
-            ValueCompressionUtil.getValueCompressor(compressionModel.getCompressionFinder()[i])
-                .getCompressedValues(compressionModel.getCompressionFinder()[i], dataHolder[i],
+            ValueCompressionUtil.getValueCompressor(compressionModel.getCompressionFinders()[i])
+                .getCompressedValues(compressionModel.getCompressionFinders()[i], dataHolder[i],
                     compressionModel.getMaxValue()[i],
                     compressionModel.getMantissa()[i]));
       } else {
@@ -80,8 +80,4 @@ public abstract class AbstractHeavyCompressedDoubleArrayDataStore
     return returnValue;
   }
 
-  @Override public short getLength() {
-    return values != null ? (short) values.length : 0;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
index b2a99c5..5b9e28b 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastorage/store/impl/data/compressed/HeavyCompressedDoubleArrayDataInMemoryStore.java
@@ -19,11 +19,7 @@
 
 package org.apache.carbondata.core.datastorage.store.impl.data.compressed;
 
-import org.apache.carbondata.core.datastorage.store.FileHolder;
-import org.apache.carbondata.core.datastorage.store.MeasureDataWrapper;
 import org.apache.carbondata.core.datastorage.store.compression.WriterCompressModel;
-import org.apache.carbondata.core.datastorage.store.dataholder.CarbonReadDataHolder;
-import org.apache.carbondata.core.datastorage.store.impl.CompressedDataMeasureDataWrapper;
 
 public class HeavyCompressedDoubleArrayDataInMemoryStore
     extends AbstractHeavyCompressedDoubleArrayDataStore {
@@ -32,34 +28,4 @@ public class HeavyCompressedDoubleArrayDataInMemoryStore
     super(compressionModel);
   }
 
-  @Override public MeasureDataWrapper getBackData(int[] cols, FileHolder fileHolder) {
-    if (null == compressionModel) {
-      return null;
-    }
-    CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
-    if (cols != null) {
-      for (int i = 0; i < cols.length; i++) {
-        vals[cols[i]] = values[cols[i]].uncompress(compressionModel.getConvertedDataType()[cols[i]])
-            .getValues(compressionModel.getMantissa()[cols[i]],
-                compressionModel.getMaxValue()[cols[i]]);
-      }
-    } else {
-      for (int i = 0; i < vals.length; i++) {
-
-        vals[i] = values[i].uncompress(compressionModel.getConvertedDataType()[i])
-            .getValues(compressionModel.getMantissa()[i], compressionModel.getMaxValue()[i]);
-      }
-    }
-    return new CompressedDataMeasureDataWrapper(vals);
-  }
-
-  @Override public MeasureDataWrapper getBackData(int cols, FileHolder fileHolder) {
-    if (null == compressionModel) {
-      return null;
-    }
-    CarbonReadDataHolder[] vals = new CarbonReadDataHolder[values.length];
-    vals[cols] = values[cols].uncompress(compressionModel.getConvertedDataType()[cols])
-        .getValues(compressionModel.getMantissa()[cols], compressionModel.getMaxValue()[cols]);
-    return new CompressedDataMeasureDataWrapper(vals);
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/DictionaryWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/DictionaryWriter.java b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/DictionaryWriter.java
index 8c160dc..6e870ee 100644
--- a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/DictionaryWriter.java
+++ b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/DictionaryWriter.java
@@ -18,12 +18,13 @@
  */
 package org.apache.carbondata.core.dictionary.generator;
 
+import java.io.IOException;
 
 /**
  * Interface to write dictionary to file system
  */
 public interface DictionaryWriter {
 
-  void writeDictionaryData(String tableUniqueName) throws Exception;
+  void writeDictionaryData(String tableUniqueName) throws IOException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/IncrementalColumnDictionaryGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/IncrementalColumnDictionaryGenerator.java b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/IncrementalColumnDictionaryGenerator.java
index fe84ef5..f157fa7 100644
--- a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/IncrementalColumnDictionaryGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/IncrementalColumnDictionaryGenerator.java
@@ -106,7 +106,7 @@ public class IncrementalColumnDictionaryGenerator implements BiDictionary<Intege
     }
   }
 
-  @Override public void writeDictionaryData(String tableUniqueName) throws Exception {
+  @Override public void writeDictionaryData(String tableUniqueName) throws IOException {
     // initialize params
     CarbonMetadata metadata = CarbonMetadata.getInstance();
     CarbonTable carbonTable = metadata.getCarbonTable(tableUniqueName);
@@ -179,8 +179,6 @@ public class IncrementalColumnDictionaryGenerator implements BiDictionary<Intege
           }
         }
       }
-    } catch (IOException ex) {
-      throw ex;
     } finally {
       if (null != dictionaryWriter) {
         dictionaryWriter.close();
@@ -206,7 +204,7 @@ public class IncrementalColumnDictionaryGenerator implements BiDictionary<Intege
                               DictionaryService dictionaryService,
                               CarbonTableIdentifier tableIdentifier,
                               ColumnIdentifier columnIdentifier,
-                              String storePath) throws Exception{
+                              String storePath) throws IOException{
     CarbonDictionarySortIndexWriter carbonDictionarySortIndexWriter = null;
     try {
       CarbonDictionarySortInfoPreparator preparator = new CarbonDictionarySortInfoPreparator();

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/ServerDictionaryGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/ServerDictionaryGenerator.java b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/ServerDictionaryGenerator.java
index 594ec41..bf88bb6 100644
--- a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/ServerDictionaryGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/ServerDictionaryGenerator.java
@@ -67,7 +67,7 @@ public class ServerDictionaryGenerator implements DictionaryGenerator<Integer, D
   public void writeDictionaryData() throws Exception {
     for (String tableUniqueName: tableMap.keySet()) {
       TableDictionaryGenerator generator = tableMap.get(tableUniqueName);
-      ((DictionaryWriter) generator).writeDictionaryData(tableUniqueName);
+      generator.writeDictionaryData(tableUniqueName);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/TableDictionaryGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/TableDictionaryGenerator.java b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/TableDictionaryGenerator.java
index addc3b6..3e8b78e 100644
--- a/core/src/main/java/org/apache/carbondata/core/dictionary/generator/TableDictionaryGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/dictionary/generator/TableDictionaryGenerator.java
@@ -21,7 +21,12 @@ package org.apache.carbondata.core.dictionary.generator;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
@@ -76,7 +81,7 @@ public class TableDictionaryGenerator
     return ((BiDictionary) generator).size();
   }
 
-  @Override public void writeDictionaryData(String tableUniqueName) throws Exception {
+  @Override public void writeDictionaryData(String tableUniqueName) {
     int numOfCores = 1;
     final String tableName = tableUniqueName;
     try {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java b/core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java
index bb0e8f8..0bf5cda 100644
--- a/core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java
+++ b/core/src/main/java/org/apache/carbondata/core/dictionary/server/DictionaryServer.java
@@ -54,7 +54,7 @@ public class DictionaryServer {
    * @param port
    * @throws Exception
    */
-  public void startServer(int port) throws Exception {
+  public void startServer(int port) {
     bootstrap = new ServerBootstrap();
     dictionaryServerHandler = new DictionaryServerHandler();
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/KeyGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/KeyGenerator.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/KeyGenerator.java
index dc50b10..686ea54 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/KeyGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/KeyGenerator.java
@@ -118,7 +118,4 @@ public interface KeyGenerator extends Serializable, Comparator<byte[]> {
    */
   int getDimCount();
 
-  int getStartAndEndKeySizeWithOnlyPrimitives();
-
-  void setStartAndEndKeySizeWithOnlyPrimitives(int startAndEndKeySizeWithPrimitives);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/ColumnarSplitter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/ColumnarSplitter.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/ColumnarSplitter.java
index b2ea154..c803566 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/ColumnarSplitter.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/ColumnarSplitter.java
@@ -68,24 +68,6 @@ public interface ColumnarSplitter {
   byte[] getKeyByteArray(byte[][] key);
 
   /**
-   * Takes the split keys and generates the surrogate key array in bytes
-   *
-   * @param key
-   * @param columnIndexes, takes columnIndexes to consider which columns are present in the key
-   * @return
-   */
-  byte[] getKeyByteArray(byte[][] key, int[] columnIndexes);
-
-  /**
-   * Takes the split keys and generates the surrogate key array
-   *
-   * @param key
-   * @param columnIndexes, takes columnIndexes to consider which columns are present in the key
-   * @return
-   */
-  long[] getKeyArray(byte[][] key, int[] columnIndexes);
-
-  /**
    * Below method will be used to get the block size
    *
    * @return

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthEquiSplitGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthEquiSplitGenerator.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthEquiSplitGenerator.java
index 9276fe3..baf74f9 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthEquiSplitGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthEquiSplitGenerator.java
@@ -22,6 +22,7 @@ package org.apache.carbondata.core.keygenerator.columnar.impl;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -39,19 +40,10 @@ import org.apache.carbondata.core.keygenerator.mdkey.MultiDimKeyVarLengthGenerat
 public class MultiDimKeyVarLengthEquiSplitGenerator extends MultiDimKeyVarLengthGenerator
     implements ColumnarSplitter {
 
-  /**
-   *
-   */
   private static final long serialVersionUID = -7767757692821917570L;
 
   private byte dimensionsToSplit;
 
-  private int[][] splitDimArray;
-
-  private int[][] dimBlockArray;
-
-  private int[][][] byteRangesForDims;
-
   private int[] blockKeySize;
 
   public MultiDimKeyVarLengthEquiSplitGenerator(int[] lens, byte dimensionsToSplit) {
@@ -89,17 +81,17 @@ public class MultiDimKeyVarLengthEquiSplitGenerator extends MultiDimKeyVarLength
       splits[i++] = range;
     }
     for (int j = 1; j < splits.length; j++) {
-      if (splits[j - 1].get(splits[j - 1].size() - 1) == splits[j].get(0)) {
+      if (Objects.equals(splits[j - 1].get(splits[j - 1].size() - 1), splits[j].get(0))) {
         splits[j].remove(0);
       }
     }
-    splitDimArray = new int[splits.length][];
+    int[][] splitDimArray = new int[splits.length][];
     for (int j = 0; j < splits.length; j++) {
       int[] a = convertToArray(splits[j]);
       splitDimArray[j] = a.length > 0 ? new int[] { a[0], a[a.length - 1] } : a;
     }
 
-    dimBlockArray = new int[byteRangesForKeys.length][];
+    int[][] dimBlockArray = new int[byteRangesForKeys.length][];
     Set<Integer>[] dimBlockSet = new Set[dimBlockArray.length];
     for (int k = 0; k < byteRangesForKeys.length; k++) {
       int[] dimRange = byteRangesForKeys[k];
@@ -127,7 +119,7 @@ public class MultiDimKeyVarLengthEquiSplitGenerator extends MultiDimKeyVarLength
           new int[0];
     }
 
-    byteRangesForDims = new int[byteRangesForKeys.length][][];
+    int[][][] byteRangesForDims = new int[byteRangesForKeys.length][][];
     for (int j = 0; j < byteRangesForKeys.length; j++) {
       if (dimBlockArray[j].length > 1) {
         int[] bArray1 = splitDimArrayLocalIndexes[dimBlockArray[j][0]];
@@ -207,14 +199,6 @@ public class MultiDimKeyVarLengthEquiSplitGenerator extends MultiDimKeyVarLength
     return fullKey;
   }
 
-  @Override public byte[] getKeyByteArray(byte[][] key, int[] columnIndexes) {
-    return null;
-  }
-
-  @Override public long[] getKeyArray(byte[][] key, int[] columnIndexes) {
-    return null;
-  }
-
   public int[] getBlockKeySize() {
     return blockKeySize;
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthVariableSplitGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthVariableSplitGenerator.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthVariableSplitGenerator.java
index 34515da..96eb468 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthVariableSplitGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/columnar/impl/MultiDimKeyVarLengthVariableSplitGenerator.java
@@ -23,6 +23,7 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -34,9 +35,6 @@ import org.apache.carbondata.core.keygenerator.mdkey.MultiDimKeyVarLengthGenerat
 public class MultiDimKeyVarLengthVariableSplitGenerator extends MultiDimKeyVarLengthGenerator
     implements ColumnarSplitter {
 
-  /**
-   *
-   */
   private static final long serialVersionUID = 1L;
 
   private int[] dimensionsToSplit;
@@ -83,7 +81,7 @@ public class MultiDimKeyVarLengthVariableSplitGenerator extends MultiDimKeyVarLe
       splits[i++] = range;
     }
     for (int j = 1; j < splits.length; j++) {
-      if (splits[j - 1].get(splits[j - 1].size() - 1) == splits[j].get(0)) {
+      if (Objects.equals(splits[j - 1].get(splits[j - 1].size() - 1), splits[j].get(0))) {
         splits[j].remove(0);
       }
     }
@@ -202,14 +200,6 @@ public class MultiDimKeyVarLengthVariableSplitGenerator extends MultiDimKeyVarLe
     return fullKey;
   }
 
-  @Override public byte[] getKeyByteArray(byte[][] key, int[] columnIndexes) {
-    return null;
-  }
-
-  @Override public long[] getKeyArray(byte[][] key, int[] columnIndexes) {
-    return null;
-  }
-
   public int[] getBlockKeySize() {
     return blockKeySize;
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityConstants.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityConstants.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityConstants.java
index e897843..146d96f 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityConstants.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityConstants.java
@@ -28,12 +28,12 @@ public interface TimeStampGranularityConstants {
    * java counts the number of milliseconds from  start of "January 1, 1970", this property is
    * customized the start of position. for example "January 1, 2000"
    */
-  public static final String CARBON_CUTOFF_TIMESTAMP = "carbon.cutOffTimestamp";
+  String CARBON_CUTOFF_TIMESTAMP = "carbon.cutOffTimestamp";
   /**
    * The property to set the timestamp (ie milis) conversion to the SECOND, MINUTE, HOUR
    * or DAY level
    */
-  public static final String CARBON_TIME_GRANULARITY = "carbon.timegranularity";
+  String CARBON_TIME_GRANULARITY = "carbon.timegranularity";
 
   /**
    * Second level key

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityTypeValue.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityTypeValue.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityTypeValue.java
index 3b50a5c..14e342c 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityTypeValue.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/directdictionary/timestamp/TimeStampGranularityTypeValue.java
@@ -49,7 +49,7 @@ public enum TimeStampGranularityTypeValue {
    *
    * @param value
    */
-  private TimeStampGranularityTypeValue(long value) {
+  TimeStampGranularityTypeValue(long value) {
     this.value = value;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/AbstractKeyGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/AbstractKeyGenerator.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/AbstractKeyGenerator.java
index 76128d4..951d56e 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/AbstractKeyGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/AbstractKeyGenerator.java
@@ -59,7 +59,7 @@ public abstract class AbstractKeyGenerator implements KeyGenerator {
   }
 
   @Override public void setProperty(Object key, Object value) {
-    /**
+    /*
      * No implementation required.
      */
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/MultiDimKeyVarLengthGenerator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/MultiDimKeyVarLengthGenerator.java b/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/MultiDimKeyVarLengthGenerator.java
index 6f8dd7d..5fba0cc 100644
--- a/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/MultiDimKeyVarLengthGenerator.java
+++ b/core/src/main/java/org/apache/carbondata/core/keygenerator/mdkey/MultiDimKeyVarLengthGenerator.java
@@ -29,7 +29,6 @@ public class MultiDimKeyVarLengthGenerator extends AbstractKeyGenerator {
    */
   protected int[][] byteRangesForKeys;
   private Bits bits;
-  private int startAndEndKeySizeWithPrimitives;
 
   public MultiDimKeyVarLengthGenerator(int[] lens) {
     bits = new Bits(lens);
@@ -105,13 +104,4 @@ public class MultiDimKeyVarLengthGenerator extends AbstractKeyGenerator {
     return bits.getKeyArray(key, maskedByteRanges);
   }
 
-  @Override public int getStartAndEndKeySizeWithOnlyPrimitives() {
-    return startAndEndKeySizeWithPrimitives;
-  }
-
-  @Override
-  public void setStartAndEndKeySizeWithOnlyPrimitives(int startAndEndKeySizeWithPrimitives) {
-    this.startAndEndKeySizeWithPrimitives = startAndEndKeySizeWithPrimitives;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/memory/HeapMemoryAllocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/memory/HeapMemoryAllocator.java b/core/src/main/java/org/apache/carbondata/core/memory/HeapMemoryAllocator.java
index 67e766c..62d5bdb 100644
--- a/core/src/main/java/org/apache/carbondata/core/memory/HeapMemoryAllocator.java
+++ b/core/src/main/java/org/apache/carbondata/core/memory/HeapMemoryAllocator.java
@@ -77,8 +77,6 @@ public class HeapMemoryAllocator implements MemoryAllocator {
         }
         pool.add(new WeakReference<>(memory));
       }
-    } else {
-      // Do nothing
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfo.java b/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfo.java
deleted file mode 100644
index 5cfa11b..0000000
--- a/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfo.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * 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.metadata;
-
-public class BlockletInfo {
-  /**
-   * fileName.
-   */
-  private String fileName;
-
-  /**
-   * keyOffset.
-   */
-  private long keyOffset;
-
-  /**
-   * measureOffset.
-   */
-  private long[] measureOffset;
-
-  /**
-   * measureLength.
-   */
-  private int[] measureLength;
-
-  /**
-   * keyLength.
-   */
-  private int keyLength;
-
-  /**
-   * numberOfKeys.
-   */
-  private int numberOfKeys;
-
-  /**
-   * startKey.
-   */
-  private byte[] startKey;
-
-  /**
-   * endKey.
-   */
-  private byte[] endKey;
-
-  /**
-   * getFileName().
-   *
-   * @return String.
-   */
-  public String getFileName() {
-    return fileName;
-  }
-
-  /**
-   * setFileName.
-   */
-  public void setFileName(String fileName) {
-    this.fileName = fileName;
-  }
-
-  /**
-   * getKeyOffset.
-   *
-   * @return long.
-   */
-  public long getKeyOffset() {
-    return keyOffset;
-  }
-
-  /**
-   * setKeyOffset.
-   *
-   * @param keyOffset
-   */
-  public void setKeyOffset(long keyOffset) {
-    this.keyOffset = keyOffset;
-  }
-
-  /**
-   * getMeasureLength
-   *
-   * @return int[].
-   */
-  public int[] getMeasureLength() {
-    return measureLength;
-  }
-
-  /**
-   * setMeasureLength.
-   *
-   * @param measureLength
-   */
-  public void setMeasureLength(int[] measureLength) {
-    this.measureLength = measureLength;
-  }
-
-  /**
-   * getKeyLength.
-   *
-   * @return
-   */
-  public int getKeyLength() {
-    return keyLength;
-  }
-
-  /**
-   * setKeyLength.
-   */
-  public void setKeyLength(int keyLength) {
-    this.keyLength = keyLength;
-  }
-
-  /**
-   * getMeasureOffset.
-   *
-   * @return long[].
-   */
-  public long[] getMeasureOffset() {
-    return measureOffset;
-  }
-
-  /**
-   * setMeasureOffset.
-   *
-   * @param measureOffset
-   */
-  public void setMeasureOffset(long[] measureOffset) {
-    this.measureOffset = measureOffset;
-  }
-
-  /**
-   * getNumberOfKeys()
-   *
-   * @return int.
-   */
-  public int getNumberOfKeys() {
-    return numberOfKeys;
-  }
-
-  /**
-   * setNumberOfKeys.
-   *
-   * @param numberOfKeys
-   */
-  public void setNumberOfKeys(int numberOfKeys) {
-    this.numberOfKeys = numberOfKeys;
-  }
-
-  /**
-   * getStartKey().
-   *
-   * @return byte[].
-   */
-  public byte[] getStartKey() {
-    return startKey;
-  }
-
-  /**
-   * setStartKey.
-   *
-   * @param startKey
-   */
-  public void setStartKey(byte[] startKey) {
-    this.startKey = startKey;
-  }
-
-  /**
-   * getEndKey().
-   *
-   * @return byte[].
-   */
-  public byte[] getEndKey() {
-    return endKey;
-  }
-
-  /**
-   * setEndKey.
-   *
-   * @param endKey
-   */
-  public void setEndKey(byte[] endKey) {
-    this.endKey = endKey;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfoColumnar.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfoColumnar.java b/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfoColumnar.java
index c12c556..c42bc93 100644
--- a/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfoColumnar.java
+++ b/core/src/main/java/org/apache/carbondata/core/metadata/BlockletInfoColumnar.java
@@ -22,13 +22,8 @@ package org.apache.carbondata.core.metadata;
 import java.util.BitSet;
 
 import org.apache.carbondata.core.datastorage.store.compression.WriterCompressModel;
-import org.apache.carbondata.core.keygenerator.mdkey.NumberCompressor;
 
 public class BlockletInfoColumnar {
-  /**
-   * fileName.
-   */
-  private String fileName;
 
   /**
    * measureOffset.
@@ -91,12 +86,6 @@ public class BlockletInfoColumnar {
   private long[] dataIndexMapOffsets;
 
   private boolean[] aggKeyBlock;
-  /**
-   * blockletMetaSize
-   */
-  private int blockletMetaSize;
-
-  private NumberCompressor[] keyBlockUnCompressor;
 
   private WriterCompressModel compressionModel;
 
@@ -122,22 +111,6 @@ public class BlockletInfoColumnar {
   private BitSet[] measureNullValueIndex;
 
   /**
-   * getFileName().
-   *
-   * @return String.
-   */
-  public String getFileName() {
-    return fileName;
-  }
-
-  /**
-   * setFileName.
-   */
-  public void setFileName(String fileName) {
-    this.fileName = fileName;
-  }
-
-  /**
    * getMeasureLength
    *
    * @return int[].
@@ -300,20 +273,6 @@ public class BlockletInfoColumnar {
   }
 
   /**
-   * @return the blockletMetaSize
-   */
-  public int getBlockletMetaSize() {
-    return blockletMetaSize;
-  }
-
-  /**
-   * @param blockletMetaSize the blockletMetaSize to set
-   */
-  public void setBlockletMetaSize(int blockletMetaSize) {
-    this.blockletMetaSize = blockletMetaSize;
-  }
-
-  /**
    * @return the dataIndexMapLenght
    */
   public int[] getDataIndexMapLength() {
@@ -343,14 +302,6 @@ public class BlockletInfoColumnar {
     this.aggKeyBlock = aggKeyBlock;
   }
 
-  public NumberCompressor[] getKeyBlockUnCompressor() {
-    return keyBlockUnCompressor;
-  }
-
-  public void setKeyBlockUnCompressor(NumberCompressor[] keyBlockUnCompressor) {
-    this.keyBlockUnCompressor = keyBlockUnCompressor;
-  }
-
   public byte[][] getColumnMaxData() {
     return this.columnMaxData;
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/reader/CarbonDictionaryReaderImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/reader/CarbonDictionaryReaderImpl.java b/core/src/main/java/org/apache/carbondata/core/reader/CarbonDictionaryReaderImpl.java
index bf475f5..75aecf3 100644
--- a/core/src/main/java/org/apache/carbondata/core/reader/CarbonDictionaryReaderImpl.java
+++ b/core/src/main/java/org/apache/carbondata/core/reader/CarbonDictionaryReaderImpl.java
@@ -137,9 +137,7 @@ public class CarbonDictionaryReaderImpl implements CarbonDictionaryReader {
         readDictionaryMetadataFile();
     List<ColumnDictionaryChunk> columnDictionaryChunks =
         read(carbonDictionaryColumnMetaChunks, startOffset, endOffset);
-    Iterator<byte[]> columnDictionaryChunkWrapper =
-        new ColumnDictionaryChunkIterator(columnDictionaryChunks);
-    return columnDictionaryChunkWrapper;
+    return (Iterator<byte[]>) new ColumnDictionaryChunkIterator(columnDictionaryChunks);
   }
 
   /**
@@ -174,9 +172,7 @@ public class CarbonDictionaryReaderImpl implements CarbonDictionaryReader {
     // open dictionary file thrift reader
     openThriftReader();
     // read the required number of chunks from dictionary file
-    List<ColumnDictionaryChunk> columnDictionaryChunks =
-        readDictionaryFile(startOffset, dictionaryChunkCountsToBeRead);
-    return columnDictionaryChunks;
+    return readDictionaryFile(startOffset, dictionaryChunkCountsToBeRead);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java b/core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java
index b9c3ae1..ef4318b 100644
--- a/core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java
+++ b/core/src/main/java/org/apache/carbondata/core/reader/CarbonFooterReader.java
@@ -65,14 +65,13 @@ public class CarbonFooterReader {
    * @return
    * @throws IOException
    */
-  private ThriftReader openThriftReader(String filePath) throws IOException {
+  private ThriftReader openThriftReader(String filePath) {
 
-    ThriftReader thriftReader = new ThriftReader(filePath, new ThriftReader.TBaseCreator() {
+    return new ThriftReader(filePath, new ThriftReader.TBaseCreator() {
       @Override public TBase create() {
         return new FileFooter();
       }
     });
-    return thriftReader;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/reader/ThriftReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/reader/ThriftReader.java b/core/src/main/java/org/apache/carbondata/core/reader/ThriftReader.java
index 0958349..81b7661 100644
--- a/core/src/main/java/org/apache/carbondata/core/reader/ThriftReader.java
+++ b/core/src/main/java/org/apache/carbondata/core/reader/ThriftReader.java
@@ -140,7 +140,7 @@ public class ThriftReader {
    * needs a way of obtaining instances of the class to be populated and this interface
    * defines the mechanism by which a client provides these instances.
    */
-  public static interface TBaseCreator {
+  public interface TBaseCreator {
     TBase create();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/reader/sortindex/CarbonDictionarySortIndexReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/reader/sortindex/CarbonDictionarySortIndexReader.java b/core/src/main/java/org/apache/carbondata/core/reader/sortindex/CarbonDictionarySortIndexReader.java
index e0bb413..4d5700c 100644
--- a/core/src/main/java/org/apache/carbondata/core/reader/sortindex/CarbonDictionarySortIndexReader.java
+++ b/core/src/main/java/org/apache/carbondata/core/reader/sortindex/CarbonDictionarySortIndexReader.java
@@ -34,7 +34,7 @@ public interface CarbonDictionarySortIndexReader extends Closeable {
    * @return The method return's the list of dictionary sort Index and sort Index reverse
    * @throws IOException In case any I/O error occurs
    */
-  public List<Integer> readSortIndex() throws IOException;
+  List<Integer> readSortIndex() throws IOException;
 
   /**
    * method for reading the carbon dictionary inverted sort index data
@@ -43,5 +43,5 @@ public interface CarbonDictionarySortIndexReader extends Closeable {
    * @return The method return's the list of dictionary inverted sort Index
    * @throws IOException In case any I/O error occurs
    */
-  public List<Integer> readInvertedSortIndex() throws IOException;
+  List<Integer> readInvertedSortIndex() throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/service/ColumnUniqueIdService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/service/ColumnUniqueIdService.java b/core/src/main/java/org/apache/carbondata/core/service/ColumnUniqueIdService.java
index 1c97082..cc974f0 100644
--- a/core/src/main/java/org/apache/carbondata/core/service/ColumnUniqueIdService.java
+++ b/core/src/main/java/org/apache/carbondata/core/service/ColumnUniqueIdService.java
@@ -30,5 +30,5 @@ public interface ColumnUniqueIdService {
    * @param columnSchema
    * @return generate unique id
    */
-  public String generateUniqueId(String databaseName, ColumnSchema columnSchema);
+  String generateUniqueId(String databaseName, ColumnSchema columnSchema);
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/service/DictionaryService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/service/DictionaryService.java b/core/src/main/java/org/apache/carbondata/core/service/DictionaryService.java
index 9b9ade6..14ec459 100644
--- a/core/src/main/java/org/apache/carbondata/core/service/DictionaryService.java
+++ b/core/src/main/java/org/apache/carbondata/core/service/DictionaryService.java
@@ -39,7 +39,7 @@ public interface DictionaryService {
    * @param carbonStorePath
    * @return
    */
-  public CarbonDictionaryWriter getDictionaryWriter(CarbonTableIdentifier carbonTableIdentifier,
+  CarbonDictionaryWriter getDictionaryWriter(CarbonTableIdentifier carbonTableIdentifier,
       ColumnIdentifier columnIdentifier, String carbonStorePath);
 
   /**
@@ -50,7 +50,7 @@ public interface DictionaryService {
    * @param carbonStorePath
    * @return
    */
-  public CarbonDictionarySortIndexWriter getDictionarySortIndexWriter(
+  CarbonDictionarySortIndexWriter getDictionarySortIndexWriter(
       CarbonTableIdentifier carbonTableIdentifier, ColumnIdentifier columnIdentifier,
       String carbonStorePath);
 
@@ -62,7 +62,7 @@ public interface DictionaryService {
    * @param carbonStorePath
    * @return
    */
-  public CarbonDictionaryMetadataReader getDictionaryMetadataReader(
+  CarbonDictionaryMetadataReader getDictionaryMetadataReader(
       CarbonTableIdentifier carbonTableIdentifier, ColumnIdentifier columnIdentifier,
       String carbonStorePath);
 
@@ -74,7 +74,7 @@ public interface DictionaryService {
    * @param carbonStorePath
    * @return
    */
-  public CarbonDictionaryReader getDictionaryReader(CarbonTableIdentifier carbonTableIdentifier,
+  CarbonDictionaryReader getDictionaryReader(CarbonTableIdentifier carbonTableIdentifier,
       ColumnIdentifier columnIdentifier, String carbonStorePath);
 
   /**
@@ -85,7 +85,7 @@ public interface DictionaryService {
    * @param carbonStorePath
    * @return
    */
-  public CarbonDictionarySortIndexReader getDictionarySortIndexReader(
+  CarbonDictionarySortIndexReader getDictionarySortIndexReader(
       CarbonTableIdentifier carbonTableIdentifier, ColumnIdentifier columnIdentifier,
       String carbonStorePath);
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/unsafe/CarbonUnsafe.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/unsafe/CarbonUnsafe.java b/core/src/main/java/org/apache/carbondata/core/unsafe/CarbonUnsafe.java
index 89ac14a..2e96123 100644
--- a/core/src/main/java/org/apache/carbondata/core/unsafe/CarbonUnsafe.java
+++ b/core/src/main/java/org/apache/carbondata/core/unsafe/CarbonUnsafe.java
@@ -33,7 +33,7 @@ public final class CarbonUnsafe {
     try {
       Field cause = Unsafe.class.getDeclaredField("theUnsafe");
       cause.setAccessible(true);
-      unsafe = (Unsafe) cause.get((Object) null);
+      unsafe = (Unsafe) cause.get(null);
     } catch (Throwable var2) {
       unsafe = null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java b/core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java
index 83763e6..11fa4c1 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/AbstractDataFileFooterConverter.java
@@ -29,14 +29,11 @@ import org.apache.carbondata.core.carbon.datastore.block.BlockInfo;
 import org.apache.carbondata.core.carbon.datastore.block.TableBlockInfo;
 import org.apache.carbondata.core.carbon.metadata.blocklet.DataFileFooter;
 import org.apache.carbondata.core.carbon.metadata.blocklet.SegmentInfo;
-import org.apache.carbondata.core.carbon.metadata.blocklet.compressor.ChunkCompressorMeta;
-import org.apache.carbondata.core.carbon.metadata.blocklet.compressor.CompressionCodec;
 import org.apache.carbondata.core.carbon.metadata.blocklet.datachunk.DataChunk;
 import org.apache.carbondata.core.carbon.metadata.blocklet.datachunk.PresenceMeta;
 import org.apache.carbondata.core.carbon.metadata.blocklet.index.BlockletBTreeIndex;
 import org.apache.carbondata.core.carbon.metadata.blocklet.index.BlockletIndex;
 import org.apache.carbondata.core.carbon.metadata.blocklet.index.BlockletMinMaxIndex;
-import org.apache.carbondata.core.carbon.metadata.blocklet.sort.SortState;
 import org.apache.carbondata.core.carbon.metadata.datatype.DataType;
 import org.apache.carbondata.core.carbon.metadata.encoder.Encoding;
 import org.apache.carbondata.core.carbon.metadata.schema.table.column.ColumnSchema;
@@ -74,7 +71,7 @@ public abstract class AbstractDataFileFooterConverter {
    * @throws IOException problem while reading the index file
    */
   public List<DataFileFooter> getIndexInfo(String filePath, List<TableBlockInfo> tableBlockInfoList)
-      throws IOException, CarbonUtilException {
+      throws IOException {
     CarbonIndexFileReader indexReader = new CarbonIndexFileReader();
     List<DataFileFooter> dataFileFooters = new ArrayList<DataFileFooter>();
     try {
@@ -200,7 +197,6 @@ public abstract class AbstractDataFileFooterConverter {
     wrapperColumnSchema.setColumnGroup(externalColumnSchema.getColumn_group_id());
     wrapperColumnSchema.setScale(externalColumnSchema.getScale());
     wrapperColumnSchema.setDefaultValue(externalColumnSchema.getDefault_value());
-    wrapperColumnSchema.setAggregateFunction(externalColumnSchema.getAggregate_function());
     return wrapperColumnSchema;
   }
 
@@ -231,23 +227,6 @@ public abstract class AbstractDataFileFooterConverter {
   }
 
   /**
-   * Below method will be used to convert the thrift compression to wrapper
-   * compression codec
-   *
-   * @param compressionCodecThrift
-   * @return wrapper compression codec
-   */
-  protected CompressionCodec getCompressionCodec(
-      org.apache.carbondata.format.CompressionCodec compressionCodecThrift) {
-    switch (compressionCodecThrift) {
-      case SNAPPY:
-        return CompressionCodec.SNAPPY;
-      default:
-        return CompressionCodec.SNAPPY;
-    }
-  }
-
-  /**
    * Below method will be used to convert thrift segment object to wrapper
    * segment object
    *
@@ -284,23 +263,6 @@ public abstract class AbstractDataFileFooterConverter {
   }
 
   /**
-   * Below method will be used to convert the thrift compression meta to
-   * wrapper chunk compression meta
-   *
-   * @param chunkCompressionMetaThrift
-   * @return chunkCompressionMetaWrapper
-   */
-  protected ChunkCompressorMeta getChunkCompressionMeta(
-      org.apache.carbondata.format.ChunkCompressionMeta chunkCompressionMetaThrift) {
-    ChunkCompressorMeta compressorMeta = new ChunkCompressorMeta();
-    compressorMeta
-        .setCompressor(getCompressionCodec(chunkCompressionMetaThrift.getCompression_codec()));
-    compressorMeta.setCompressedSize(chunkCompressionMetaThrift.getTotal_compressed_size());
-    compressorMeta.setUncompressedSize(chunkCompressionMetaThrift.getTotal_uncompressed_size());
-    return compressorMeta;
-  }
-
-  /**
    * Below method will be used to convert the thrift data type to wrapper data
    * type
    *
@@ -336,22 +298,6 @@ public abstract class AbstractDataFileFooterConverter {
   }
 
   /**
-   * Below method will be used to convert the thrift object to wrapper object
-   *
-   * @param sortStateThrift
-   * @return wrapper sort state object
-   */
-  protected SortState getSortState(org.apache.carbondata.format.SortState sortStateThrift) {
-    if (sortStateThrift == org.apache.carbondata.format.SortState.SORT_EXPLICIT) {
-      return SortState.SORT_EXPLICT;
-    } else if (sortStateThrift == org.apache.carbondata.format.SortState.SORT_NATIVE) {
-      return SortState.SORT_NATIVE;
-    } else {
-      return SortState.SORT_NONE;
-    }
-  }
-
-  /**
    * Below method will be used to convert the thrift data chunk to wrapper
    * data chunk
    *
@@ -361,7 +307,6 @@ public abstract class AbstractDataFileFooterConverter {
   protected DataChunk getDataChunk(org.apache.carbondata.format.DataChunk datachunkThrift,
       boolean isPresenceMetaPresent) {
     DataChunk dataChunk = new DataChunk();
-    dataChunk.setColumnUniqueIdList(datachunkThrift.getColumn_ids());
     dataChunk.setDataPageLength(datachunkThrift.getData_page_length());
     dataChunk.setDataPageOffset(datachunkThrift.getData_page_offset());
     if (isPresenceMetaPresent) {
@@ -372,13 +317,11 @@ public abstract class AbstractDataFileFooterConverter {
     dataChunk.setRowMajor(datachunkThrift.isRowMajor());
     dataChunk.setRowIdPageLength(datachunkThrift.getRowid_page_length());
     dataChunk.setRowIdPageOffset(datachunkThrift.getRowid_page_offset());
-    dataChunk.setSortState(getSortState(datachunkThrift.getSort_state()));
-    dataChunk.setChunkCompressionMeta(getChunkCompressionMeta(datachunkThrift.getChunk_meta()));
     List<Encoding> encodingList = new ArrayList<Encoding>(datachunkThrift.getEncoders().size());
     for (int i = 0; i < datachunkThrift.getEncoders().size(); i++) {
       encodingList.add(fromExternalToWrapperEncoding(datachunkThrift.getEncoders().get(i)));
     }
-    dataChunk.setEncoderList(encodingList);
+    dataChunk.setEncodingList(encodingList);
     if (encodingList.contains(Encoding.DELTA)) {
       List<ByteBuffer> thriftEncoderMeta = datachunkThrift.getEncoder_meta();
       List<ValueEncoderMeta> encodeMetaList =

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CarbonMergerUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonMergerUtil.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonMergerUtil.java
index 9037e0d..1737a27 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonMergerUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonMergerUtil.java
@@ -19,6 +19,8 @@
 
 package org.apache.carbondata.core.util;
 
+import java.io.IOException;
+
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
@@ -39,7 +41,7 @@ public class CarbonMergerUtil {
     try {
       localCardinality = CarbonUtil.getCardinalityFromLevelMetadataFile(
           path + '/' + CarbonCommonConstants.LEVEL_METADATA_FILE + tableName + ".metadata");
-    } catch (CarbonUtilException e) {
+    } catch (IOException e) {
       LOGGER.error("Error occurred :: " + e.getMessage());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java
index 3415d92..602c8ae 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonMetadataUtil.java
@@ -375,7 +375,7 @@ public class CarbonMetadataUtil {
         keyBlockIndexLens[i] = dataChunk.getRowid_page_length();
         indexMapOffsets[i] = dataChunk.getRle_page_offset();
         indexMapLens[i] = dataChunk.getRle_page_length();
-        sortState[i] = dataChunk.getSort_state().equals(SortState.SORT_EXPLICIT) ? true : false;
+        sortState[i] = dataChunk.getSort_state().equals(SortState.SORT_EXPLICIT);
         i++;
       }
       blockletInfoColumnar.setKeyLengths(keyLengths);

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
index b8077dc..9e6d8b0 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
@@ -383,22 +383,6 @@ public final class CarbonProperties {
   }
 
   /**
-   * Validate the restrictions
-   *
-   * @param actual
-   * @param max
-   * @param min
-   * @param defaultVal
-   * @return
-   */
-  public long validate(long actual, long max, long min, long defaultVal) {
-    if (actual <= max && actual >= min) {
-      return actual;
-    }
-    return defaultVal;
-  }
-
-  /**
    * returns major compaction size value from carbon properties or default value if it is not valid
    *
    * @return

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CarbonTimeStatisticsFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonTimeStatisticsFactory.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonTimeStatisticsFactory.java
index b7316db..ce166fd 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonTimeStatisticsFactory.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonTimeStatisticsFactory.java
@@ -17,7 +17,11 @@
 
 package org.apache.carbondata.core.util;
 
-import org.apache.carbondata.core.carbon.querystatistics.*;
+import org.apache.carbondata.core.carbon.querystatistics.DriverQueryStatisticsRecorderDummy;
+import org.apache.carbondata.core.carbon.querystatistics.DriverQueryStatisticsRecorderImpl;
+import org.apache.carbondata.core.carbon.querystatistics.QueryStatisticsRecorder;
+import org.apache.carbondata.core.carbon.querystatistics.QueryStatisticsRecorderDummy;
+import org.apache.carbondata.core.carbon.querystatistics.QueryStatisticsRecorderImpl;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
 
 public class CarbonTimeStatisticsFactory {
@@ -72,7 +76,7 @@ public class CarbonTimeStatisticsFactory {
     if (queryStatisticsRecorderType.equalsIgnoreCase("true")) {
       return new QueryStatisticsRecorderImpl(queryId);
     } else {
-      return new QueryStatisticsRecorderDummy(queryId);
+      return new QueryStatisticsRecorderDummy();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
index 41af792..27dae6d 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
@@ -26,7 +26,6 @@ import java.io.ByteArrayOutputStream;
 import java.io.Closeable;
 import java.io.DataInputStream;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -40,7 +39,6 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.Callable;
 
 import org.apache.carbondata.common.factory.CarbonCommonFactory;
 import org.apache.carbondata.common.logging.LogService;
@@ -150,18 +148,6 @@ public final class CarbonUtil {
   }
 
   /**
-   * @param eachFile
-   * @return
-   */
-  private static String getFolderName(CarbonFile eachFile) {
-    String str = eachFile.getAbsolutePath();
-    str = str.replace("\\", "/");
-    int firstFolderIndex = str.lastIndexOf("/");
-    String folderName = str.substring(firstFolderIndex);
-    return folderName;
-  }
-
-  /**
    * This method will be used to update the dimension cardinality
    *
    * @param dimCardinality
@@ -242,7 +228,7 @@ public final class CarbonUtil {
 
     for (int i = 0; i < columnGroups.length; i++) {
       columnSplit[i] = columnGroups[i].length;
-      columnarStore[i] = columnGroups[i].length > 1 ? false : true;
+      columnarStore[i] = columnGroups[i].length <= 1;
     }
     ColumnGroupModel colGroupModel = new ColumnGroupModel();
     colGroupModel.setNoOfColumnStore(noOfColumnStore);
@@ -296,32 +282,26 @@ public final class CarbonUtil {
    * @param path file path array
    * @throws Exception exception
    */
-  public static void deleteFoldersAndFiles(final File... path) throws CarbonUtilException {
-    try {
-      UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
+  public static void deleteFoldersAndFiles(final File... path)
+      throws IOException, InterruptedException {
+    UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
 
-        @Override public Void run() throws Exception {
-          for (int i = 0; i < path.length; i++) {
-            deleteRecursive(path[i]);
-          }
-          return null;
+      @Override public Void run() throws Exception {
+        for (int i = 0; i < path.length; i++) {
+          deleteRecursive(path[i]);
         }
-      });
-    } catch (IOException e) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
-    } catch (InterruptedException e) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
-    }
-
+        return null;
+      }
+    });
   }
 
   /**
    * Recursively delete the files
    *
    * @param f File to be deleted
-   * @throws CarbonUtilException
+   * @throws IOException
    */
-  private static void deleteRecursive(File f) throws CarbonUtilException {
+  private static void deleteRecursive(File f) throws IOException {
     if (f.isDirectory()) {
       if (f.listFiles() != null) {
         for (File c : f.listFiles()) {
@@ -330,26 +310,21 @@ public final class CarbonUtil {
       }
     }
     if (f.exists() && !f.delete()) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
+      throw new IOException("Error while deleting the folders and files");
     }
   }
 
-  public static void deleteFoldersAndFiles(final CarbonFile... file) throws CarbonUtilException {
-    try {
-      UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
+  public static void deleteFoldersAndFiles(final CarbonFile... file)
+      throws IOException, InterruptedException {
+    UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
 
-        @Override public Void run() throws Exception {
-          for (int i = 0; i < file.length; i++) {
-            deleteRecursive(file[i]);
-          }
-          return null;
+      @Override public Void run() throws Exception {
+        for (int i = 0; i < file.length; i++) {
+          deleteRecursive(file[i]);
         }
-      });
-    } catch (IOException e) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
-    } catch (InterruptedException e) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
-    }
+        return null;
+      }
+    });
   }
 
   public static String getBadLogPath(String storeLocation) {
@@ -361,31 +336,25 @@ public final class CarbonUtil {
   }
 
   public static void deleteFoldersAndFilesSilent(final CarbonFile... file)
-      throws CarbonUtilException {
-    try {
-      UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
+      throws IOException, InterruptedException {
+    UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction<Void>() {
 
-        @Override public Void run() throws Exception {
-          for (int i = 0; i < file.length; i++) {
-            deleteRecursiveSilent(file[i]);
-          }
-          return null;
+      @Override public Void run() throws Exception {
+        for (int i = 0; i < file.length; i++) {
+          deleteRecursiveSilent(file[i]);
         }
-      });
-    } catch (IOException e) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
-    } catch (InterruptedException e) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
-    }
+        return null;
+      }
+    });
   }
 
   /**
    * Recursively delete the files
    *
    * @param f File to be deleted
-   * @throws CarbonUtilException
+   * @throws IOException
    */
-  private static void deleteRecursive(CarbonFile f) throws CarbonUtilException {
+  private static void deleteRecursive(CarbonFile f) throws IOException {
     if (f.isDirectory()) {
       if (f.listFiles() != null) {
         for (CarbonFile c : f.listFiles()) {
@@ -394,11 +363,11 @@ public final class CarbonUtil {
       }
     }
     if (f.exists() && !f.delete()) {
-      throw new CarbonUtilException("Error while deleting the folders and files");
+      throw new IOException("Error while deleting the folders and files");
     }
   }
 
-  private static void deleteRecursiveSilent(CarbonFile f) throws CarbonUtilException {
+  private static void deleteRecursiveSilent(CarbonFile f) {
     if (f.isDirectory()) {
       if (f.listFiles() != null) {
         for (CarbonFile c : f.listFiles()) {
@@ -411,10 +380,10 @@ public final class CarbonUtil {
     }
   }
 
-  public static void deleteFiles(File[] intermediateFiles) throws CarbonUtilException {
+  public static void deleteFiles(File[] intermediateFiles) throws IOException {
     for (int i = 0; i < intermediateFiles.length; i++) {
       if (!intermediateFiles[i].delete()) {
-        throw new CarbonUtilException("Problem while deleting intermediate file");
+        throw new IOException("Problem while deleting intermediate file");
       }
     }
   }
@@ -530,10 +499,10 @@ public final class CarbonUtil {
    *
    * @param levelPath
    * @return
-   * @throws CarbonUtilException
+   * @throws IOException
    */
   public static int[] getCardinalityFromLevelMetadataFile(String levelPath)
-      throws CarbonUtilException {
+      throws IOException {
     DataInputStream dataInputStream = null;
     int[] cardinality = null;
 
@@ -548,10 +517,6 @@ public final class CarbonUtil {
           cardinality[i] = dataInputStream.readInt();
         }
       }
-    } catch (FileNotFoundException e) {
-      throw new CarbonUtilException("Problem while getting the file", e);
-    } catch (IOException e) {
-      throw new CarbonUtilException("Problem while reading the file", e);
     } finally {
       closeStreams(dataInputStream);
     }
@@ -775,7 +740,6 @@ public final class CarbonUtil {
    * Below method will be used to get the value compression model of the
    * measure data chunk
    *
-   * @param measureDataChunkList
    * @return value compression model
    */
   public static WriterCompressModel getValueCompressionModel(
@@ -880,15 +844,11 @@ public final class CarbonUtil {
    * Below method will be used to read the data file matadata
    */
   public static DataFileFooter readMetadatFile(TableBlockInfo tableBlockInfo)
-      throws CarbonUtilException {
+      throws IOException {
     AbstractDataFileFooterConverter fileFooterConverter =
         DataFileFooterConverterFactory.getInstance()
             .getDataFileFooterConverter(tableBlockInfo.getVersion());
-    try {
-      return fileFooterConverter.readDataFileFooter(tableBlockInfo);
-    } catch (IOException e) {
-      throw new CarbonUtilException("Problem while reading the file metadata", e);
-    }
+    return fileFooterConverter.readDataFileFooter(tableBlockInfo);
   }
 
   /**
@@ -898,7 +858,8 @@ public final class CarbonUtil {
    * @param blockLength
    * @return
    */
-  public static long calculateMetaSize(String filePath, long blockOffset, long blockLength) {
+  public static long calculateMetaSize(String filePath, long blockOffset, long blockLength)
+      throws IOException {
     FileHolder fileReader = null;
     try {
       long completeBlockLength = blockOffset + blockLength;
@@ -910,7 +871,11 @@ public final class CarbonUtil {
     }
     finally {
       if(null != fileReader) {
-        fileReader.finish();
+        try {
+          fileReader.finish();
+        } catch (IOException e) {
+          // ignore the exception as nothing we can do about it
+        }
       }
     }
   }
@@ -973,23 +938,6 @@ public final class CarbonUtil {
       }
     }
   }
-  /**
-   * Thread to delete the tables
-   *
-   */
-  private static final class DeleteFolderAndFiles implements Callable<Void> {
-    private CarbonFile file;
-
-    private DeleteFolderAndFiles(CarbonFile file) {
-      this.file = file;
-    }
-
-    @Override public Void call() throws Exception {
-      deleteFoldersAndFiles(file);
-      return null;
-    }
-
-  }
 
   /**
    * Below method will be used to get the dimension
@@ -1159,11 +1107,11 @@ public final class CarbonUtil {
    * @param tableBlockInfoList      list of table block
    * @param absoluteTableIdentifier absolute table identifier
    * @return list of block info
-   * @throws CarbonUtilException if any problem while reading
+   * @throws IOException if any problem while reading
    */
   public static List<DataFileFooter> readCarbonIndexFile(String taskId, String bucketNumber,
       List<TableBlockInfo> tableBlockInfoList, AbsoluteTableIdentifier absoluteTableIdentifier)
-      throws CarbonUtilException {
+      throws IOException {
     // need to sort the  block info list based for task in ascending  order so
     // it will be sinkup with block index read from file
     Collections.sort(tableBlockInfoList);
@@ -1176,12 +1124,8 @@ public final class CarbonUtil {
         .getCarbonIndexFilePath(taskId, "0", tableBlockInfoList.get(0).getSegmentId(),
             bucketNumber);
     DataFileFooterConverter fileFooterConverter = new DataFileFooterConverter();
-    try {
-      // read the index info and return
-      return fileFooterConverter.getIndexInfo(carbonIndexFilePath, tableBlockInfoList);
-    } catch (IOException e) {
-      throw new CarbonUtilException("Problem while reading the file metadata", e);
-    }
+    // read the index info and return
+    return fileFooterConverter.getIndexInfo(carbonIndexFilePath, tableBlockInfoList);
   }
 
   /**
@@ -1208,7 +1152,7 @@ public final class CarbonUtil {
    * @param csvFilePath
    * @return
    */
-  public static String readHeader(String csvFilePath) {
+  public static String readHeader(String csvFilePath) throws IOException {
 
     DataInputStream fileReader = null;
     BufferedReader bufferedReader = null;
@@ -1220,11 +1164,6 @@ public final class CarbonUtil {
       bufferedReader = new BufferedReader(new InputStreamReader(fileReader,
               Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)));
       readLine = bufferedReader.readLine();
-
-    } catch (FileNotFoundException e) {
-      LOGGER.error(e, "CSV Input File not found  " + e.getMessage());
-    } catch (IOException e) {
-      LOGGER.error(e, "Not able to read CSV input File  " + e.getMessage());
     } finally {
       CarbonUtil.closeStreams(fileReader, bufferedReader);
     }
@@ -1292,17 +1231,12 @@ public final class CarbonUtil {
    * @param dataChunkBytes datachunk thrift object in bytes
    * @return data chunk thrift object
    */
-  public static DataChunk2 readDataChunk(byte[] dataChunkBytes) {
-    try {
-      return (DataChunk2) read(dataChunkBytes, new ThriftReader.TBaseCreator() {
+  public static DataChunk2 readDataChunk(byte[] dataChunkBytes) throws IOException {
+    return (DataChunk2) read(dataChunkBytes, new ThriftReader.TBaseCreator() {
         @Override public TBase create() {
           return new DataChunk2();
         }
       });
-    } catch (IOException e) {
-      LOGGER.error(e);
-    }
-    return null;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtilException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtilException.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtilException.java
deleted file mode 100644
index bdeed7f..0000000
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtilException.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.util.Locale;
-
-public class CarbonUtilException extends Exception {
-
-  /**
-   * default serial version ID.
-   */
-  private static final long serialVersionUID = 1L;
-
-  /**
-   * The Error message.
-   */
-  private String msg = "";
-
-  /**
-   * Constructor
-   *
-   * @param msg The error message for this exception.
-   */
-  public CarbonUtilException(String msg) {
-    super(msg);
-    this.msg = msg;
-  }
-
-  /**
-   * Constructor
-   *
-   * @param msg The error message for this exception.
-   */
-  public CarbonUtilException(String msg, Throwable t) {
-    super(msg, t);
-    this.msg = msg;
-  }
-
-  /**
-   * This method is used to get the localized message.
-   *
-   * @param locale - A Locale object represents a specific geographical,
-   *               political, or cultural region.
-   * @return - Localized error message.
-   */
-  public String getLocalizedMessage(Locale locale) {
-    return "";
-  }
-
-  /**
-   * getLocalizedMessage
-   */
-  @Override public String getLocalizedMessage() {
-    return super.getLocalizedMessage();
-  }
-
-  /**
-   * getMessage
-   */
-  public String getMessage() {
-    return this.msg;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/CompressionFinder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CompressionFinder.java b/core/src/main/java/org/apache/carbondata/core/util/CompressionFinder.java
index a65dafb..64c0c53 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CompressionFinder.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CompressionFinder.java
@@ -114,7 +114,7 @@ public class CompressionFinder implements Comparable<CompressionFinder> {
     DIFFNONDECIMAL(3);
     private int priority;
 
-    private PRIORITY(int priority) {
+    PRIORITY(int priority) {
       this.priority = priority;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java b/core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java
index 775238d..c9ed234 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/DataTypeUtil.java
@@ -152,7 +152,7 @@ public final class DataTypeUtil {
   public static byte[] bigDecimalToByte(BigDecimal num) {
     BigInteger sig = new BigInteger(num.unscaledValue().toString());
     int scale = num.scale();
-    byte[] bscale = new byte[] { (byte) (scale) };
+    byte[] bscale = { (byte) (scale) };
     byte[] buff = sig.toByteArray();
     byte[] completeArr = new byte[buff.length + bscale.length];
     System.arraycopy(bscale, 0, completeArr, 0, bscale.length);

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java b/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
index 98094c5..1b82d70 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/ValueCompressionUtil.java
@@ -186,7 +186,7 @@ public final class ValueCompressionUtil {
           getDataType(Math.pow(10, mantissa) * ((double) maxValue - (double) minValue), 0,
               dataTypeSelected);
 
-      CompressionFinder[] finders = new CompressionFinder[] {
+      CompressionFinder[] finders = {
           new CompressionFinder(COMPRESSION_TYPE.ADAPTIVE, adaptiveDataType, adaptiveDataType,
               CompressionFinder.PRIORITY.ACTUAL, measureStoreType),
           new CompressionFinder(COMPRESSION_TYPE.DELTA_DOUBLE, adaptiveDataType, deltaDataType,
@@ -462,7 +462,7 @@ public final class ValueCompressionUtil {
         double[] defaultResult = new double[value.length];
 
         for (double a : value) {
-          defaultResult[i] = (double) (maxValue - a);
+          defaultResult[i] = maxValue - a;
           i++;
         }
         return defaultResult;
@@ -508,7 +508,7 @@ public final class ValueCompressionUtil {
         long[] longResult = new long[value.length];
 
         for (double a : value) {
-          longResult[i] = (long) (Math.round(Math.pow(10, mantissa) * a));
+          longResult[i] = Math.round(Math.pow(10, mantissa) * a);
           i++;
         }
         return longResult;
@@ -587,7 +587,7 @@ public final class ValueCompressionUtil {
         for (double a : value) {
           BigDecimal val = BigDecimal.valueOf(a);
           double diff = max.subtract(val).doubleValue();
-          longResult[i] = (long) (Math.round(diff * Math.pow(10, mantissa)));
+          longResult[i] = Math.round(diff * Math.pow(10, mantissa));
           i++;
         }
         return longResult;
@@ -899,7 +899,7 @@ public final class ValueCompressionUtil {
     DATA_LONG(),
     DATA_BIGINT(),
     DATA_DOUBLE();
-    private DataType() {
+    DataType() {
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/writer/CarbonFooterWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/writer/CarbonFooterWriter.java b/core/src/main/java/org/apache/carbondata/core/writer/CarbonFooterWriter.java
index 758c2d9..5a8b98d 100644
--- a/core/src/main/java/org/apache/carbondata/core/writer/CarbonFooterWriter.java
+++ b/core/src/main/java/org/apache/carbondata/core/writer/CarbonFooterWriter.java
@@ -48,8 +48,6 @@ public class CarbonFooterWriter {
     try {
       thriftWriter.write(footer);
       thriftWriter.writeOffset(currentPosition);
-    } catch (Exception e) {
-      throw e;
     } finally {
       thriftWriter.close();
     }

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileWriter.java b/core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileWriter.java
index bf6fc3b..01577c9 100644
--- a/core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileWriter.java
+++ b/core/src/main/java/org/apache/carbondata/core/writer/CarbonIndexFileWriter.java
@@ -35,7 +35,6 @@ public class CarbonIndexFileWriter {
   /**
    * It writes thrift object to file
    *
-   * @param footer
    * @throws IOException
    */
   public void writeThrift(TBase indexObject) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/writer/HierarchyValueWriterForCSV.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/writer/HierarchyValueWriterForCSV.java b/core/src/main/java/org/apache/carbondata/core/writer/HierarchyValueWriterForCSV.java
index 61a89f9..f112f61 100644
--- a/core/src/main/java/org/apache/carbondata/core/writer/HierarchyValueWriterForCSV.java
+++ b/core/src/main/java/org/apache/carbondata/core/writer/HierarchyValueWriterForCSV.java
@@ -104,7 +104,7 @@ public class HierarchyValueWriterForCSV {
   /**
    * @return Returns the byteArrayList.
    */
-  public List<ByteArrayHolder> getByteArrayList() throws KettleException {
+  public List<ByteArrayHolder> getByteArrayList() {
     return byteArrayholder;
   }
 
@@ -287,7 +287,7 @@ public class HierarchyValueWriterForCSV {
     byteArrayholder.clear();
   }
 
-  private void closeStreamAndDeleteFile(File f, Closeable... streams) throws KettleException {
+  private void closeStreamAndDeleteFile(File f, Closeable... streams) {
     boolean isDeleted = false;
     for (Closeable stream : streams) {
       if (null != stream) {

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/eaadc88a/core/src/main/java/org/apache/carbondata/core/writer/sortindex/CarbonDictionarySortIndexWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/writer/sortindex/CarbonDictionarySortIndexWriter.java b/core/src/main/java/org/apache/carbondata/core/writer/sortindex/CarbonDictionarySortIndexWriter.java
index e9d7b1d..a5e8891 100644
--- a/core/src/main/java/org/apache/carbondata/core/writer/sortindex/CarbonDictionarySortIndexWriter.java
+++ b/core/src/main/java/org/apache/carbondata/core/writer/sortindex/CarbonDictionarySortIndexWriter.java
@@ -19,7 +19,6 @@
 package org.apache.carbondata.core.writer.sortindex;
 
 import java.io.Closeable;
-import java.io.IOException;
 import java.util.List;
 
 /**
@@ -32,17 +31,15 @@ public interface CarbonDictionarySortIndexWriter extends Closeable {
    * sortedIndex file in thrif format.
    *
    * @param sortIndexList list of sortIndex
-   * @throws IOException In Case of any I/O errors occurs.
    */
-  public void writeSortIndex(List<Integer> sortIndexList) throws IOException;
+  void writeSortIndex(List<Integer> sortIndexList);
 
   /**
    * The method is used write the dictionary sortIndexInverted data to columns
    * sortedIndex file in thrif format.
    *
    * @param invertedSortIndexList list of  sortIndexInverted
-   * @throws IOException In Case of any I/O errors occurs.
    */
-  public void writeInvertedSortIndex(List<Integer> invertedSortIndexList) throws IOException;
+  void writeInvertedSortIndex(List<Integer> invertedSortIndexList);
 
 }



Mime
View raw message