Ver código fonte

Remove all references to OP_JSPOOL_START, which is no longer used.

Part of response to Konstantin's review.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-1073@1150894 13f79535-47bb-0310-9956-ffa450edef68
Todd Lipcon 13 anos atrás
pai
commit
8f341a6da8

+ 0 - 9
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogFileOutputStream.java

@@ -253,15 +253,6 @@ class EditLogFileOutputStream extends EditLogOutputStream {
     }
   }
 
-  /**
-   * Operations like OP_JSPOOL_START and OP_CHECKPOINT_TIME should not be
-   * written into edits file.
-   */
-  @Override
-  boolean isOperationSupported(byte op) {
-    return op < FSEditLogOpCodes.OP_JSPOOL_START.getOpCode() - 1;
-  }
-
   /**
    * Returns the file associated with this stream.
    */

+ 0 - 4
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/EditLogOutputStream.java

@@ -121,10 +121,6 @@ abstract class EditLogOutputStream implements JournalStream {
     return false;
   }
   
-  boolean isOperationSupported(byte op) {
-    return true;
-  }
-
   /**
    * Return total time spent in {@link #flushAndSync()}
    */

+ 2 - 10
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java

@@ -218,21 +218,13 @@ public class FSEditLog  {
         throw new java.lang.IllegalStateException(NO_JOURNAL_STREAMS_WARNING);
       }
       
-      // Only start a new transaction for OPs which will be persisted to disk.
-      // Obviously this excludes control op codes.
-      long start = now();
-      if (opCode.getOpCode() < FSEditLogOpCodes.OP_JSPOOL_START.getOpCode()) {
-        start = beginTransaction();
-      }
+      long start = beginTransaction();
 
       mapJournalsAndReportErrors(new JournalClosure() {
         @Override 
         public void apply(JournalAndStream jas) throws IOException {
           if (!jas.isActive()) return;
-          EditLogOutputStream stream = jas.stream;
-          if(!stream.isOperationSupported(opCode.getOpCode()))
-            return;
-          stream.write(opCode.getOpCode(), txid, writables);
+          jas.stream.write(opCode.getOpCode(), txid, writables);
         }
       }, "logging edit");
 

+ 1 - 4
hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOpCodes.java

@@ -55,10 +55,7 @@ public enum FSEditLogOpCodes {
   OP_UPDATE_MASTER_KEY          ((byte) 21),
   OP_REASSIGN_LEASE             ((byte) 22),
   OP_END_LOG_SEGMENT            ((byte) 23),
-  OP_START_LOG_SEGMENT          ((byte) 24),
-
-  // must be same as NamenodeProtocol.JA_JSPOOL_START
-  OP_JSPOOL_START               ((byte)102);
+  OP_START_LOG_SEGMENT          ((byte) 24);
 
   private byte opCode;
 

+ 0 - 2
hdfs/src/test/hdfs/org/apache/hadoop/hdfs/tools/offlineEditsViewer/TestOfflineEditsViewer.java

@@ -75,8 +75,6 @@ public class TestOfflineEditsViewer {
     obsoleteOpCodes.put(FSEditLogOpCodes.OP_DATANODE_REMOVE, true);
     obsoleteOpCodes.put(FSEditLogOpCodes.OP_SET_NS_QUOTA, true);
     obsoleteOpCodes.put(FSEditLogOpCodes.OP_CLEAR_NS_QUOTA, true);
-    // these are not written to files
-    obsoleteOpCodes.put(FSEditLogOpCodes.OP_JSPOOL_START, true);
   }
 
   @Before