You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by su...@apache.org on 2011/04/20 20:34:45 UTC
svn commit: r1095479 - in /hadoop/hdfs/branches/yahoo-merge: ./ bin/
src/c++/libhdfs/ src/contrib/hdfsproxy/
src/docs/src/documentation/content/xdocs/ src/java/
src/java/org/apache/hadoop/hdfs/server/datanode/
src/java/org/apache/hadoop/hdfs/server/nam...
Author: suresh
Date: Wed Apr 20 18:34:44 2011
New Revision: 1095479
URL: http://svn.apache.org/viewvc?rev=1095479&view=rev
Log:
Merging change r1062045 from trunk to yahoo-merge
Added:
hadoop/hdfs/branches/yahoo-merge/src/docs/src/documentation/content/xdocs/hdfs_editsviewer.xml
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/docs/src/documentation/content/xdocs/hdfs_editsviewer.xml
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOpCodes.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOpCodes.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/
- copied from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/BinaryEditsVisitor.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/BinaryEditsVisitor.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/BinaryTokenizer.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/BinaryTokenizer.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsElement.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsElement.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsLoader.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsLoader.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsLoaderCurrent.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsLoaderCurrent.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsVisitor.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsVisitor.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsVisitorFactory.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/EditsVisitorFactory.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsViewer.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/StatisticsEditsVisitor.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/StatisticsEditsVisitor.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TextEditsVisitor.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TextEditsVisitor.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/Tokenizer.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/Tokenizer.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TokenizerFactory.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TokenizerFactory.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlEditsVisitor.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlEditsVisitor.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlTokenizer.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/XmlTokenizer.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/DepthCounter.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/DepthCounter.java
hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/OfflineEditsViewerHelper.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/OfflineEditsViewerHelper.java
hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/
- copied from r1062045, hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/
hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java
hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/editsStored.xml
- copied unchanged from r1062045, hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/editsStored.xml
Modified:
hadoop/hdfs/branches/yahoo-merge/ (props changed)
hadoop/hdfs/branches/yahoo-merge/CHANGES.txt
hadoop/hdfs/branches/yahoo-merge/bin/hdfs
hadoop/hdfs/branches/yahoo-merge/build.xml (contents, props changed)
hadoop/hdfs/branches/yahoo-merge/src/c++/libhdfs/ (props changed)
hadoop/hdfs/branches/yahoo-merge/src/contrib/hdfsproxy/ (props changed)
hadoop/hdfs/branches/yahoo-merge/src/docs/src/documentation/content/xdocs/site.xml
hadoop/hdfs/branches/yahoo-merge/src/java/ (props changed)
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java (props changed)
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogBackupOutputStream.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java
hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java
hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/ (props changed)
hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java
hadoop/hdfs/branches/yahoo-merge/src/webapps/datanode/ (props changed)
hadoop/hdfs/branches/yahoo-merge/src/webapps/hdfs/ (props changed)
hadoop/hdfs/branches/yahoo-merge/src/webapps/secondary/ (props changed)
Propchange: hadoop/hdfs/branches/yahoo-merge/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -1,4 +1,4 @@
/hadoop/core/branches/branch-0.19/hdfs:713112
/hadoop/hdfs/branches/HDFS-265:796829-820463
/hadoop/hdfs/branches/branch-0.21:820487
-/hadoop/hdfs/trunk:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1036738,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1036738,1052823,1060619,1061067,1062020,1062045
Modified: hadoop/hdfs/branches/yahoo-merge/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/CHANGES.txt?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/CHANGES.txt (original)
+++ hadoop/hdfs/branches/yahoo-merge/CHANGES.txt Wed Apr 20 18:34:44 2011
@@ -19,6 +19,9 @@ Trunk (unreleased changes)
HDFS-1450. Federation: Introduce block pool ID into FSDatasetInterface.
(suresh)
+ HDFS-1448. Add a new tool Offline Edits Viewer (oev). (Erik Steffl
+ via szetszwo)
+
HDFS-1632. Federation: data node storage structure changes and
introduce block pool storage. (Tanping via suresh)
Modified: hadoop/hdfs/branches/yahoo-merge/bin/hdfs
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/bin/hdfs?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/bin/hdfs (original)
+++ hadoop/hdfs/branches/yahoo-merge/bin/hdfs Wed Apr 20 18:34:44 2011
@@ -32,6 +32,7 @@ function print_usage(){
echo " balancer run a cluster balancing utility"
echo " jmxget get JMX exported values from NameNode or DataNode."
echo " oiv apply the offline fsimage viewer to an fsimage"
+ echo " oev apply the offline edits viewer to an edits file"
echo " fetchdt fetch a delegation token from the NameNode"
echo " getconf get config values from configuration"
echo " Use -help to see options"
@@ -90,6 +91,8 @@ elif [ "$COMMAND" = "jmxget" ] ; then
CLASS=org.apache.hadoop.hdfs.tools.JMXGet
elif [ "$COMMAND" = "oiv" ] ; then
CLASS=org.apache.hadoop.hdfs.tools.offlineImageViewer.OfflineImageViewer
+elif [ "$COMMAND" = "oev" ] ; then
+ CLASS=org.apache.hadoop.hdfs.tools.offlineEditsViewer.OfflineEditsViewer
elif [ "$COMMAND" = "fetchdt" ] ; then
CLASS=org.apache.hadoop.hdfs.tools.DelegationTokenFetcher
elif [ "$COMMAND" = "getconf" ] ; then
Modified: hadoop/hdfs/branches/yahoo-merge/build.xml
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/build.xml?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/build.xml (original)
+++ hadoop/hdfs/branches/yahoo-merge/build.xml Wed Apr 20 18:34:44 2011
@@ -414,6 +414,8 @@
<copy file="${test.src.dir}/hdfs/org/apache/hadoop/cli/clitest_data/data1k" todir="${test.cache.data}"/>
<copy file="${test.src.dir}/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/fsimageV18" todir="${test.cache.data}"/>
<copy file="${test.src.dir}/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/fsimageV19" todir="${test.cache.data}"/>
+ <copy file="${test.src.dir}/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/editsStored" todir="${test.cache.data}"/>
+ <copy file="${test.src.dir}/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/editsStored.xml" todir="${test.cache.data}"/>
</target>
<macrodef name="macro-compile-hdfs-test">
Propchange: hadoop/hdfs/branches/yahoo-merge/build.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/build.xml:779102
/hadoop/hdfs/branches/HDFS-265/build.xml:796829-820463
/hadoop/hdfs/branches/branch-0.21/build.xml:820487
-/hadoop/hdfs/trunk/build.xml:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/build.xml:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Propchange: hadoop/hdfs/branches/yahoo-merge/src/c++/libhdfs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -1,3 +1,3 @@
/hadoop/core/branches/branch-0.19/mapred/src/c++/libhdfs:713112
/hadoop/core/trunk/src/c++/libhdfs:776175-784663
-/hadoop/hdfs/trunk/src/c++/libhdfs:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/c++/libhdfs:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Propchange: hadoop/hdfs/branches/yahoo-merge/src/contrib/hdfsproxy/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/src/contrib/hdfsproxy:776175-784663
/hadoop/hdfs/branches/HDFS-265/src/contrib/hdfsproxy:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/contrib/hdfsproxy:820487
-/hadoop/hdfs/trunk/src/contrib/hdfsproxy:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/contrib/hdfsproxy:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Modified: hadoop/hdfs/branches/yahoo-merge/src/docs/src/documentation/content/xdocs/site.xml
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/docs/src/documentation/content/xdocs/site.xml?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/docs/src/documentation/content/xdocs/site.xml (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/docs/src/documentation/content/xdocs/site.xml Wed Apr 20 18:34:44 2011
@@ -42,6 +42,7 @@ See http://forrest.apache.org/docs/linki
<hdfs_quotas label="Quotas" href="hdfs_quota_admin_guide.html" />
<hdfs_SLG label="Synthetic Load Generator" href="SLG_user_guide.html" />
<hdfs_imageviewer label="Offline Image Viewer" href="hdfs_imageviewer.html" />
+ <hdfs_editsviewer label="Offline Edits Viewer" href="hdfs_editsviewer.html" />
<hdfsproxy label="HDFS Proxy" href="hdfsproxy.html"/>
<faultinject_framework label="Fault Injection" href="faultinject_framework.html" />
<hdfs_libhdfs label="C API libhdfs" href="libhdfs.html" />
Propchange: hadoop/hdfs/branches/yahoo-merge/src/java/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/src/hdfs:776175-785643,785929-786278
/hadoop/hdfs/branches/HDFS-265/src/java:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/java:820487
-/hadoop/hdfs/trunk/src/java:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/java:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Propchange: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -4,4 +4,4 @@
/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java:776175-785643,785929-786278
/hadoop/hdfs/branches/HDFS-265/src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java:820487
-/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java:1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java:1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Modified: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogBackupOutputStream.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogBackupOutputStream.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogBackupOutputStream.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogBackupOutputStream.java Wed Apr 20 18:34:44 2011
@@ -147,7 +147,7 @@ class EditLogBackupOutputStream extends
JournalRecord jRec = null;
for(; idx < bufReadySize; idx++) {
jRec = bufReady.get(idx);
- if(jRec.op >= FSEditLog.Ops.OP_JSPOOL_START)
+ if(jRec.op >= FSEditLogOpCodes.OP_JSPOOL_START.getOpCode())
break; // special operation should be sent in a separate call to BN
jRec.write(out);
}
@@ -177,7 +177,7 @@ class EditLogBackupOutputStream extends
private void send(int ja) throws IOException {
try {
int length = out.getLength();
- out.write(FSEditLog.Ops.OP_INVALID);
+ out.write(FSEditLogOpCodes.OP_INVALID.getOpCode());
backupNode.journal(nnRegistration, ja, length, out.getData());
} finally {
out.reset();
Modified: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java Wed Apr 20 18:34:44 2011
@@ -128,7 +128,7 @@ class EditLogFileOutputStream extends Ed
@Override
void setReadyToFlush() throws IOException {
assert bufReady.size() == 0 : "previous data is not flushed yet";
- write(FSEditLog.Ops.OP_INVALID); // insert end-of-file marker
+ write(FSEditLogOpCodes.OP_INVALID.getOpCode()); // insert eof marker
DataOutputBuffer tmp = bufReady;
bufReady = bufCurrent;
bufCurrent = tmp;
@@ -189,7 +189,7 @@ class EditLogFileOutputStream extends Ed
*/
@Override
boolean isOperationSupported(byte op) {
- return op < FSEditLog.Ops.OP_JSPOOL_START - 1;
+ return op < FSEditLogOpCodes.OP_JSPOOL_START.getOpCode() - 1;
}
/**
Modified: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java Wed Apr 20 18:34:44 2011
@@ -47,6 +47,8 @@ import org.apache.hadoop.io.LongWritable
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.security.token.delegation.DelegationKey;
+import static org.apache.hadoop.hdfs.server.namenode.FSEditLogOpCodes.*;
+
/**
* FSEditLog maintains a log of the namespace modifications.
*
@@ -54,44 +56,6 @@ import org.apache.hadoop.security.token.
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class FSEditLog {
-
- abstract static class Ops {
- public static final byte OP_INVALID = -1;
- public static final byte OP_ADD = 0;
- public static final byte OP_RENAME_OLD = 1; // rename
- public static final byte OP_DELETE = 2; // delete
- public static final byte OP_MKDIR = 3; // create directory
- public static final byte OP_SET_REPLICATION = 4; // set replication
- //the following two are used only for backward compatibility :
- @Deprecated public static final byte OP_DATANODE_ADD = 5;
- @Deprecated public static final byte OP_DATANODE_REMOVE = 6;
- public static final byte OP_SET_PERMISSIONS = 7;
- public static final byte OP_SET_OWNER = 8;
- public static final byte OP_CLOSE = 9; // close after write
- public static final byte OP_SET_GENSTAMP = 10; // store genstamp
- /* The following two are not used any more. Should be removed once
- * LAST_UPGRADABLE_LAYOUT_VERSION is -17 or newer. */
- public static final byte OP_SET_NS_QUOTA = 11; // set namespace quota
- public static final byte OP_CLEAR_NS_QUOTA = 12; // clear namespace quota
- public static final byte OP_TIMES = 13; // sets mod & access time on a file
- public static final byte OP_SET_QUOTA = 14; // sets name and disk quotas.
- public static final byte OP_RENAME = 15; // new rename
- public static final byte OP_CONCAT_DELETE = 16; // concat files.
- public static final byte OP_SYMLINK = 17; // a symbolic link
- public static final byte OP_GET_DELEGATION_TOKEN = 18; //new delegation token
- public static final byte OP_RENEW_DELEGATION_TOKEN = 19; //renew delegation token
- public static final byte OP_CANCEL_DELEGATION_TOKEN = 20; //cancel delegation token
- public static final byte OP_UPDATE_MASTER_KEY = 21; //update master key
-
- /*
- * The following operations are used to control remote edit log streams,
- * and not logged into file streams.
- */
- static final byte OP_JSPOOL_START = // start journal spool
- NamenodeProtocol.JA_JSPOOL_START;
- static final byte OP_CHECKPOINT_TIME = // incr checkpoint time
- NamenodeProtocol.JA_CHECKPOINT_TIME;
- }
static final String NO_JOURNAL_STREAMS_WARNING = "!!! WARNING !!!" +
" File system changes are not persistent. No journal streams.";
@@ -369,7 +333,7 @@ public class FSEditLog {
* Write an operation to the edit log. Do not sync to persistent
* store yet.
*/
- void logEdit(byte op, Writable ... writables) {
+ void logEdit(FSEditLogOpCodes opCode, Writable ... writables) {
synchronized (this) {
// wait if an automatic sync is scheduled
waitIfAutoSyncScheduled();
@@ -379,10 +343,10 @@ public class FSEditLog {
ArrayList<EditLogOutputStream> errorStreams = null;
long start = now();
for(EditLogOutputStream eStream : editStreams) {
- if(!eStream.isOperationSupported(op))
+ if(!eStream.isOperationSupported(opCode.getOpCode()))
continue;
try {
- eStream.write(op, writables);
+ eStream.write(opCode.getOpCode(), writables);
} catch (IOException ie) {
LOG.error("logEdit: removing "+ eStream.getName(), ie);
if(errorStreams == null)
@@ -642,7 +606,7 @@ public class FSEditLog {
FSEditLog.toLogLong(newNode.getModificationTime()),
FSEditLog.toLogLong(newNode.getAccessTime()),
FSEditLog.toLogLong(newNode.getPreferredBlockSize())};
- logEdit(Ops.OP_ADD,
+ logEdit(OP_ADD,
new ArrayWritable(DeprecatedUTF8.class, nameReplicationPair),
new ArrayWritable(Block.class, newNode.getBlocks()),
newNode.getPermissionStatus(),
@@ -660,7 +624,7 @@ public class FSEditLog {
FSEditLog.toLogLong(newNode.getModificationTime()),
FSEditLog.toLogLong(newNode.getAccessTime()),
FSEditLog.toLogLong(newNode.getPreferredBlockSize())};
- logEdit(Ops.OP_CLOSE,
+ logEdit(OP_CLOSE,
new ArrayWritable(DeprecatedUTF8.class, nameReplicationPair),
new ArrayWritable(Block.class, newNode.getBlocks()),
newNode.getPermissionStatus());
@@ -675,8 +639,9 @@ public class FSEditLog {
FSEditLog.toLogLong(newNode.getModificationTime()),
FSEditLog.toLogLong(newNode.getAccessTime())
};
- logEdit(Ops.OP_MKDIR, new ArrayWritable(DeprecatedUTF8.class, info),
- newNode.getPermissionStatus());
+ logEdit(OP_MKDIR,
+ new ArrayWritable(DeprecatedUTF8.class, info),
+ newNode.getPermissionStatus());
}
/**
@@ -688,7 +653,7 @@ public class FSEditLog {
new DeprecatedUTF8(src),
new DeprecatedUTF8(dst),
FSEditLog.toLogLong(timestamp)};
- logEdit(Ops.OP_RENAME_OLD, new ArrayWritable(DeprecatedUTF8.class, info));
+ logEdit(OP_RENAME_OLD, new ArrayWritable(DeprecatedUTF8.class, info));
}
/**
@@ -699,17 +664,18 @@ public class FSEditLog {
new DeprecatedUTF8(src),
new DeprecatedUTF8(dst),
FSEditLog.toLogLong(timestamp)};
- logEdit(Ops.OP_RENAME, new ArrayWritable(DeprecatedUTF8.class, info),
- toBytesWritable(options));
+ logEdit(OP_RENAME,
+ new ArrayWritable(DeprecatedUTF8.class, info),
+ toBytesWritable(options));
}
/**
* Add set replication record to edit log
*/
void logSetReplication(String src, short replication) {
- logEdit(Ops.OP_SET_REPLICATION,
- new DeprecatedUTF8(src),
- FSEditLog.toLogReplication(replication));
+ logEdit(OP_SET_REPLICATION,
+ new DeprecatedUTF8(src),
+ FSEditLog.toLogReplication(replication));
}
/** Add set namespace quota record to edit log
@@ -718,20 +684,21 @@ public class FSEditLog {
* @param quota the directory size limit
*/
void logSetQuota(String src, long nsQuota, long dsQuota) {
- logEdit(Ops.OP_SET_QUOTA, new DeprecatedUTF8(src),
- new LongWritable(nsQuota), new LongWritable(dsQuota));
+ logEdit(OP_SET_QUOTA,
+ new DeprecatedUTF8(src),
+ new LongWritable(nsQuota), new LongWritable(dsQuota));
}
/** Add set permissions record to edit log */
void logSetPermissions(String src, FsPermission permissions) {
- logEdit(Ops.OP_SET_PERMISSIONS, new DeprecatedUTF8(src), permissions);
+ logEdit(OP_SET_PERMISSIONS, new DeprecatedUTF8(src), permissions);
}
/** Add set owner record to edit log */
void logSetOwner(String src, String username, String groupname) {
DeprecatedUTF8 u = new DeprecatedUTF8(username == null? "": username);
DeprecatedUTF8 g = new DeprecatedUTF8(groupname == null? "": groupname);
- logEdit(Ops.OP_SET_OWNER, new DeprecatedUTF8(src), u, g);
+ logEdit(OP_SET_OWNER, new DeprecatedUTF8(src), u, g);
}
/**
@@ -746,7 +713,7 @@ public class FSEditLog {
info[idx++] = new DeprecatedUTF8(srcs[i]);
}
info[idx] = FSEditLog.toLogLong(timestamp);
- logEdit(Ops.OP_CONCAT_DELETE, new ArrayWritable(DeprecatedUTF8.class, info));
+ logEdit(OP_CONCAT_DELETE, new ArrayWritable(DeprecatedUTF8.class, info));
}
/**
@@ -756,14 +723,14 @@ public class FSEditLog {
DeprecatedUTF8 info[] = new DeprecatedUTF8[] {
new DeprecatedUTF8(src),
FSEditLog.toLogLong(timestamp)};
- logEdit(Ops.OP_DELETE, new ArrayWritable(DeprecatedUTF8.class, info));
+ logEdit(OP_DELETE, new ArrayWritable(DeprecatedUTF8.class, info));
}
/**
* Add generation stamp record to edit log
*/
void logGenerationStamp(long genstamp) {
- logEdit(Ops.OP_SET_GENSTAMP, new LongWritable(genstamp));
+ logEdit(OP_SET_GENSTAMP, new LongWritable(genstamp));
}
/**
@@ -774,7 +741,7 @@ public class FSEditLog {
new DeprecatedUTF8(src),
FSEditLog.toLogLong(mtime),
FSEditLog.toLogLong(atime)};
- logEdit(Ops.OP_TIMES, new ArrayWritable(DeprecatedUTF8.class, info));
+ logEdit(OP_TIMES, new ArrayWritable(DeprecatedUTF8.class, info));
}
/**
@@ -787,9 +754,9 @@ public class FSEditLog {
new DeprecatedUTF8(value),
FSEditLog.toLogLong(mtime),
FSEditLog.toLogLong(atime)};
- logEdit(Ops.OP_SYMLINK,
- new ArrayWritable(DeprecatedUTF8.class, info),
- node.getPermissionStatus());
+ logEdit(OP_SYMLINK,
+ new ArrayWritable(DeprecatedUTF8.class, info),
+ node.getPermissionStatus());
}
/**
@@ -800,20 +767,20 @@ public class FSEditLog {
*/
void logGetDelegationToken(DelegationTokenIdentifier id,
long expiryTime) {
- logEdit(Ops.OP_GET_DELEGATION_TOKEN, id, FSEditLog.toLogLong(expiryTime));
+ logEdit(OP_GET_DELEGATION_TOKEN, id, FSEditLog.toLogLong(expiryTime));
}
void logRenewDelegationToken(DelegationTokenIdentifier id,
long expiryTime) {
- logEdit(Ops.OP_RENEW_DELEGATION_TOKEN, id, FSEditLog.toLogLong(expiryTime));
+ logEdit(OP_RENEW_DELEGATION_TOKEN, id, FSEditLog.toLogLong(expiryTime));
}
void logCancelDelegationToken(DelegationTokenIdentifier id) {
- logEdit(Ops.OP_CANCEL_DELEGATION_TOKEN, id);
+ logEdit(OP_CANCEL_DELEGATION_TOKEN, id);
}
void logUpdateMasterKey(DelegationKey key) {
- logEdit(Ops.OP_UPDATE_MASTER_KEY, key);
+ logEdit(OP_UPDATE_MASTER_KEY, key);
}
static private DeprecatedUTF8 toLogReplication(short replication) {
@@ -1064,7 +1031,7 @@ public class FSEditLog {
boStream = new EditLogBackupOutputStream(bnReg, nnReg);
editStreams.add(boStream);
}
- logEdit(Ops.OP_JSPOOL_START, (Writable[])null);
+ logEdit(OP_JSPOOL_START, (Writable[])null);
}
/**
@@ -1162,7 +1129,7 @@ public class FSEditLog {
void incrementCheckpointTime() {
fsimage.incrementCheckpointTime();
Writable[] args = {new LongWritable(fsimage.getCheckpointTime())};
- logEdit(Ops.OP_CHECKPOINT_TIME, args);
+ logEdit(OP_CHECKPOINT_TIME, args);
}
synchronized void releaseBackupStream(NamenodeRegistration registration) {
Modified: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java Wed Apr 20 18:34:44 2011
@@ -34,7 +34,6 @@ import org.apache.hadoop.hdfs.security.t
import static org.apache.hadoop.hdfs.server.common.Util.now;
import org.apache.hadoop.hdfs.server.common.GenerationStamp;
import org.apache.hadoop.hdfs.server.common.Storage;
-import org.apache.hadoop.hdfs.server.namenode.FSEditLog.Ops;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Writable;
@@ -122,11 +121,12 @@ public class FSEditLogLoader {
long mtime = 0;
long atime = 0;
long blockSize = 0;
- byte opcode = -1;
+ FSEditLogOpCodes opCode;
try {
in.mark(1);
- opcode = in.readByte();
- if (opcode == Ops.OP_INVALID) {
+ byte opCodeByte = in.readByte();
+ opCode = FSEditLogOpCodes.fromByte(opCodeByte);
+ if (opCode == FSEditLogOpCodes.OP_INVALID) {
in.reset(); // reset back to end of file if somebody reads it again
break; // no more transactions
}
@@ -134,9 +134,9 @@ public class FSEditLogLoader {
break; // no more transactions
}
numEdits++;
- switch (opcode) {
- case Ops.OP_ADD:
- case Ops.OP_CLOSE: {
+ switch (opCode) {
+ case OP_ADD:
+ case OP_CLOSE: {
// versions > 0 support per file replication
// get name and replication
int length = in.readInt();
@@ -158,7 +158,7 @@ public class FSEditLogLoader {
blockSize = readLong(in);
}
// get blocks
- boolean isFileUnderConstruction = (opcode == Ops.OP_ADD);
+ boolean isFileUnderConstruction = (opCode == FSEditLogOpCodes.OP_ADD);
BlockInfo blocks[] =
readBlocks(in, logVersion, isFileUnderConstruction, replication);
@@ -181,7 +181,7 @@ public class FSEditLogLoader {
}
// clientname, clientMachine and block locations of last block.
- if (opcode == Ops.OP_ADD && logVersion <= -12) {
+ if (opCode == FSEditLogOpCodes.OP_ADD && logVersion <= -12) {
clientName = FSImage.readString(in);
clientMachine = FSImage.readString(in);
if (-13 <= logVersion) {
@@ -195,7 +195,7 @@ public class FSEditLogLoader {
// The open lease transaction re-creates a file if necessary.
// Delete the file if it already exists.
if (FSNamesystem.LOG.isDebugEnabled()) {
- FSNamesystem.LOG.debug(opcode + ": " + path +
+ FSNamesystem.LOG.debug(opCode + ": " + path +
" numblocks : " + blocks.length +
" clientHolder " + clientName +
" clientMachine " + clientMachine);
@@ -229,16 +229,16 @@ public class FSEditLogLoader {
}
break;
}
- case Ops.OP_SET_REPLICATION: {
+ case OP_SET_REPLICATION: {
numOpSetRepl++;
path = FSImage.readString(in);
short replication = fsNamesys.adjustReplication(readShort(in));
fsDir.unprotectedSetReplication(path, replication, null);
break;
}
- case Ops.OP_CONCAT_DELETE: {
+ case OP_CONCAT_DELETE: {
if (logVersion > -22) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
numOpConcatDelete++;
@@ -257,7 +257,7 @@ public class FSEditLogLoader {
fsDir.unprotectedConcat(trg, srcs);
break;
}
- case Ops.OP_RENAME_OLD: {
+ case OP_RENAME_OLD: {
numOpRenameOld++;
int length = in.readInt();
if (length != 3) {
@@ -272,7 +272,7 @@ public class FSEditLogLoader {
fsNamesys.changeLease(s, d, dinfo);
break;
}
- case Ops.OP_DELETE: {
+ case OP_DELETE: {
numOpDelete++;
int length = in.readInt();
if (length != 2) {
@@ -284,7 +284,7 @@ public class FSEditLogLoader {
fsDir.unprotectedDelete(path, timestamp);
break;
}
- case Ops.OP_MKDIR: {
+ case OP_MKDIR: {
numOpMkDir++;
PermissionStatus permissions = fsNamesys.getUpgradePermission();
int length = in.readInt();
@@ -309,48 +309,48 @@ public class FSEditLogLoader {
fsDir.unprotectedMkdir(path, permissions, timestamp);
break;
}
- case Ops.OP_SET_GENSTAMP: {
+ case OP_SET_GENSTAMP: {
numOpSetGenStamp++;
long lw = in.readLong();
fsNamesys.setGenerationStamp(lw);
break;
}
- case Ops.OP_DATANODE_ADD: {
+ case OP_DATANODE_ADD: {
numOpOther++;
FSImage.DatanodeImage nodeimage = new FSImage.DatanodeImage();
nodeimage.readFields(in);
//Datanodes are not persistent any more.
break;
}
- case Ops.OP_DATANODE_REMOVE: {
+ case OP_DATANODE_REMOVE: {
numOpOther++;
DatanodeID nodeID = new DatanodeID();
nodeID.readFields(in);
//Datanodes are not persistent any more.
break;
}
- case Ops.OP_SET_PERMISSIONS: {
+ case OP_SET_PERMISSIONS: {
numOpSetPerm++;
if (logVersion > -11)
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
fsDir.unprotectedSetPermission(
FSImage.readString(in), FsPermission.read(in));
break;
}
- case Ops.OP_SET_OWNER: {
+ case OP_SET_OWNER: {
numOpSetOwner++;
if (logVersion > -11)
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
fsDir.unprotectedSetOwner(FSImage.readString(in),
FSImage.readString_EmptyAsNull(in),
FSImage.readString_EmptyAsNull(in));
break;
}
- case Ops.OP_SET_NS_QUOTA: {
+ case OP_SET_NS_QUOTA: {
if (logVersion > -16) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
fsDir.unprotectedSetQuota(FSImage.readString(in),
@@ -358,9 +358,9 @@ public class FSEditLogLoader {
FSConstants.QUOTA_DONT_SET);
break;
}
- case Ops.OP_CLEAR_NS_QUOTA: {
+ case OP_CLEAR_NS_QUOTA: {
if (logVersion > -16) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
fsDir.unprotectedSetQuota(FSImage.readString(in),
@@ -369,14 +369,14 @@ public class FSEditLogLoader {
break;
}
- case Ops.OP_SET_QUOTA:
+ case OP_SET_QUOTA:
fsDir.unprotectedSetQuota(FSImage.readString(in),
readLongWritable(in),
readLongWritable(in));
break;
- case Ops.OP_TIMES: {
+ case OP_TIMES: {
numOpTimes++;
int length = in.readInt();
if (length != 3) {
@@ -389,7 +389,7 @@ public class FSEditLogLoader {
fsDir.unprotectedSetTimes(path, mtime, atime, true);
break;
}
- case Ops.OP_SYMLINK: {
+ case OP_SYMLINK: {
numOpSymlink++;
int length = in.readInt();
if (length != 4) {
@@ -404,9 +404,9 @@ public class FSEditLogLoader {
fsDir.unprotectedSymlink(path, value, mtime, atime, perm);
break;
}
- case Ops.OP_RENAME: {
+ case OP_RENAME: {
if (logVersion > -21) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
numOpRename++;
@@ -424,9 +424,9 @@ public class FSEditLogLoader {
fsNamesys.changeLease(s, d, dinfo);
break;
}
- case Ops.OP_GET_DELEGATION_TOKEN: {
+ case OP_GET_DELEGATION_TOKEN: {
if (logVersion > -24) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
numOpGetDelegationToken++;
@@ -438,9 +438,9 @@ public class FSEditLogLoader {
.addPersistedDelegationToken(delegationTokenId, expiryTime);
break;
}
- case Ops.OP_RENEW_DELEGATION_TOKEN: {
+ case OP_RENEW_DELEGATION_TOKEN: {
if (logVersion > -24) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
numOpRenewDelegationToken++;
@@ -452,9 +452,9 @@ public class FSEditLogLoader {
.updatePersistedTokenRenewal(delegationTokenId, expiryTime);
break;
}
- case Ops.OP_CANCEL_DELEGATION_TOKEN: {
+ case OP_CANCEL_DELEGATION_TOKEN: {
if (logVersion > -24) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
numOpCancelDelegationToken++;
@@ -465,9 +465,9 @@ public class FSEditLogLoader {
.updatePersistedTokenCancellation(delegationTokenId);
break;
}
- case Ops.OP_UPDATE_MASTER_KEY: {
+ case OP_UPDATE_MASTER_KEY: {
if (logVersion > -24) {
- throw new IOException("Unexpected opcode " + opcode
+ throw new IOException("Unexpected opCode " + opCode
+ " for version " + logVersion);
}
numOpUpdateMasterKey++;
@@ -478,7 +478,7 @@ public class FSEditLogLoader {
break;
}
default: {
- throw new IOException("Never seen opcode " + opcode);
+ throw new IOException("Never seen opCode " + opCode);
}
}
}
Modified: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java Wed Apr 20 18:34:44 2011
@@ -54,8 +54,8 @@ public interface NamenodeProtocol extend
// Journal action codes. See journal().
public static byte JA_IS_ALIVE = 100; // check whether the journal is alive
public static byte JA_JOURNAL = 101; // just journal
- public static byte JA_JSPOOL_START = 102; // = FSEditLog.OP_JSPOOL_START
- public static byte JA_CHECKPOINT_TIME = 103; // = FSEditLog.OP_CHECKPOINT_TIME
+ public static byte JA_JSPOOL_START = 102; // = FSEditLogOpCodes.OP_JSPOOL_START
+ public static byte JA_CHECKPOINT_TIME = 103; // = FSEditLogOpCodes.OP_CHECKPOINT_TIME
public final static int ACT_UNKNOWN = 0; // unknown action
public final static int ACT_SHUTDOWN = 50; // shutdown node
Modified: hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageVisitor.java Wed Apr 20 18:34:44 2011
@@ -75,17 +75,6 @@ abstract class ImageVisitor {
}
/**
- * Utility class for tracking descent into the structure of the fsimage.
- */
- static protected class DepthCounter {
- private int depth = 0;
-
- public void incLevel() { depth++; }
- public void decLevel() { if(depth >= 1) depth--; }
- public int getLevel() { return depth; }
- }
-
- /**
* Begin visiting the fsimage structure. Opportunity to perform
* any initialization necessary for the implementing visitor.
*/
Propchange: hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/src/test/hdfs:776175-785643
/hadoop/hdfs/branches/HDFS-265/src/test/hdfs:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/test/hdfs:820487
-/hadoop/hdfs/trunk/src/test/hdfs:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/test/hdfs:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Modified: hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java?rev=1095479&r1=1095478&r2=1095479&view=diff
==============================================================================
--- hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java (original)
+++ hadoop/hdfs/branches/yahoo-merge/src/test/hdfs/org/apache/hadoop/hdfs/DFSTestUtil.java Wed Apr 20 18:34:44 2011
@@ -23,6 +23,8 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
+import java.io.FileInputStream;
+import java.io.DataInputStream;
import java.net.URL;
import java.net.URLConnection;
import java.security.PrivilegedExceptionAction;
@@ -376,4 +378,15 @@ public class DFSTestUtil {
public static Statistics getStatistics(FileSystem fs) {
return FileSystem.getStatistics(fs.getUri().getScheme(), fs.getClass());
}
+
+ /**
+ * Load file into byte[]
+ */
+ public static byte[] loadFile(String filename) throws IOException {
+ File file = new File(filename);
+ DataInputStream in = new DataInputStream(new FileInputStream(file));
+ byte[] content = new byte[(int)file.length()];
+ in.readFully(content);
+ return content;
+ }
}
Propchange: hadoop/hdfs/branches/yahoo-merge/src/webapps/datanode/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/src/webapps/datanode:776175-784663
/hadoop/hdfs/branches/HDFS-265/src/webapps/datanode:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/webapps/datanode:820487
-/hadoop/hdfs/trunk/src/webapps/datanode:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/webapps/datanode:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Propchange: hadoop/hdfs/branches/yahoo-merge/src/webapps/hdfs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/src/webapps/hdfs:776175-784663
/hadoop/hdfs/branches/HDFS-265/src/webapps/hdfs:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/webapps/hdfs:820487
-/hadoop/hdfs/trunk/src/webapps/hdfs:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/webapps/hdfs:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045
Propchange: hadoop/hdfs/branches/yahoo-merge/src/webapps/secondary/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 20 18:34:44 2011
@@ -2,4 +2,4 @@
/hadoop/core/trunk/src/webapps/secondary:776175-784663
/hadoop/hdfs/branches/HDFS-265/src/webapps/secondary:796829-820463
/hadoop/hdfs/branches/branch-0.21/src/webapps/secondary:820487
-/hadoop/hdfs/trunk/src/webapps/secondary:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020
+/hadoop/hdfs/trunk/src/webapps/secondary:987665-1004788,1026178-1028906,1032470-1033639,1034073,1034082-1034181,1034501-1034544,1052823,1060619,1061067,1062020,1062045