hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r776807 - in /hadoop/zookeeper/trunk: ./ src/java/main/org/apache/zookeeper/server/quorum/
Date Wed, 20 May 2009 18:51:16 GMT
Author: breed
Date: Wed May 20 18:51:15 2009
New Revision: 776807

URL: http://svn.apache.org/viewvc?rev=776807&view=rev
Log:
ZOOKEEPER-403. cleanup javac compiler warnings.

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/build.xml
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FollowerRequestProcessor.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=776807&r1=776806&r2=776807&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Wed May 20 18:51:15 2009
@@ -77,6 +77,8 @@
   ZOOKEEPER-405. nullpointer exception in zookeeper java shell. (mahadev via breed)
 
   ZOOKEEPER-410. address all findbugs warnings in client/server classes. (phunt via breed)
+  
+  ZOOKEEPER-403. cleanup javac compiler warnings. (flavio via breed)
 
 IMPROVEMENTS:
   ZOOKEEPER-308. improve the atomic broadcast performance 3x.

Modified: hadoop/zookeeper/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/build.xml?rev=776807&r1=776806&r2=776807&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/build.xml (original)
+++ hadoop/zookeeper/trunk/build.xml Wed May 20 18:51:15 2009
@@ -260,6 +260,8 @@
         <javac srcdir="${java.src.dir}" destdir="${build.classes}" 
                target="${target.jdk}" debug="on">
             <classpath refid="project.classpath"/>
+            <compilerarg value="-Xlint:all"/>
+            <compilerarg value="-Xlint:-path"/>
         </javac>
         <copy todir="${build.classes}">
             <fileset dir="${java.src.dir}"/>

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java?rev=776807&r1=776806&r2=776807&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
Wed May 20 18:51:15 2009
@@ -636,7 +636,7 @@
                             }
                         }
                         break;
-                    case LEADING:
+                    default:
                         /*
                          * There is at most one leader for each epoch, so if a
                          * peer claims to be the leader for an epoch, then that
@@ -645,14 +645,15 @@
                          * this leader, then processes will naturally move
                          * to a new epoch.
                          */
-                        if(n.epoch == logicalclock){
+                        if((n.state == ServerState.LEADING) && 
+                                (n.epoch == logicalclock)){
                             self.setPeerState((n.leader == self.getId()) ? 
                                     ServerState.LEADING: ServerState.FOLLOWING);
                        
                             leaveInstance();
                             return new Vote(n.leader, n.zxid);
                         }
-                    case FOLLOWING:
+                    
                         LOG.info("Notification: " + n.leader + ", " + n.zxid + 
                                 ", " + n.epoch + ", " + self.getId() + ", " + 
                                 self.getPeerState() + ", " + n.state + ", "
@@ -673,8 +674,6 @@
                             return new Vote(n.leader, n.zxid);
                         }
                         break;
-                    default:
-                        break;
                     }
                 }
             }

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FollowerRequestProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FollowerRequestProcessor.java?rev=776807&r1=776806&r2=776807&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FollowerRequestProcessor.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/FollowerRequestProcessor.java
Wed May 20 18:51:15 2009
@@ -74,6 +74,8 @@
                 switch (request.type) {
                 case OpCode.sync:
                     zks.pendingSyncs.add(request);
+                    zks.getFollower().request(request);
+                    break;
                 case OpCode.create:
                 case OpCode.delete:
                 case OpCode.setData:

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java?rev=776807&r1=776806&r2=776807&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
Wed May 20 18:51:15 2009
@@ -403,6 +403,7 @@
         case 3:
             le = new FastLeaderElection(this,
                         new QuorumCnxManager(this));
+            break;
         default:
             assert false;
         }



Mime
View raw message