You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hcatalog-commits@incubator.apache.org by to...@apache.org on 2012/05/01 16:26:31 UTC
svn commit: r1332740 [2/2] - in /incubator/hcatalog/branches/branch-0.4: ./
src/java/org/apache/hcatalog/cli/
src/java/org/apache/hcatalog/cli/SemanticAnalysis/
src/java/org/apache/hcatalog/common/ src/java/org/apache/hcatalog/data/
src/java/org/apache...
Modified: incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/mapreduce/TestHCatOutputFormat.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/mapreduce/TestHCatOutputFormat.java?rev=1332740&r1=1332739&r2=1332740&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/mapreduce/TestHCatOutputFormat.java (original)
+++ incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/mapreduce/TestHCatOutputFormat.java Tue May 1 16:26:30 2012
@@ -42,8 +42,12 @@ import org.apache.hadoop.hive.serde.Cons
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.OutputCommitter;
import org.apache.hadoop.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class TestHCatOutputFormat extends TestCase {
+
+ private static final Logger LOG = LoggerFactory.getLogger(TestHCatOutputFormat.class);
private HiveMetaStoreClient client;
private HiveConf hiveConf;
@@ -60,8 +64,7 @@ public class TestHCatOutputFormat extend
initTable();
} catch (Throwable e) {
- System.err.println("Unable to open the metastore");
- System.err.println(StringUtils.stringifyException(e));
+ LOG.error("Unable to open the metastore", e);
throw new Exception(e);
}
}
@@ -75,8 +78,7 @@ public class TestHCatOutputFormat extend
client.close();
} catch (Throwable e) {
- System.err.println("Unable to close metastore");
- System.err.println(StringUtils.stringifyException(e));
+ LOG.error("Unable to close metastore", e);
throw new Exception(e);
}
}
Modified: incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java?rev=1332740&r1=1332739&r2=1332740&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java (original)
+++ incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/pig/TestHCatLoaderComplexSchema.java Tue May 1 16:26:30 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/branches/branch-0.4/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java?rev=1332740&r1=1332739&r2=1332740&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java (original)
+++ incubator/hcatalog/branches/branch-0.4/src/test/org/apache/hcatalog/rcfile/TestRCFileMapReduceInputFormat.java Tue May 1 16:26:30 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();
}