hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1150898 - /hadoop/common/branches/HDFS-1073/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Date Mon, 25 Jul 2011 20:41:57 GMT
Author: todd
Date: Mon Jul 25 20:41:56 2011
New Revision: 1150898

URL: http://svn.apache.org/viewvc?rev=1150898&view=rev
Log:
FSEditLog.JournalAndStream should not have public methods where possible.

Part of response to review by Konstantin.

Modified:
    hadoop/common/branches/HDFS-1073/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java

Modified: hadoop/common/branches/HDFS-1073/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1073/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java?rev=1150898&r1=1150897&r2=1150898&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1073/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
(original)
+++ hadoop/common/branches/HDFS-1073/hdfs/src/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
Mon Jul 25 20:41:56 2011
@@ -1060,17 +1060,17 @@ public class FSEditLog  {
     private EditLogOutputStream stream;
     private long segmentStartsAtTxId = FSConstants.INVALID_TXID;
     
-    public JournalAndStream(JournalManager manager) {
+    private JournalAndStream(JournalManager manager) {
       this.manager = manager;
     }
 
-    public void startLogSegment(long txId) throws IOException {
+    private void startLogSegment(long txId) throws IOException {
       Preconditions.checkState(stream == null);
       stream = manager.startLogSegment(txId);
       segmentStartsAtTxId = txId;
     }
 
-    public void close(long lastTxId) throws IOException {
+    private void close(long lastTxId) throws IOException {
       Preconditions.checkArgument(lastTxId >= segmentStartsAtTxId,
           "invalid segment: lastTxId %s >= " +
           "segment starting txid %s", lastTxId, segmentStartsAtTxId);
@@ -1081,7 +1081,7 @@ public class FSEditLog  {
       stream = null;
     }
     
-    public void abort() {
+    private void abort() {
       if (stream == null) return;
       try {
         stream.abort();
@@ -1092,10 +1092,11 @@ public class FSEditLog  {
       segmentStartsAtTxId = FSConstants.INVALID_TXID;
     }
 
-    boolean isActive() {
+    private boolean isActive() {
       return stream != null;
     }
-    
+
+    @VisibleForTesting
     EditLogOutputStream getCurrentStream() {
       return stream;
     }
@@ -1116,7 +1117,7 @@ public class FSEditLog  {
       return manager;
     }
 
-    public EditLogInputStream getInProgressInputStream() throws IOException {
+    private EditLogInputStream getInProgressInputStream() throws IOException {
       return manager.getInProgressInputStream(segmentStartsAtTxId);
     }
   }



Mime
View raw message