Преглед изворни кода

Small javadoc and unused imports cleanup in response to Jitendra's review

See https://issues.apache.org/jira/browse/HDFS-1073?focusedCommentId=13064221&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13064221


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1073@1146889 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon пре 14 година
родитељ
комит
e2de059e4d

+ 0 - 2
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileInputStream.java

@@ -21,8 +21,6 @@ package org.apache.hadoop.hdfs.server.namenode;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.nio.ByteBuffer;
-
 
 /**
  * An implementation of the abstract class {@link EditLogInputStream}, which

+ 8 - 2
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java

@@ -18,7 +18,6 @@
 package org.apache.hadoop.hdfs.server.namenode;
 
 import java.io.IOException;
-import java.io.OutputStream;
 import java.util.zip.Checksum;
 
 import static org.apache.hadoop.hdfs.server.common.Util.now;
@@ -55,7 +54,14 @@ implements JournalStream {
    */
   abstract void write(byte op, long txid, Writable ... writables)
   throws IOException;
-  abstract void write(byte[] data, int i, int length) throws IOException;
+  
+  /**
+   * Write raw data to an edit log. This data should already have
+   * the transaction ID, checksum, etc included. It is for use
+   * within the BackupNode when replicating edits from the
+   * NameNode.
+   */
+  abstract void write(byte[] data, int offset, int length) throws IOException;
   
   /**
    * Create and initialize underlying persistent edits log storage.

+ 0 - 7
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java

@@ -21,11 +21,8 @@ import static org.apache.hadoop.hdfs.server.common.Util.now;
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.IOException;
-import java.io.DataInputStream;
-import java.io.FileInputStream;
 import java.io.Closeable;
 import java.io.OutputStream;
 import java.net.URI;
@@ -50,8 +47,6 @@ import org.apache.hadoop.hdfs.protocol.FSConstants;
 import org.apache.hadoop.hdfs.protocol.LayoutVersion;
 import org.apache.hadoop.hdfs.protocol.LayoutVersion.Feature;
 import org.apache.hadoop.hdfs.server.common.Storage;
-import org.apache.hadoop.hdfs.server.common.Storage.StorageDirectory;
-import org.apache.hadoop.hdfs.server.common.StorageInfo;
 import org.apache.hadoop.hdfs.server.common.UpgradeManager;
 import org.apache.hadoop.hdfs.server.common.Util;
 import org.apache.hadoop.hdfs.server.common.HdfsConstants.NodeType;
@@ -63,10 +58,8 @@ import org.apache.hadoop.hdfs.util.AtomicFileOutputStream;
 import org.apache.hadoop.conf.Configuration;
 
 import org.apache.hadoop.io.IOUtils;
-import org.apache.hadoop.io.MD5Hash;
 import org.apache.hadoop.net.DNS;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import com.google.common.annotations.VisibleForTesting;