You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by om...@apache.org on 2016/07/19 23:57:55 UTC

hive git commit: HIVE-13906. Remove guava from compile time dependence in the storage-api module. (omalley reviewed by Sergey Shelukhin)

Repository: hive
Updated Branches:
  refs/heads/master e3d784908 -> 0a4411d48


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/0a4411d4
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0a4411d4
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0a4411d4

Branch: refs/heads/master
Commit: 0a4411d48b99a955aaadc333a44ec13fe5532b05
Parents: e3d7849
Author: Owen O'Malley <om...@apache.org>
Authored: Wed Jun 1 10:58:34 2016 -0700
Committer: Owen O'Malley <om...@apache.org>
Committed: Tue Jul 19 16:57:06 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hive/blob/0a4411d4/storage-api/pom.xml
----------------------------------------------------------------------
diff --git a/storage-api/pom.xml b/storage-api/pom.xml
index 4095ed2..4767be6 100644
--- a/storage-api/pom.xml
+++ b/storage-api/pom.xml
@@ -32,14 +32,23 @@
   </properties>
 
   <dependencies>
-    <!-- test inter-project -->
+    <!-- inter-project -->
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>${commons-lang.version}</version>
+    </dependency>
     <dependency>
       <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>
+          <artifactId>guava</artifactId>
+        </exclusion>
+        <exclusion>
           <groupId>commmons-logging</groupId>
           <artifactId>commons-logging</artifactId>
         </exclusion>
@@ -52,7 +61,20 @@
           <artifactId>slf4j-log4j12</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/0a4411d4/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/0a4411d4/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/0a4411d4/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 bb0b8f2..e60690d 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
@@ -21,8 +21,6 @@ package org.apache.hive.common.util;
 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
@@ -54,6 +52,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");