zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject svn commit: r1444340 - in /zookeeper/bookkeeper/trunk: ./ bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/
Date Sat, 09 Feb 2013 07:59:47 GMT
Author: sijie
Date: Sat Feb  9 07:59:47 2013
New Revision: 1444340

URL: http://svn.apache.org/r1444340
Log:
BOOKKEEPER-556: BookieServerMXBean#getServerState makes no sense (ivank via sijie)

Modified:
    zookeeper/bookkeeper/trunk/CHANGES.txt
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerBean.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerMXBean.java
    zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ServerStats.java

Modified: zookeeper/bookkeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/CHANGES.txt?rev=1444340&r1=1444339&r2=1444340&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/CHANGES.txt (original)
+++ zookeeper/bookkeeper/trunk/CHANGES.txt Sat Feb  9 07:59:47 2013
@@ -20,6 +20,8 @@ Trunk (unreleased changes)
 
       BOOKKEEPER-312: Implementation of JMS provider (mridul via ivank)
 
+      BOOKKEEPER-556: BookieServerMXBean#getServerState makes no sense (ivank via sijie)
+
 Release 4.2.0 - 2013-01-14
 
   Non-backward compatible changes:

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerBean.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerBean.java?rev=1444340&r1=1444339&r2=1444340&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerBean.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerBean.java
Sat Feb  9 07:59:47 2013
@@ -75,11 +75,6 @@ public class BookieServerBean implements
     }
 
     @Override
-    public String getServerState() {
-        return bks.nioServerFactory.stats.getServerState();
-    }
-
-    @Override
     public String getServerPort() {
         try {
             return StringUtils.addrToString(Bookie.getBookieAddress(conf));

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerMXBean.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerMXBean.java?rev=1444340&r1=1444339&r2=1444340&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerMXBean.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieServerMXBean.java
Sat Feb  9 07:59:47 2013
@@ -46,11 +46,6 @@ public interface BookieServerMXBean {
     public OpStatData getReadStats();
 
     /**
-     * @return server state
-     */
-    public String getServerState();
-
-    /**
      * @return server port
      */
     public String getServerPort();

Modified: zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ServerStats.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ServerStats.java?rev=1444340&r1=1444339&r2=1444340&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ServerStats.java
(original)
+++ zookeeper/bookkeeper/trunk/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ServerStats.java
Sat Feb  9 07:59:47 2013
@@ -25,32 +25,10 @@ public class ServerStats {
     private long totalLatency = 0;
     private long count = 0;
 
-    public interface Provider {
-        public long getOutstandingRequests();
-
-        public long getLastProcessedZxid();
-    }
-
-    private Provider provider = null;
-    private Object mutex = new Object();
-
     static public ServerStats getInstance() {
         return instance;
     }
 
-    static public void registerAsConcrete() {
-        setInstance(new ServerStats());
-    }
-
-    static synchronized public void unregister() {
-        instance = null;
-    }
-
-    static synchronized protected void setInstance(ServerStats newInstance) {
-        assert instance == null;
-        instance = newInstance;
-    }
-
     protected ServerStats() {
     }
 
@@ -69,17 +47,6 @@ public class ServerStats {
         return maxLatency;
     }
 
-    public long getOutstandingRequests() {
-        synchronized (mutex) {
-            return (provider != null) ? provider.getOutstandingRequests() : -1;
-        }
-    }
-
-    public long getLastProcessedZxid() {
-        synchronized (mutex) {
-            return (provider != null) ? provider.getLastProcessedZxid() : -1;
-        }
-    }
 
     synchronized public long getPacketsReceived() {
         return packetsReceived;
@@ -89,31 +56,15 @@ public class ServerStats {
         return packetsSent;
     }
 
-    public String getServerState() {
-        return "standalone";
-    }
-
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("Latency min/avg/max: " + getMinLatency() + "/" + getAvgLatency() + "/"
+ getMaxLatency() + "\n");
         sb.append("Received: " + getPacketsReceived() + "\n");
         sb.append("Sent: " + getPacketsSent() + "\n");
-        if (provider != null) {
-            sb.append("Outstanding: " + getOutstandingRequests() + "\n");
-            sb.append("Zxid: 0x" + Long.toHexString(getLastProcessedZxid()) + "\n");
-        }
-        sb.append("Mode: " + getServerState() + "\n");
         return sb.toString();
     }
 
-    // mutators
-    public void setStatsProvider(Provider zk) {
-        synchronized (mutex) {
-            provider = zk;
-        }
-    }
-
     synchronized void updateLatency(long requestCreateTime) {
         long latency = MathUtils.now() - requestCreateTime;
         totalLatency += latency;



Mime
View raw message