Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 79460 invoked from network); 13 Mar 2006 20:06:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Mar 2006 20:06:19 -0000 Received: (qmail 12248 invoked by uid 500); 13 Mar 2006 20:06:17 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 11218 invoked by uid 500); 13 Mar 2006 20:06:13 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 11207 invoked by uid 500); 13 Mar 2006 20:06:13 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 11204 invoked by uid 99); 13 Mar 2006 20:06:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Mar 2006 12:06:13 -0800 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 13 Mar 2006 12:06:12 -0800 Received: (qmail 79280 invoked by uid 65534); 13 Mar 2006 20:05:52 -0000 Message-ID: <20060313200552.79278.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r385644 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio: FastAsyncSocketSender.java util/FastQueue.java util/SmartQueue.java Date: Mon, 13 Mar 2006 20:05:50 -0000 To: tomcat-dev@jakarta.apache.org From: fhanik@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: fhanik Date: Mon Mar 13 12:05:48 2006 New Revision: 385644 URL: http://svn.apache.org/viewcvs?rev=385644&view=rev Log: Removed the smart queue, not used anywhere. removed stats from the FastQueue, stats can be collected elsewhere. The FastAsyncSocketSender will go away, as the fast queue can be used in an interceptor that makes the replication asynchronous Removed: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/util/SmartQueue.java Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/FastAsyncSocketSender.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/util/FastQueue.java Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/FastAsyncSocketSender.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/FastAsyncSocketSender.java?rev=385644&r1=385643&r2=385644&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/FastAsyncSocketSender.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/FastAsyncSocketSender.java Mon Mar 13 12:05:48 2006 @@ -51,8 +51,7 @@ private static int threadCounter = 1; - private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory - .getLog(FastAsyncSocketSender.class); + private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(FastAsyncSocketSender.class); /** * The descriptive information about this implementation. @@ -157,31 +156,7 @@ public void setQueueCheckLock(boolean checkLock) { queue.setCheckLock(checkLock); } - /** - * @return Returns the doStats. - */ - public boolean isQueueDoStats() { - return queue.isDoStats(); - } - /** - * @param doStats The doStats to set. - */ - public void setQueueDoStats(boolean doStats) { - queue.setDoStats(doStats); - } - /** - * @return Returns the timeWait. - */ - public boolean isQueueTimeWait() { - return queue.isTimeWait(); - } - /** - * @param timeWait The timeWait to set. - */ - public void setQueueTimeWait(boolean timeWait) { - queue.setTimeWait(timeWait); - } - + /** * @return Returns the inQueueCounter. */ @@ -194,20 +169,6 @@ */ public void setMaxQueueLength(int length) { queue.setMaxQueueLength(length); - } - - /** - * @return Returns the add wait times. - */ - public long getQueueAddWaitTime() { - return queue.getAddWait(); - } - - /** - * @return Returns the add wait times. - */ - public long getQueueRemoveWaitTime() { - return queue.getRemoveWait(); } /** Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/util/FastQueue.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/util/FastQueue.java?rev=385644&r1=385643&r2=385644&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/util/FastQueue.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tcp/bio/util/FastQueue.java Mon Mar 13 12:05:48 2006 @@ -29,8 +29,7 @@ */ public class FastQueue implements IQueue { - private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory - .getLog(FastQueue.class); + private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(FastQueue.class); /** * This is the actual queue @@ -62,11 +61,6 @@ */ private boolean timeWait = false; - /** - * calc stats data - */ - private boolean doStats = false; - private boolean inAdd = false; private boolean inRemove = false; @@ -95,50 +89,11 @@ private boolean enabled = true; /** - * calc all add objects - */ - private long addCounter = 0; - - /** - * calc all add objetcs in error state ( see limit queue length) - */ - private long addErrorCounter = 0; - - /** - * calc all remove objects - */ - private long removeCounter = 0; - - /** - * calc all remove objects failures (hupps probleme detection) - */ - private long removeErrorCounter = 0; - - /** - * Calc wait time thread - */ - private long addWait = 0; - - /** - * Calc remove time threads - */ - private long removeWait = 0; - - /** * max queue size */ private int maxSize = 0; /** - * avg queue size - */ - private long avgSize = 0; - - private int maxSizeSample = 0; - - private long avgSizeSample = 0; - - /** * avg size sample interval */ private int sampleInterval = 100; @@ -231,90 +186,7 @@ this.checkLock = checkLock; } - /** - * @return Returns the doStats. - */ - public boolean isDoStats() { - return doStats; - } - - /** - * @param doStats The doStats to set. - */ - public void setDoStats(boolean doStats) { - this.doStats = doStats; - } - - /** - * @return Returns the timeWait. - */ - public boolean isTimeWait() { - return timeWait; - } - - /** - * @param timeWait The timeWait to set. - */ - public void setTimeWait(boolean timeWait) { - this.timeWait = timeWait; - } - - public int getSampleInterval() { - return sampleInterval; - } - - public void setSampleInterval(int interval) { - sampleInterval = interval; - } - - public long getAddCounter() { - return addCounter; - } - - public void setAddCounter(long counter) { - addCounter = counter; - } - - public long getAddErrorCounter() { - return addErrorCounter; - } - - public void setAddErrorCounter(long counter) { - addErrorCounter = counter; - } - - public long getRemoveCounter() { - return removeCounter; - } - - public void setRemoveCounter(long counter) { - removeCounter = counter; - } - - public long getRemoveErrorCounter() { - return removeErrorCounter; - } - - public void setRemoveErrorCounter(long counter) { - removeErrorCounter = counter; - } - - public long getAddWait() { - return addWait; - } - - public void setAddWait(long wait) { - addWait = wait; - } - - public long getRemoveWait() { - return removeWait; - } - - public void setRemoveWait(long wait) { - removeWait = wait; - } - + /** * @return The max size */ @@ -331,32 +203,6 @@ /** - * Avg queue size - * @return The average queue size - */ - public long getAvgSize() { - if (addCounter > 0) { - return avgSize / addCounter; - } else { - return 0; - } - } - - /** - * reset all stats data - */ - public void resetStatistics() { - addCounter = 0; - addErrorCounter = 0; - removeCounter = 0; - removeErrorCounter = 0; - avgSize = 0; - maxSize = 0; - addWait = 0; - removeWait = 0; - } - - /** * unlock queue for next add */ public void unlockAdd() { @@ -384,33 +230,8 @@ setEnabled(false); } - public long getSample() { - return addCounter % sampleInterval; - } - - public int getMaxSizeSample() { - return maxSizeSample; - } - - public void setMaxSizeSample(int size) { - maxSizeSample = size; - } - - public long getAvgSizeSample() { - long sample = addCounter % sampleInterval; - if (sample > 0) { - return avgSizeSample / sample; - } else if (addCounter > 0) { - return avgSizeSample / sampleInterval; - } else { - return 0; - } - } - public int getSize() { - int sz; - sz = size; - return sz; + return size; } /** @@ -433,10 +254,6 @@ } lock.lockAdd(); try { - if (timeWait) { - addWait += (System.currentTimeMillis() - time); - } - if (log.isTraceEnabled()) { log.trace("FastQueue.add: starting with size " + size); } @@ -452,10 +269,8 @@ if ((maxQueueLength > 0) && (size >= maxQueueLength)) { ok = false; if (log.isTraceEnabled()) { - log.trace("FastQueue.add: Could not add, since queue is full (" - + size + ">=" + maxQueueLength + ")"); + log.trace("FastQueue.add: Could not add, since queue is full (" + size + ">=" + maxQueueLength + ")"); } - } else { LinkObject element = new LinkObject(key, data); if (size == 0) { @@ -464,68 +279,33 @@ } else { if (last == null) { ok = false; - log - .error("FastQueue.add: Could not add, since last is null although size is " - + size + " (>0)"); + log.error("FastQueue.add: Could not add, since last is null although size is "+ size + " (>0)"); } else { last.append(element); last = element; size++; } } - - } - - if (doStats) { - if (ok) { - if (addCounter % sampleInterval == 0) { - maxSizeSample = 0; - avgSizeSample = 0; - } - addCounter++; - if (size > maxSize) { - maxSize = size; - } - if (size > maxSizeSample) { - maxSizeSample = size; - } - avgSize += size; - avgSizeSample += size; - } else { - addErrorCounter++; - } } if (first == null) { - log.error("FastQueue.add: first is null, size is " + size - + " at end of add"); + log.error("FastQueue.add: first is null, size is " + size + " at end of add"); } if (last == null) { - log.error("FastQueue.add: last is null, size is " + size - + " at end of add"); + log.error("FastQueue.add: last is null, size is " + size+ " at end of add"); } if (checkLock) { - if (!inMutex) - log.warn("FastQueue.add: Cancelled by other mutex in add"); + if (!inMutex) log.warn("FastQueue.add: Cancelled by other mutex in add"); inMutex = false; - if (!inAdd) - log.warn("FastQueue.add: Cancelled by other add"); + if (!inAdd) log.warn("FastQueue.add: Cancelled by other add"); inAdd = false; } - if (log.isTraceEnabled()) { - log.trace("FastQueue.add: add ending with size " + size); - } + if (log.isTraceEnabled()) log.trace("FastQueue.add: add ending with size " + size); - if (timeWait) { - time = System.currentTimeMillis(); - } } finally { lock.unlockAdd(true); } - if (timeWait) { - addWait += (System.currentTimeMillis() - time); - } return ok; } @@ -553,12 +333,6 @@ if (!gotLock) { if (enabled) { - if (timeWait) { - removeWait += (System.currentTimeMillis() - time); - } - if (doStats) { - removeErrorCounter++; - } if (log.isInfoEnabled()) log.info("FastQueue.remove: Remove aborted although queue enabled"); } else { @@ -568,10 +342,6 @@ return null; } - if (timeWait) { - removeWait += (System.currentTimeMillis() - time); - } - if (log.isTraceEnabled()) { log.trace("FastQueue.remove: remove starting with size " + size); } @@ -586,17 +356,6 @@ element = first; - if (doStats) { - if (element != null) { - removeCounter++; - } else { - removeErrorCounter++; - log - .error("FastQueue.remove: Could not remove, since first is null although size is " - + size + " (>0)"); - } - } - first = last = null; size = 0; @@ -617,9 +376,6 @@ } } finally { lock.unlockRemove(); - } - if (timeWait) { - removeWait += (System.currentTimeMillis() - time); } return element; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org