tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp AsyncSocketSender.java IDataSender.java ReplicationTransmitter.java
Date Wed, 29 Sep 2004 18:23:55 GMT
fhanik      2004/09/29 11:23:55

  Modified:    catalina/src/conf server.xml
               modules/cluster/src/share/org/apache/catalina/cluster/tcp
                        AsyncSocketSender.java IDataSender.java
                        ReplicationTransmitter.java
  Log:
  Added the ability to configure the ackTimeout on synchronous replication. For users with
a large amount of sessions or very large sessions this can be very helpful
  
  Revision  Changes    Path
  1.38      +2 -1      jakarta-tomcat-catalina/catalina/src/conf/server.xml
  
  Index: server.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/server.xml,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- server.xml	29 Sep 2004 16:45:27 -0000	1.37
  +++ server.xml	29 Sep 2004 18:23:55 -0000	1.38
  @@ -313,7 +313,8 @@
   
               <Sender
                   className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
  -                replicationMode="pooled"/>
  +                replicationMode="pooled"
  +                ackTimeout="15000"/>
   
               <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                      filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
  
  
  
  1.8       +7 -0      jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/AsyncSocketSender.java
  
  Index: AsyncSocketSender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/AsyncSocketSender.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AsyncSocketSender.java	1 Jul 2004 09:44:27 -0000	1.7
  +++ AsyncSocketSender.java	29 Sep 2004 18:23:55 -0000	1.8
  @@ -34,6 +34,7 @@
       private boolean suspect;
       
       private QueueThread queueThread = null;
  +    private long ackTimeout;
       
       public AsyncSocketSender(InetAddress host, int port)  {
           this.address = host;
  @@ -122,6 +123,12 @@
       
       public void setSuspect(boolean suspect) {
           this.suspect = suspect;
  +    }
  +    public long getAckTimeout() {
  +        return ackTimeout;
  +    }
  +    public void setAckTimeout(long ackTimeout) {
  +        this.ackTimeout = ackTimeout;
       }
       
       private class QueueThread extends Thread {
  
  
  
  1.5       +2 -1      jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/IDataSender.java
  
  Index: IDataSender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/IDataSender.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IDataSender.java	27 Feb 2004 14:58:56 -0000	1.4
  +++ IDataSender.java	29 Sep 2004 18:23:55 -0000	1.5
  @@ -35,4 +35,5 @@
       public boolean isConnected();
       public void setSuspect(boolean suspect);
       public boolean getSuspect();
  -}
  \ No newline at end of file
  +    public void setAckTimeout(long timeout);
  +}
  
  
  
  1.16      +10 -0     jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.java
  
  Index: ReplicationTransmitter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ReplicationTransmitter.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ReplicationTransmitter.java	27 Feb 2004 14:58:56 -0000	1.15
  +++ ReplicationTransmitter.java	29 Sep 2004 18:23:55 -0000	1.16
  @@ -34,6 +34,8 @@
       private static long nrOfRequests = 0;
       private static long totalBytes = 0;
       private String replicationMode;
  +    private long ackTimeout = 15000; //15 seconds by default
  +    
       private static synchronized void addStats(int length) {
           nrOfRequests++;
           totalBytes+=length;
  @@ -144,6 +146,8 @@
           {
   
               IDataSender sender = senders[i];
  +            //set the timeout, will be ignored by async senders
  +            sender.setAckTimeout(getAckTimeout());
               try
               {
                   sendMessageData(sessionId,data,sender);
  @@ -162,6 +166,12 @@
       public boolean getIsSenderSynchronized() {
           return IDataSenderFactory.SYNC_MODE.equals(replicationMode) ||
               IDataSenderFactory.POOLED_SYNC_MODE.equals(replicationMode);
  +    }
  +    public long getAckTimeout() {
  +        return ackTimeout;
  +    }
  +    public void setAckTimeout(long ackTimeout) {
  +        this.ackTimeout = ackTimeout;
       }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message