parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jul...@apache.org
Subject [1/4] parquet-mr git commit: PARQUET-423: Replace old Log class with SLF4J Logging
Date Wed, 26 Oct 2016 16:09:55 GMT
Repository: parquet-mr
Updated Branches:
  refs/heads/master aa416b5e2 -> df9d8e415


http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/df9d8e41/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestParquetToThriftReadWriteAndProjection.java
----------------------------------------------------------------------
diff --git a/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestParquetToThriftReadWriteAndProjection.java
b/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestParquetToThriftReadWriteAndProjection.java
index 4869460..eaef499 100644
--- a/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestParquetToThriftReadWriteAndProjection.java
+++ b/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestParquetToThriftReadWriteAndProjection.java
@@ -38,10 +38,11 @@ import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.transport.TIOStreamTransport;
 import org.junit.Test;
-import org.apache.parquet.Log;
 import org.apache.parquet.hadoop.api.ReadSupport;
 import org.apache.parquet.hadoop.util.ContextUtil;
 import org.apache.parquet.thrift.test.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.ByteArrayOutputStream;
 import java.util.*;
@@ -50,7 +51,7 @@ import static org.junit.Assert.assertEquals;
 
 public class TestParquetToThriftReadWriteAndProjection {
 
-  private static final Log LOG = Log.getLog(TestParquetToThriftReadWriteAndProjection.class);
+  private static final Logger LOG = LoggerFactory.getLogger(TestParquetToThriftReadWriteAndProjection.class);
 
   @Test
   public void testThriftOptionalFieldsWithReadProjectionUsingParquetSchema() throws Exception
{
@@ -374,7 +375,7 @@ public class TestParquetToThriftReadWriteAndProjection {
       reader.initialize(split, taskAttemptContext);
       if (reader.nextKeyValue()) {
         readValue = reader.getCurrentValue();
-        LOG.info(readValue);
+        LOG.info("{}", readValue);
       }
     }
     assertEquals(exptectedReadResult, readValue);

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/df9d8e41/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestThriftToParquetFileWriter.java
----------------------------------------------------------------------
diff --git a/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestThriftToParquetFileWriter.java
b/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestThriftToParquetFileWriter.java
index 2407e61..0439686 100644
--- a/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestThriftToParquetFileWriter.java
+++ b/parquet-thrift/src/test/java/org/apache/parquet/hadoop/thrift/TestThriftToParquetFileWriter.java
@@ -50,7 +50,6 @@ import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.transport.TIOStreamTransport;
 import org.junit.Test;
 
-import org.apache.parquet.Log;
 import org.apache.parquet.example.data.Group;
 import org.apache.parquet.hadoop.ParquetFileReader;
 import org.apache.parquet.hadoop.ParquetReader;
@@ -65,10 +64,11 @@ import com.twitter.elephantbird.thrift.test.TestListInMap;
 import com.twitter.elephantbird.thrift.test.TestMapInList;
 
 import org.apache.parquet.schema.MessageType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class TestThriftToParquetFileWriter {
-  private static final Log LOG = Log
-      .getLog(TestThriftToParquetFileWriter.class);
+  private static final Logger LOG = LoggerFactory.getLogger(TestThriftToParquetFileWriter.class);
 
   @Test
   public void testWriteFile() throws IOException, InterruptedException, TException {
@@ -270,7 +270,7 @@ public class TestThriftToParquetFileWriter {
 
   private <T extends TBase<?,?>> Path createFile(T... tObjs) throws IOException,
InterruptedException, TException  {
     final Path fileToCreate = new Path("target/test/TestThriftToParquetFileWriter/"+tObjs[0].getClass()+".parquet");
-    LOG.info("File created: " + fileToCreate.toString());
+    LOG.info("File created: {}", fileToCreate.toString());
     Configuration conf = new Configuration();
     final FileSystem fs = fileToCreate.getFileSystem(conf);
     if (fs.exists(fileToCreate)) {

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/df9d8e41/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java
----------------------------------------------------------------------
diff --git a/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java
b/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java
index 97e0054..b713058 100644
--- a/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java
+++ b/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetReadProtocol.java
@@ -32,13 +32,14 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.parquet.column.ParquetProperties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import thrift.test.OneOfEach;
 
 import org.apache.thrift.TBase;
 import org.apache.thrift.TException;
 import org.junit.Test;
 
-import org.apache.parquet.Log;
 import org.apache.parquet.column.impl.ColumnWriteStoreV1;
 import org.apache.parquet.column.page.mem.MemPageStore;
 import org.apache.parquet.io.ColumnIOFactory;
@@ -61,7 +62,7 @@ import com.twitter.elephantbird.thrift.test.TestPhoneType;
 import com.twitter.elephantbird.thrift.test.TestStructInMap;
 
 public class TestParquetReadProtocol {
-  private static final Log LOG = Log.getLog(TestParquetReadProtocol.class);
+  private static final Logger LOG = LoggerFactory.getLogger(TestParquetReadProtocol.class);
 
   @Test
   public void testList() throws TException {
@@ -146,7 +147,7 @@ public class TestParquetReadProtocol {
     final MemPageStore memPageStore = new MemPageStore(1);
     final ThriftSchemaConverter schemaConverter = new ThriftSchemaConverter();
     final MessageType schema = schemaConverter.convert(thriftClass);
-    LOG.info(schema);
+    LOG.info("{}", schema);
     final MessageColumnIO columnIO = new ColumnIOFactory(true).getColumnIO(schema);
     final ColumnWriteStoreV1 columns = new ColumnWriteStoreV1(memPageStore,
         ParquetProperties.builder()

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/df9d8e41/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
----------------------------------------------------------------------
diff --git a/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
b/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
index 320d3a3..df60766 100644
--- a/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
+++ b/parquet-thrift/src/test/java/org/apache/parquet/thrift/TestParquetWriteProtocol.java
@@ -31,6 +31,8 @@ import java.util.Set;
 import java.util.TreeMap;
 
 import org.junit.ComparisonFailure;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import thrift.test.OneOfEach;
 
 import org.apache.pig.data.Tuple;
@@ -39,7 +41,6 @@ import org.apache.thrift.TBase;
 import org.apache.thrift.TException;
 import org.junit.Test;
 
-import org.apache.parquet.Log;
 import org.apache.parquet.io.ColumnIOFactory;
 import org.apache.parquet.io.ExpectationValidatingRecordConsumer;
 import org.apache.parquet.io.MessageColumnIO;
@@ -67,7 +68,7 @@ import com.twitter.elephantbird.thrift.test.TestStructInMap;
 
 
 public class TestParquetWriteProtocol {
-  private static final Log LOG = Log.getLog(TestParquetWriteProtocol.class);
+  private static final Logger LOG = LoggerFactory.getLogger(TestParquetWriteProtocol.class);
   @Test
   public void testMap() throws Exception {
     String[] expectations = {
@@ -523,7 +524,7 @@ public class TestParquetWriteProtocol {
 //      System.out.println(a);
     final Class<TBase<?,?>> class1 = (Class<TBase<?,?>>)a.getClass();
     final MessageType schema = thriftSchemaConverter.convert(class1);
-    LOG.info(schema);
+    LOG.info("{}", schema);
     final StructType structType = thriftSchemaConverter.toStructType(class1);
     ExpectationValidatingRecordConsumer recordConsumer = new ExpectationValidatingRecordConsumer(new
ArrayDeque<String>(Arrays.asList(expectations)));
     final MessageColumnIO columnIO = new ColumnIOFactory().getColumnIO(schema);
@@ -535,14 +536,14 @@ public class TestParquetWriteProtocol {
     ThriftToPig<TBase<?,?>> thriftToPig = new ThriftToPig(a.getClass());
     ExpectationValidatingRecordConsumer recordConsumer = new ExpectationValidatingRecordConsumer(new
ArrayDeque<String>(Arrays.asList(expectations)));
     Schema pigSchema = thriftToPig.toSchema();
-    LOG.info(pigSchema);
+    LOG.info("{}", pigSchema);
     MessageType schema = new PigSchemaConverter().convert(pigSchema);
-    LOG.info(schema);
+    LOG.info("{}", schema);
     TupleWriteSupport tupleWriteSupport = new TupleWriteSupport(pigSchema);
     tupleWriteSupport.init(null);
     tupleWriteSupport.prepareForWrite(recordConsumer);
     final Tuple pigTuple = thriftToPig.getPigTuple(a);
-    LOG.info(pigTuple);
+    LOG.info("{}", pigTuple);
     tupleWriteSupport.write(pigTuple);
     return schema;
   }

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/df9d8e41/parquet-tools/src/main/java/org/apache/parquet/tools/command/MergeCommand.java
----------------------------------------------------------------------
diff --git a/parquet-tools/src/main/java/org/apache/parquet/tools/command/MergeCommand.java
b/parquet-tools/src/main/java/org/apache/parquet/tools/command/MergeCommand.java
index e6d9747..73e9b44 100644
--- a/parquet-tools/src/main/java/org/apache/parquet/tools/command/MergeCommand.java
+++ b/parquet-tools/src/main/java/org/apache/parquet/tools/command/MergeCommand.java
@@ -24,10 +24,8 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.parquet.hadoop.util.HiddenFileFilter;
-import org.slf4j.Logger;
 import org.apache.parquet.hadoop.ParquetFileWriter;
 import org.apache.parquet.hadoop.metadata.FileMetaData;
-import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/df9d8e41/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 463d40c..d50c132 100644
--- a/pom.xml
+++ b/pom.xml
@@ -168,7 +168,6 @@
           <aggregate>true</aggregate>
           <instrumentation>
             <ignores>
-              <ignore>org.apache.parquet.Log.*</ignore>
               <ignore>java.lang.UnsupportedOperationException.*</ignore>
             </ignores>
             <excludes>


Mime
View raw message