You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ph...@apache.org on 2011/10/20 18:48:17 UTC

svn commit: r1186916 - in /zookeeper/trunk: ./ bin/ src/ src/java/main/org/apache/zookeeper/server/ src/java/main/org/apache/zookeeper/server/upgrade/ src/java/test/org/apache/zookeeper/test/

Author: phunt
Date: Thu Oct 20 16:48:17 2011
New Revision: 1186916

URL: http://svn.apache.org/viewvc?rev=1186916&view=rev
Log:
ZOOKEEPER-1193. Remove upgrade code (Thomas Koch via phunt)

Removed:
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/UpgradeTest.java
Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/bin/zkServer.sh
    zookeeper/trunk/build.xml
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java
    zookeeper/trunk/src/java/main/org/apache/zookeeper/server/WatchManager.java
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/InvalidSnapshotTest.java
    zookeeper/trunk/src/zookeeper.jute

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Thu Oct 20 16:48:17 2011
@@ -57,6 +57,9 @@ IMPROVEMENTS:
   ZOOKEEPER-1155. Add windows automated builds (CI) for zookeeper c client bindings. (Dheeraj Agrawal via camille) 
 
   ZOOKEEPER-1226. extract version check in separate method in PrepRequestProcessor (Thomas Koch via camille)
+
+  ZOOKEEPER-1193. Remove upgrade code (Thomas Koch via phunt)
+
 Release 3.4.0 - 
 
 Non-backward compatible changes:

Modified: zookeeper/trunk/bin/zkServer.sh
URL: http://svn.apache.org/viewvc/zookeeper/trunk/bin/zkServer.sh?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/bin/zkServer.sh (original)
+++ zookeeper/trunk/bin/zkServer.sh Thu Oct 20 16:48:17 2011
@@ -138,13 +138,6 @@ stop)
     fi
     exit 0
     ;;
-upgrade)
-    shift
-    echo "upgrading the servers to 3.*"
-    $JAVA "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
-    -cp "$CLASSPATH" $JVMFLAGS org.apache.zookeeper.server.upgrade.UpgradeMain ${@}
-    echo "Upgrading ... "
-    ;;
 restart)
     shift
     "$0" stop ${@}

Modified: zookeeper/trunk/build.xml
URL: http://svn.apache.org/viewvc/zookeeper/trunk/build.xml?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/build.xml (original)
+++ zookeeper/trunk/build.xml Thu Oct 20 16:48:17 2011
@@ -66,7 +66,6 @@
     <property name="systest.src.dir" value="${src.dir}/java/systest"/>
     <property name="test.log.dir" value="${test.java.build.dir}/logs" />
     <property name="test.data.dir" value="${test.java.build.dir}/data" />
-    <property name="test.data.upgrade.dir" value="${test.data.dir}/upgrade" />
     <property name="test.data.invalid.dir" value="${test.data.dir}/invalidsnap" />
     <property name="test.cppunit.dir" value="${test.java.build.dir}/test-cppunit"/>
     <property name="test.tmp.dir" value="${test.java.build.dir}/tmp" />
@@ -1153,21 +1152,15 @@
     <target name="test-init" depends="jar,compile-test">
         <delete dir="${test.log.dir}" />
         <delete dir="${test.tmp.dir}" />
-        <delete dir="${test.data.upgrade.dir}" />
         <delete dir="${test.data.invalid.dir}" />
         <delete dir="${test.data.dir}" />
         <mkdir dir="${test.log.dir}" />
         <mkdir dir="${test.tmp.dir}" />
         <mkdir dir="${test.data.dir}" />
-        <mkdir dir="${test.data.upgrade.dir}" />
         <mkdir dir="${test.data.invalid.dir}" />
-        <copy todir="${test.data.upgrade.dir}">
-            <fileset dir="${basedir}/src/java/test/data/upgrade"/>
-        </copy>
         <copy todir="${test.data.invalid.dir}">
             <fileset dir="${basedir}/src/java/test/data/invalidsnap"/>
         </copy>
-       
     </target>
 
     <condition property="quicktest">

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java Thu Oct 20 16:48:17 2011
@@ -148,10 +148,6 @@ public class DataTree {
         return cloned;
     }
 
-    public Map<Long, HashSet<String>> getEphemeralsMap() {
-        return ephemerals;
-    }
-
     int getAclSize() {
         return longKeyMap.size();
     }
@@ -204,19 +200,6 @@ public class DataTree {
         return ephemerals.keySet();
     }
 
-    /**
-     * just an accessor method to allow raw creation of datatree's from a bunch
-     * of datanodes
-     *
-     * @param path
-     *            the path of the datanode
-     * @param node
-     *            the datanode corresponding to this path
-     */
-    public void addDataNode(String path, DataNode node) {
-        nodes.put(path, node);
-    }
-
     public DataNode getNode(String path) {
         return nodes.get(path);
     }
@@ -229,10 +212,9 @@ public class DataTree {
         return dataWatches.size() + childWatches.size();
     }
 
