hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [3/6] hive git commit: HIVE-13906. Remove guava from compile time dependence in the storage-api module. (omalley reviewed by Sergey Shelukhin)
Date Wed, 26 Apr 2017 22:07:35 GMT
HIVE-13906. Remove guava from compile time dependence in the storage-api
module. (omalley reviewed by Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a6857753
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a6857753
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a6857753

Branch: refs/heads/storage-branch-2.3
Commit: a6857753b656f9d8291ebb8b5691ec768cdc9a49
Parents: ae52887
Author: Owen O'Malley <omalley@apache.org>
Authored: Wed Jun 1 10:58:34 2016 -0700
Committer: Owen O'Malley <omalley@apache.org>
Committed: Wed Apr 26 15:03:05 2017 -0700

----------------------------------------------------------------------
 storage-api/pom.xml                              | 19 ++++++++++++++++---
 .../apache/hadoop/hive/common/DiskRangeInfo.java |  5 ++---
 .../hadoop/hive/ql/util/JavaDataModel.java       |  4 +---
 .../org/apache/hive/common/util/BloomFilter.java |  8 ++++++--
 4 files changed, 25 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/a6857753/storage-api/pom.xml
----------------------------------------------------------------------
diff --git a/storage-api/pom.xml b/storage-api/pom.xml
index 036a994..097efdb 100644
--- a/storage-api/pom.xml
+++ b/storage-api/pom.xml
@@ -38,7 +38,7 @@
   </properties>
 
   <dependencies>
-    <!-- compile inter-project -->
+    <!-- inter-project -->
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
@@ -48,7 +48,7 @@
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-common</artifactId>
       <version>${hadoop.version}</version>
-      <optional>true</optional>
+      <scope>provided</scope>
       <exclusions>
         <exclusion>
           <groupId>com.google.guava</groupId>
@@ -95,7 +95,20 @@
           <artifactId>jetty-util</artifactId>
         </exclusion>
       </exclusions>
-   </dependency>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j.version}</version>
+    </dependency>
+
+    <!-- test inter-project -->
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>

http://git-wip-us.apache.org/repos/asf/hive/blob/a6857753/storage-api/src/java/org/apache/hadoop/hive/common/DiskRangeInfo.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/common/DiskRangeInfo.java b/storage-api/src/java/org/apache/hadoop/hive/common/DiskRangeInfo.java
index 86b838c..e5025bf 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/common/DiskRangeInfo.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/common/DiskRangeInfo.java
@@ -17,12 +17,11 @@
  */
 package org.apache.hadoop.hive.common;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hadoop.hive.common.io.DiskRange;
 
-import com.google.common.collect.Lists;
-
 /**
  * Disk range information class containing disk ranges and total length.
  */
@@ -31,7 +30,7 @@ public class DiskRangeInfo {
   long totalLength;
 
   public DiskRangeInfo(int indexBaseOffset) {
-    this.diskRanges = Lists.newArrayList();
+    this.diskRanges = new ArrayList<>();
     // Some data is missing from the stream for PPD uncompressed read (because index offset
is
     // relative to the entire stream and we only read part of stream if RGs are filtered;
unlike
     // with compressed data where PPD only filters CBs, so we always get full CB, and index
offset

http://git-wip-us.apache.org/repos/asf/hive/blob/a6857753/storage-api/src/java/org/apache/hadoop/hive/ql/util/JavaDataModel.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/util/JavaDataModel.java b/storage-api/src/java/org/apache/hadoop/hive/ql/util/JavaDataModel.java
index 33b70c2..4a745e4 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/util/JavaDataModel.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/util/JavaDataModel.java
@@ -18,8 +18,6 @@
 
 package org.apache.hadoop.hive.ql.util;
 
-import com.google.common.annotations.VisibleForTesting;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -257,7 +255,7 @@ public enum JavaDataModel {
     private static final JavaDataModel MODEL_FOR_SYSTEM = getModelForSystem();
   }
 
-  @VisibleForTesting
+  //@VisibleForTesting
   static JavaDataModel getModelForSystem() {
     String props = null;
     try {

http://git-wip-us.apache.org/repos/asf/hive/blob/a6857753/storage-api/src/java/org/apache/hive/common/util/BloomFilter.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hive/common/util/BloomFilter.java b/storage-api/src/java/org/apache/hive/common/util/BloomFilter.java
index 74bf4f5..e9f419d 100644
--- a/storage-api/src/java/org/apache/hive/common/util/BloomFilter.java
+++ b/storage-api/src/java/org/apache/hive/common/util/BloomFilter.java
@@ -23,8 +23,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-import static com.google.common.base.Preconditions.checkArgument;
-
 /**
  * BloomFilter is a probabilistic data structure for set membership check. BloomFilters are
  * highly space efficient when compared to using a HashSet. Because of the probabilistic
nature of
@@ -56,6 +54,12 @@ public class BloomFilter {
     this(expectedEntries, DEFAULT_FPP);
   }
 
+  static void checkArgument(boolean expression, String message) {
+    if (!expression) {
+      throw new IllegalArgumentException(message);
+    }
+  }
+
   public BloomFilter(long expectedEntries, double fpp) {
     checkArgument(expectedEntries > 0, "expectedEntries should be > 0");
     checkArgument(fpp > 0.0 && fpp < 1.0, "False positive probability should
be > 0.0 & < 1.0");


Mime
View raw message