Modified: incubator/hcatalog/trunk/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java?rev=1332736&r1=1332735&r2=1332736&view=diff ============================================================================== --- incubator/hcatalog/trunk/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java (original) +++ incubator/hcatalog/trunk/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java Tue May 1 16:21:51 2012 @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Properties; import junit.framework.Assert; @@ -33,7 +32,6 @@ import org.apache.hadoop.hive.ql.Command import org.apache.hadoop.hive.ql.Driver; import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hcatalog.MiniCluster; import org.apache.pig.ExecType; import org.apache.pig.PigServer; import org.apache.pig.backend.executionengine.ExecException; @@ -47,13 +45,15 @@ import org.apache.pig.impl.logicalLayer. import org.apache.pig.impl.logicalLayer.schema.Schema.FieldSchema; import org.junit.BeforeClass; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestHCatLoaderComplexSchema { //private static MiniCluster cluster = MiniCluster.buildCluster(); private static Driver driver; //private static Properties props; - + private static final Logger LOG = LoggerFactory.getLogger(TestHCatLoaderComplexSchema.class); private void dropTable(String tablename) throws IOException, CommandNeedRetryException{ driver.run("drop table "+tablename); } @@ -66,7 +66,7 @@ public class TestHCatLoaderComplexSchema } createTable = createTable + "stored as RCFILE tblproperties('hcat.isd'='org.apache.hcatalog.rcfile.RCFileInputDriver'," + "'hcat.osd'='org.apache.hcatalog.rcfile.RCFileOutputDriver') "; - System.out.println("Creating table:\n"+createTable); + LOG.info("Creating table:\n {}", createTable); CommandProcessorResponse result = driver.run(createTable); int retCode = result.getResponseCode(); if(retCode != 0) { @@ -187,7 +187,7 @@ public class TestHCatLoaderComplexSchema server.registerQuery("STORE A into '"+tablename+"' using org.apache.hcatalog.pig.HCatStorer(" + (provideSchemaToStorer ? "'', '"+pigSchema+"'" : "") + ");"); - + ExecJob execJob = server.executeBatch().get(0); if (!execJob.getStatistics().isSuccessful()) { throw new RuntimeException("Import failed", execJob.getException()); @@ -201,7 +201,7 @@ public class TestHCatLoaderComplexSchema Tuple input = data.get(i++); Tuple output = it.next(); Assert.assertEquals(input.toString(), output.toString()); - System.out.println(output); + LOG.info("tuple : {} ",output); } Schema dumpedXSchema = server.dumpSchema("X");
Modified: incubator/hcatalog/trunk/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java?rev=1332736&r1=1332735&r2=1332736&view=diff ============================================================================== --- incubator/hcatalog/trunk/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java (original) +++ incubator/hcatalog/trunk/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java Tue May 1 16:21:51 2012 @@ -25,8 +25,6 @@ import java.util.Properties; import junit.framework.TestCase; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -44,8 +42,9 @@ import org.apache.hadoop.mapreduce.JobCo import org.apache.hadoop.mapreduce.RecordReader; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.TaskAttemptID; -import org.apache.hcatalog.rcfile.RCFileMapReduceInputFormat; import org.apache.hcatalog.shims.HCatHadoopShims; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * TestRCFile. @@ -53,7 +52,7 @@ import org.apache.hcatalog.shims.HCatHad */ public class TestRCFileMapReduceInputFormat extends TestCase { - private static final Log LOG = LogFactory.getLog(TestRCFileMapReduceInputFormat.class); + private static final Logger LOG = LoggerFactory.getLogger(TestRCFileMapReduceInputFormat.class); private static Configuration conf = new Configuration(); @@ -124,7 +123,7 @@ import org.apache.hcatalog.shims.HCatHad String usage = "Usage: RCFile " + "[-count N]" + " file"; if (args.length == 0) { - System.err.println(usage); + LOG.error(usage); System.exit(-1); } @@ -141,16 +140,16 @@ import org.apache.hcatalog.shims.HCatHad } if (file == null) { - System.err.println(usage); + LOG.error(usage); System.exit(-1); } - LOG.info("count = " + count); - LOG.info("create = " + create); - LOG.info("file = " + file); + LOG.info("count = {}", count); + LOG.info("create = {}", create); + LOG.info("file = {}" ,file); // test.performanceTest(); - System.out.println("Finished."); + LOG.info("Finished."); } finally { fs.close(); }
