You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-commits@hadoop.apache.org by zj...@apache.org on 2014/04/10 20:57:02 UTC
svn commit: r1586414 - in /hadoop/common/trunk/hadoop-yarn-project: ./
hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/
hadoop-yarn/hadoop-yarn-server/had...
Author: zjshen
Date: Thu Apr 10 18:57:02 2014
New Revision: 1586414
URL: http://svn.apache.org/r1586414
Log:
YARN-1920. Fixed TestFileSystemApplicationHistoryStore failure on windows. Contributed by Vinod Kumar Vavilapalli.
Modified:
hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestFileSystemApplicationHistoryStore.java
Modified: hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt?rev=1586414&r1=1586413&r2=1586414&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-yarn-project/CHANGES.txt Thu Apr 10 18:57:02 2014
@@ -97,6 +97,9 @@ Release 2.4.1 - UNRELEASED
YARN-1910. Fixed a race condition in TestAMRMTokens that causes the test to
fail more often on Windows. (Xuan Gong via vinodkv)
+ YARN-1920. Fixed TestFileSystemApplicationHistoryStore failure on windows.
+ (Vinod Kumar Vavilapalli via zjshen)
+
Release 2.4.0 - 2014-04-07
INCOMPATIBLE CHANGES
Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java?rev=1586414&r1=1586413&r2=1586414&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java (original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java Thu Apr 10 18:57:02 2014
@@ -179,7 +179,7 @@ public class FileSystemApplicationHistor
LOG.info("Completed reading history information of application " + appId);
return historyData;
} catch (IOException e) {
- LOG.error("Error when reading history file of application " + appId);
+ LOG.error("Error when reading history file of application " + appId, e);
throw e;
} finally {
hfReader.close();
@@ -296,7 +296,7 @@ public class FileSystemApplicationHistor
return historyData;
} catch (IOException e) {
LOG.error("Error when reading history file of application attempt"
- + appAttemptId);
+ + appAttemptId, e);
throw e;
} finally {
hfReader.close();
@@ -344,7 +344,7 @@ public class FileSystemApplicationHistor
+ containerId);
return historyData;
} catch (IOException e) {
- LOG.error("Error when reading history file of container " + containerId);
+ LOG.error("Error when reading history file of container " + containerId, e);
throw e;
} finally {
hfReader.close();
@@ -420,7 +420,7 @@ public class FileSystemApplicationHistor
+ appStart.getApplicationId());
} catch (IOException e) {
LOG.error("Error when openning history file of application "
- + appStart.getApplicationId());
+ + appStart.getApplicationId(), e);
throw e;
}
outstandingWriters.put(appStart.getApplicationId(), hfWriter);
@@ -437,7 +437,7 @@ public class FileSystemApplicationHistor
+ appStart.getApplicationId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing start information of application "
- + appStart.getApplicationId());
+ + appStart.getApplicationId(), e);
throw e;
}
}
@@ -456,7 +456,7 @@ public class FileSystemApplicationHistor
+ appFinish.getApplicationId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing finish information of application "
- + appFinish.getApplicationId());
+ + appFinish.getApplicationId(), e);
throw e;
} finally {
hfWriter.close();
@@ -480,7 +480,7 @@ public class FileSystemApplicationHistor
+ appAttemptStart.getApplicationAttemptId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing start information of application attempt "
- + appAttemptStart.getApplicationAttemptId());
+ + appAttemptStart.getApplicationAttemptId(), e);
throw e;
}
}
@@ -501,7 +501,7 @@ public class FileSystemApplicationHistor
+ appAttemptFinish.getApplicationAttemptId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing finish information of application attempt "
- + appAttemptFinish.getApplicationAttemptId());
+ + appAttemptFinish.getApplicationAttemptId(), e);
throw e;
}
}
@@ -521,7 +521,7 @@ public class FileSystemApplicationHistor
+ containerStart.getContainerId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing start information of container "
- + containerStart.getContainerId());
+ + containerStart.getContainerId(), e);
throw e;
}
}
@@ -541,7 +541,7 @@ public class FileSystemApplicationHistor
+ containerFinish.getContainerId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing finish information of container "
- + containerFinish.getContainerId());
+ + containerFinish.getContainerId(), e);
}
}
@@ -676,9 +676,10 @@ public class FileSystemApplicationHistor
private TFile.Reader reader;
private TFile.Reader.Scanner scanner;
+ FSDataInputStream fsdis;
public HistoryFileReader(Path historyFile) throws IOException {
- FSDataInputStream fsdis = fs.open(historyFile);
+ fsdis = fs.open(historyFile);
reader =
new TFile.Reader(fsdis, fs.getFileStatus(historyFile).getLen(),
getConfig());
@@ -707,7 +708,7 @@ public class FileSystemApplicationHistor
}
public void close() {
- IOUtils.cleanup(LOG, scanner, reader);
+ IOUtils.cleanup(LOG, scanner, reader, fsdis);
}
}
Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestFileSystemApplicationHistoryStore.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestFileSystemApplicationHistoryStore.java?rev=1586414&r1=1586413&r2=1586414&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestFileSystemApplicationHistoryStore.java (original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/TestFileSystemApplicationHistoryStore.java Thu Apr 10 18:57:02 2014
@@ -23,6 +23,8 @@ import java.net.URI;
import org.junit.Assert;
+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;
@@ -42,6 +44,9 @@ import org.junit.Test;
public class TestFileSystemApplicationHistoryStore extends
ApplicationHistoryStoreTestUtils {
+ private static Log LOG = LogFactory
+ .getLog(TestFileSystemApplicationHistoryStore.class.getName());
+
private FileSystem fs;
private Path fsWorkingPath;
@@ -50,9 +55,12 @@ public class TestFileSystemApplicationHi
fs = new RawLocalFileSystem();
Configuration conf = new Configuration();
fs.initialize(new URI("/"), conf);
- fsWorkingPath = new Path("Test");
+ fsWorkingPath =
+ new Path("target",
+ TestFileSystemApplicationHistoryStore.class.getSimpleName());
fs.delete(fsWorkingPath, true);
- conf.set(YarnConfiguration.FS_APPLICATION_HISTORY_STORE_URI, fsWorkingPath.toString());
+ conf.set(YarnConfiguration.FS_APPLICATION_HISTORY_STORE_URI,
+ fsWorkingPath.toString());
store = new FileSystemApplicationHistoryStore();
store.init(conf);
store.start();
@@ -67,6 +75,7 @@ public class TestFileSystemApplicationHi
@Test
public void testReadWriteHistoryData() throws IOException {
+ LOG.info("Starting testReadWriteHistoryData");
testWriteHistoryData(5);
testReadHistoryData(5);
}
@@ -167,6 +176,7 @@ public class TestFileSystemApplicationHi
@Test
public void testWriteAfterApplicationFinish() throws IOException {
+ LOG.info("Starting testWriteAfterApplicationFinish");
ApplicationId appId = ApplicationId.newInstance(0, 1);
writeApplicationStartData(appId);
writeApplicationFinishData(appId);
@@ -203,6 +213,7 @@ public class TestFileSystemApplicationHi
@Test
public void testMassiveWriteContainerHistoryData() throws IOException {
+ LOG.info("Starting testMassiveWriteContainerHistoryData");
long mb = 1024 * 1024;
long usedDiskBefore = fs.getContentSummary(fsWorkingPath).getLength() / mb;
ApplicationId appId = ApplicationId.newInstance(0, 1);
@@ -221,12 +232,14 @@ public class TestFileSystemApplicationHi
@Test
public void testMissingContainerHistoryData() throws IOException {
+ LOG.info("Starting testMissingContainerHistoryData");
testWriteHistoryData(3, true, false);
testReadHistoryData(3, true, false);
}
@Test
public void testMissingApplicationAttemptHistoryData() throws IOException {
+ LOG.info("Starting testMissingApplicationAttemptHistoryData");
testWriteHistoryData(3, false, true);
testReadHistoryData(3, false, true);
}