FAQ
Author: nzhang
Date: Sat Feb 20 01:45:02 2010
New Revision: 912062

URL: http://svn.apache.org/viewvc?rev=912062&view=rev
Log:
HIVE-1182: Fix TestCliDriver too many open file error

Modified:
hadoop/hive/branches/branch-0.5/CHANGES.txt
hadoop/hive/branches/branch-0.5/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java
hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestCliDriver.vm
hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestNegativeCliDriver.vm
hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParse.vm
hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParseNegative.vm

Modified: hadoop/hive/branches/branch-0.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/CHANGES.txt?rev=912062&r1=912061&r2=912062&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/CHANGES.txt (original)
+++ hadoop/hive/branches/branch-0.5/CHANGES.txt Sat Feb 20 01:45:02 2010
@@ -179,6 +179,9 @@
HIVE-1105. Add service script for starting metastore server.
(John Sichi via zshao)

+ HIVE-1182. Fix TestCliDriver too many open file error.
+ (Zheng Shao via Ning Zhang)
+
OPTIMIZATIONS

BUG FIXES

Modified: hadoop/hive/branches/branch-0.5/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java?rev=912062&r1=912061&r2=912062&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java (original)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/org/apache/hadoop/hive/ql/QTestUtil.java Sat Feb 20 01:45:02 2010
@@ -234,6 +234,8 @@
qsb.append(dis.readLine() + "\n");
}
qMap.put(qf.getName(), qsb.toString());
+
+ dis.close();
}

public void cleanUp() throws Exception {
@@ -447,6 +449,10 @@
ss.out = new PrintStream(fo, true, "UTF-8");
ss.err = ss.out;
ss.setIsSilent(true);
+ SessionState oldSs = SessionState.get();
+ if (oldSs != null) {
+ oldSs.out.close();
+ }
SessionState.start(ss);
cliDriver = new CliDriver();
}

Modified: hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestCliDriver.vm
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestCliDriver.vm?rev=912062&r1=912061&r2=912062&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestCliDriver.vm (original)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestCliDriver.vm Sat Feb 20 01:45:02 2010
@@ -38,9 +38,6 @@

qt = new QTestUtil("$resultsDir.getCanonicalPath()", "$logDir.getCanonicalPath()", miniMR);

-#foreach ($qf in $qfiles)
- qt.addFile("$qf.getCanonicalPath()");
-#end
}
catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
@@ -81,6 +78,9 @@
public void testCliDriver_$tname() throws Exception {
try {
System.out.println("Begin query: " + "$fname");
+
+ qt.addFile("$qf.getCanonicalPath()");
+
qt.cliInit("$fname");
int ecode = qt.executeClient("$fname");
if (ecode != 0) {

Modified: hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestNegativeCliDriver.vm
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestNegativeCliDriver.vm?rev=912062&r1=912061&r2=912062&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestNegativeCliDriver.vm (original)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestNegativeCliDriver.vm Sat Feb 20 01:45:02 2010
@@ -27,9 +27,6 @@
try {
qt = new QTestUtil("$resultsDir.getCanonicalPath()", "$logDir.getCanonicalPath()");

-#foreach ($qf in $qfiles)
- qt.addFile("$qf.getCanonicalPath()");
-#end
}
catch (Throwable e) {
e.printStackTrace();
@@ -56,6 +53,9 @@
public void testNegativeCliDriver_$tname() throws Exception {
try {
System.out.println("Begin query: " + "$fname");
+
+ qt.addFile("$qf.getCanonicalPath()");
+
qt.cliInit("$fname");
int ecode = qt.executeClient("$fname");
if (ecode == 0) {

Modified: hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParse.vm
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParse.vm?rev=912062&r1=912061&r2=912062&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParse.vm (original)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParse.vm Sat Feb 20 01:45:02 2010
@@ -23,10 +23,6 @@
protected void setUp() {
try {
qt = new QTestUtil("$resultsDir.getCanonicalPath()", "$logDir.getCanonicalPath()");
-
-#foreach ($qf in $qfiles)
- qt.addFile("$qf.getCanonicalPath()");
-#end
}
catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
@@ -54,6 +50,9 @@
public void testParse_$tname() throws Exception {
try {
System.out.println("Begin query: " + "$fname");
+
+ qt.addFile("$qf.getCanonicalPath()");
+
qt.init("$fname");
ASTNode tree = qt.parseQuery("$fname");
int ecode = qt.checkParseResults("$fname", tree);

Modified: hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParseNegative.vm
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParseNegative.vm?rev=912062&r1=912061&r2=912062&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParseNegative.vm (original)
+++ hadoop/hive/branches/branch-0.5/ql/src/test/templates/TestParseNegative.vm Sat Feb 20 01:45:02 2010
@@ -23,10 +23,6 @@
protected void setUp() {
try {
qt = new QTestUtil("$resultsDir.getCanonicalPath()", "$logDir.getCanonicalPath()");
-
-#foreach ($qf in $qfiles)
- qt.addFile("$qf.getCanonicalPath()");
-#end
}
catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
@@ -54,6 +50,9 @@
public void testParseNegative_$tname() throws Exception {
try {
System.out.println("Begin query: " + "$fname");
+
+ qt.addFile("$qf.getCanonicalPath()");
+
qt.init("$fname");
ASTNode tree = qt.parseQuery("$fname");
List<Task<? extends Serializable>> tasks = qt.analyzeAST(tree);

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedFeb 20, '10 at 1:45a
activeFeb 20, '10 at 1:45a
posts1
users1
websitehive.apache.org

1 user in discussion

Nzhang: 1 post

People

Translate

site design / logo © 2021 Grokbase