Merge trunk into HA branch.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1623@1237157 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-01-28 20:33:30 +00:00
commit 30dd704e6c
5 changed files with 17 additions and 7 deletions

View File

@ -218,6 +218,9 @@ Release 0.23.1 - Unreleased
HADOOP-7939. Improve Hadoop subcomponent integration in Hadoop 0.23. (rvs via tucu) HADOOP-7939. Improve Hadoop subcomponent integration in Hadoop 0.23. (rvs via tucu)
HADOOP-8002. SecurityUtil acquired token message should be a debug rather than info.
(Arpit Gupta via mahadev)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -409,7 +409,9 @@ public static void setTokenService(Token<?> token, InetSocketAddress addr) {
Text service = buildTokenService(addr); Text service = buildTokenService(addr);
if (token != null) { if (token != null) {
token.setService(service); token.setService(service);
LOG.info("Acquired token "+token); // Token#toString() prints service if (LOG.isDebugEnabled()) {
LOG.debug("Acquired token "+token); // Token#toString() prints service
}
} else { } else {
LOG.warn("Failed to get token for service "+service); LOG.warn("Failed to get token for service "+service);
} }

View File

@ -172,6 +172,9 @@ Trunk (unreleased changes)
HDFS-2768. BackupNode stop can not close proxy connections because HDFS-2768. BackupNode stop can not close proxy connections because
it is not a proxy instance. (Uma Maheswara Rao G via eli) it is not a proxy instance. (Uma Maheswara Rao G via eli)
HDFS-2759. Pre-allocate HDFS edit log files after writing version number.
(atm)
Release 0.23.1 - UNRELEASED Release 0.23.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -167,10 +167,10 @@ protected void flushAndSync() throws IOException {
LOG.info("Nothing to flush"); LOG.info("Nothing to flush");
return; return;
} }
preallocate(); // preallocate file if necessary
doubleBuf.flushTo(fp); doubleBuf.flushTo(fp);
fc.force(false); // metadata updates not needed because of preallocation fc.force(false); // metadata updates not needed
fc.position(fc.position() - 1); // skip back the end-of-file marker fc.position(fc.position() - 1); // skip back the end-of-file marker
preallocate(); // preallocate file if necessary
} }
/** /**

View File

@ -41,6 +41,7 @@
public class TestEditLogFileOutputStream { public class TestEditLogFileOutputStream {
private final static long PREALLOCATION_LENGTH = (1024 * 1024) + 4;
private final static int HEADER_LEN = 17; private final static int HEADER_LEN = 17;
private static final File TEST_EDITS = private static final File TEST_EDITS =
new File(System.getProperty("test.build.data","/tmp"), new File(System.getProperty("test.build.data","/tmp"),
@ -65,8 +66,9 @@ public void testPreallocation() throws IOException {
assertEquals("Edit log should contain a header as valid length", assertEquals("Edit log should contain a header as valid length",
HEADER_LEN, validation.getValidLength()); HEADER_LEN, validation.getValidLength());
assertEquals(1, validation.getNumTransactions()); assertEquals(1, validation.getNumTransactions());
assertEquals("Edit log should have 1MB of bytes allocated", assertEquals("Edit log should have 1MB pre-allocated, plus 4 bytes " +
1024*1024, editLog.length()); "for the version number",
PREALLOCATION_LENGTH, editLog.length());
cluster.getFileSystem().mkdirs(new Path("/tmp"), cluster.getFileSystem().mkdirs(new Path("/tmp"),
@ -79,8 +81,8 @@ public void testPreallocation() throws IOException {
validation.getValidLength() > oldLength); validation.getValidLength() > oldLength);
assertEquals(2, validation.getNumTransactions()); assertEquals(2, validation.getNumTransactions());
assertEquals("Edit log should be 1MB long", assertEquals("Edit log should be 1MB long, plus 4 bytes for the version number",
1024 * 1024, editLog.length()); PREALLOCATION_LENGTH, editLog.length());
// 256 blocks for the 1MB of preallocation space // 256 blocks for the 1MB of preallocation space
assertTrue("Edit log disk space used should be at least 257 blocks", assertTrue("Edit log disk space used should be at least 257 blocks",
256 * 4096 <= new DU(editLog, conf).getUsed()); 256 * 4096 <= new DU(editLog, conf).getUsed());