-    public int getEphemeralsCount() {
-        Map<Long, HashSet<String>> map = this.getEphemeralsMap();
+    int getEphemeralsCount() {
         int result = 0;
-        for (HashSet<String> set : map.values()) {
+        for (HashSet<String> set : ephemerals.values()) {
             result += set.size();
         }
         return result;
@@ -264,13 +246,13 @@ public class DataTree {
     /**
      * create a /zookeeper filesystem that is the proc filesystem of zookeeper
      */
-    private DataNode procDataNode = new DataNode(new byte[0], -1L, new StatPersisted());
+    private final DataNode procDataNode = new DataNode(new byte[0], -1L, new StatPersisted());
 
     /**
      * create a /zookeeper/quota node for maintaining quota properties for
      * zookeeper
      */
-    private DataNode quotaDataNode = new DataNode(new byte[0], -1L, new StatPersisted());
+    private final DataNode quotaDataNode = new DataNode(new byte[0], -1L, new StatPersisted());
 
     public DataTree() {
         /* Rather than fight it, let root have an alias */

Modified: zookeeper/trunk/src/java/main/org/apache/zookeeper/server/WatchManager.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/WatchManager.java?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/src/java/main/org/apache/zookeeper/server/WatchManager.java (original)
+++ zookeeper/trunk/src/java/main/org/apache/zookeeper/server/WatchManager.java Thu Oct 20 16:48:17 2011
@@ -35,7 +35,7 @@ import org.apache.zookeeper.Watcher.Even
  * This class manages watches. It allows watches to be associated with a string
  * and removes watchers and their watches in addition to managing triggers.
  */
-public class WatchManager {
+class WatchManager {
     private static final Logger LOG = LoggerFactory.getLogger(WatchManager.class);
 
     private final HashMap<String, HashSet<Watcher>> watchTable =
@@ -44,7 +44,7 @@ public class WatchManager {
     private final HashMap<Watcher, HashSet<String>> watch2Paths =
         new HashMap<Watcher, HashSet<String>>();
 
-    public synchronized int size(){
+    synchronized int size(){
         int result = 0;
         for(Set<Watcher> watches : watchTable.values()) {
             result += watches.size();
@@ -52,7 +52,7 @@ public class WatchManager {
         return result;
     }
 
-    public synchronized void addWatch(String path, Watcher watcher) {
+    synchronized void addWatch(String path, Watcher watcher) {
         HashSet<Watcher> list = watchTable.get(path);
         if (list == null) {
             // don't waste memory if there are few watches on a node
@@ -72,7 +72,7 @@ public class WatchManager {
         paths.add(path);
     }
 
-    public synchronized void removeWatcher(Watcher watcher) {
+    synchronized void removeWatcher(Watcher watcher) {
         HashSet<String> paths = watch2Paths.remove(watcher);
         if (paths == null) {
             return;
@@ -88,11 +88,11 @@ public class WatchManager {
         }
     }
 
-    public Set<Watcher> triggerWatch(String path, EventType type) {
+    Set<Watcher> triggerWatch(String path, EventType type) {
         return triggerWatch(path, type, null);
     }
 
-    public Set<Watcher> triggerWatch(String path, EventType type, Set<Watcher> supress) {
+    Set<Watcher> triggerWatch(String path, EventType type, Set<Watcher> supress) {
         WatchedEvent e = new WatchedEvent(type,
                 KeeperState.SyncConnected, path);
         HashSet<Watcher> watchers;
@@ -147,7 +147,7 @@ public class WatchManager {
      * watches by connection
      * @return string representation of watches
      */
-    public synchronized void dumpWatches(PrintWriter pwriter, boolean byPath) {
+    synchronized void dumpWatches(PrintWriter pwriter, boolean byPath) {
         if (byPath) {
             for (Entry<String, HashSet<Watcher>> e : watchTable.entrySet()) {
                 pwriter.println(e.getKey());

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/InvalidSnapshotTest.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/InvalidSnapshotTest.java?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/InvalidSnapshotTest.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/InvalidSnapshotTest.java Thu Oct 20 16:48:17 2011
@@ -39,7 +39,7 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class InvalidSnapshotTest extends ZKTestCase implements Watcher {
-    private final static Logger LOG = LoggerFactory.getLogger(UpgradeTest.class);
+    private final static Logger LOG = LoggerFactory.getLogger(InvalidSnapshotTest.class);
     private static final String HOSTPORT =
             "127.0.0.1:" + PortAssignment.unique();
 
@@ -57,7 +57,7 @@ public class InvalidSnapshotTest extends
         String[] args = {logfile.getCanonicalFile().toString()};
         LogFormatter.main(args);
     }
-    
+
     /**
      * test the snapshot
      * @throws Exception an exception could be expected

Modified: zookeeper/trunk/src/zookeeper.jute
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/zookeeper.jute?rev=1186916&r1=1186915&r2=1186916&view=diff
==============================================================================
--- zookeeper/trunk/src/zookeeper.jute (original)
+++ zookeeper/trunk/src/zookeeper.jute Thu Oct 20 16:48:17 2011
@@ -51,18 +51,6 @@ module org.apache.zookeeper.data {
         long ephemeralOwner; // owner id if ephemeral, 0 otw
         long pzxid;      // last modified children
     }
-
-   // information explicitly stored by the version 1 database of servers 
-   class StatPersistedV1 {
-       long czxid; //created zxid
-       long mzxid; //last modified zxid
-       long ctime; //created
-       long mtime; //last modified
-       int version; //version
-       int cversion; //child version
-       int aversion; //acl version
-       long ephemeralOwner; //owner id if ephemeral. 0 otw
-    }
 }
 
 module org.apache.zookeeper.proto {