crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkw...@apache.org
Subject [1/2] CRUNCH-476: Consolidated use of logging in projects to us SLF4J, dependency cleanup, and a few javadoc fixes.
Date Tue, 28 Oct 2014 01:09:15 GMT
Repository: crunch
Updated Branches:
  refs/heads/master 0157d03bf -> 82cecc0ce


http://git-wip-us.apache.org/repos/asf/crunch/blob/82cecc0c/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
----------------------------------------------------------------------
diff --git a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
index 95ccd2c..3367d3c 100644
--- a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
+++ b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkPipeline.java
@@ -19,8 +19,6 @@ package org.apache.crunch.impl.spark;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.crunch.CachingOptions;
 import org.apache.crunch.PCollection;
 import org.apache.crunch.PTable;
@@ -39,12 +37,14 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.spark.SparkConf;
 import org.apache.spark.api.java.JavaSparkContext;
 import org.apache.spark.storage.StorageLevel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.Map;
 
 public class SparkPipeline extends DistributedPipeline {
 
-  private static final Log LOG = LogFactory.getLog(SparkPipeline.class);
+  private static final Logger LOG = LoggerFactory.getLogger(SparkPipeline.class);
 
   private final String sparkConnect;
   private JavaSparkContext sparkContext;

http://git-wip-us.apache.org/repos/asf/crunch/blob/82cecc0c/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkRuntime.java
----------------------------------------------------------------------
diff --git a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkRuntime.java b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkRuntime.java
index 687274a..5d0f953 100644
--- a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkRuntime.java
+++ b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/SparkRuntime.java
@@ -24,8 +24,6 @@ import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.AbstractFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.crunch.CombineFn;
 import org.apache.crunch.PCollection;
 import org.apache.crunch.PipelineCallable;
@@ -59,6 +57,8 @@ import org.apache.spark.api.java.JavaRDD;
 import org.apache.spark.api.java.JavaRDDLike;
 import org.apache.spark.api.java.JavaSparkContext;
 import org.apache.spark.storage.StorageLevel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.net.URI;
@@ -76,7 +76,7 @@ import java.util.concurrent.atomic.AtomicReference;
 
 public class SparkRuntime extends AbstractFuture<PipelineResult> implements PipelineExecution
{
 
-  private static final Log LOG = LogFactory.getLog(SparkRuntime.class);
+  private static final Logger LOG = LoggerFactory.getLogger(SparkRuntime.class);
 
   private SparkPipeline pipeline;
   private JavaSparkContext sparkContext;
@@ -256,9 +256,9 @@ public class SparkRuntime extends AbstractFuture<PipelineResult>
implements Pipe
     }
 
     if (!failedCallables.isEmpty()) {
-      LOG.error(failedCallables.size() + " callable failure(s) occurred:");
+      LOG.error("{} callable failure(s) occurred:", failedCallables.size());
       for (PipelineCallable<?> c : failedCallables) {
-        LOG.error(c.getName() + ": " + c.getMessage());
+        LOG.error("{} : {}", c.getName(), c.getMessage());
       }
       status.set(Status.FAILED);
       set(PipelineResult.EMPTY);

http://git-wip-us.apache.org/repos/asf/crunch/blob/82cecc0c/crunch-spark/src/main/java/org/apache/crunch/impl/spark/collect/PGroupedTableImpl.java
----------------------------------------------------------------------
diff --git a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/collect/PGroupedTableImpl.java
b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/collect/PGroupedTableImpl.java
index 5e6594e..b529bc0 100644
--- a/crunch-spark/src/main/java/org/apache/crunch/impl/spark/collect/PGroupedTableImpl.java
+++ b/crunch-spark/src/main/java/org/apache/crunch/impl/spark/collect/PGroupedTableImpl.java
@@ -17,8 +17,6 @@
  */
 package org.apache.crunch.impl.spark.collect;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.crunch.CombineFn;
 import org.apache.crunch.GroupingOptions;
 import org.apache.crunch.impl.dist.collect.BaseGroupedTable;
@@ -48,13 +46,15 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.spark.api.java.JavaPairRDD;
 import org.apache.spark.api.java.JavaRDDLike;
 import org.apache.spark.storage.StorageLevel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.util.List;
 import java.util.Map;
 
 public class PGroupedTableImpl<K, V> extends BaseGroupedTable<K, V> implements
SparkCollection {
 
-  private static final Log LOG = LogFactory.getLog(PGroupedTableImpl.class);
+  private static final Logger LOG = LoggerFactory.getLogger(PGroupedTableImpl.class);
 
   private JavaRDDLike<?, ?> rdd;
 

http://git-wip-us.apache.org/repos/asf/crunch/blob/82cecc0c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 43baf09..569c2e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,7 +72,6 @@ under the License.
     <commons-lang.version>2.4</commons-lang.version>
     <commons-codec.version>1.4</commons-codec.version>
     <commons-httpclient.version>3.0.1</commons-httpclient.version>
-    <commons-logging.version>1.1.1</commons-logging.version>
     <commons-cli.version>1.2</commons-cli.version>
     <avro.version>1.7.7</avro.version>
     <hive.version>0.13.1</hive.version>
@@ -381,12 +380,6 @@ under the License.
       </dependency>
 
       <dependency>
-        <groupId>commons-logging</groupId>
-        <artifactId>commons-logging</artifactId>
-        <version>${commons-logging.version}</version>
-      </dependency>
-
-      <dependency>
         <groupId>commons-cli</groupId>
         <artifactId>commons-cli</artifactId>
         <version>${commons-cli.version}</version>


Mime
View raw message