JBoss hornetq SVN: r11912 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-19 09:33:24 -0500 (Mon, 19 Dec 2011)
New Revision: 11912
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
Log:
https://issues.jboss.org/browse/JBPAPP-7785 - protecting factories usage - simple fix
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-12-19 13:58:48 UTC (rev 11911)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-12-19 14:33:24 UTC (rev 11912)
@@ -1417,10 +1417,13 @@
if (actMember != null && actMember.getConnector().getA() != null && actMember.getConnector().getB() != null)
{
- for (ClientSessionFactory factory : factories)
+ synchronized (factories)
{
- ((ClientSessionFactoryInternal)factory).setBackupConnector(actMember.getConnector().getA(),
- actMember.getConnector().getB());
+ for (ClientSessionFactory factory : factories)
+ {
+ ((ClientSessionFactoryInternal)factory).setBackupConnector(actMember.getConnector().getA(),
+ actMember.getConnector().getB());
+ }
}
}
@@ -1526,17 +1529,20 @@
}
}
- public synchronized void factoryClosed(final ClientSessionFactory factory)
+ public void factoryClosed(final ClientSessionFactory factory)
{
- factories.remove(factory);
-
- if (!clusterConnection && factories.isEmpty())
+ synchronized (factories)
{
- // Go back to using the broadcast or static list
-
- receivedTopology = false;
-
- topologyArray = null;
+ factories.remove(factory);
+
+ if (!clusterConnection && factories.isEmpty())
+ {
+ // Go back to using the broadcast or static list
+
+ receivedTopology = false;
+
+ topologyArray = null;
+ }
}
}
@@ -1555,7 +1561,7 @@
topology.removeClusterTopologyListener(listener);
}
- private synchronized void addFactory(ClientSessionFactoryInternal factory)
+ private void addFactory(ClientSessionFactoryInternal factory)
{
if (factory == null)
{
12 years, 4 months
JBoss hornetq SVN: r11911 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/ra.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-19 08:58:48 -0500 (Mon, 19 Dec 2011)
New Revision: 11911
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java
Log:
fixing test
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java 2011-12-16 11:28:44 UTC (rev 11910)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/ra/HornetQResourceAdapterConfigTest.java 2011-12-19 13:58:48 UTC (rev 11911)
@@ -72,13 +72,13 @@
" <config-property>\n" +
" <description>Does we support HA</description>\n" +
" <config-property-name>HA</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value>false</config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>Use A local Transaction instead of XA?</description>\n" +
" <config-property-name>UseLocalTx</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value>false</config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
@@ -108,19 +108,19 @@
" <config-property>\n" +
" <description>The discovery group port</description>\n" +
" <config-property-name>DiscoveryPort</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The discovery refresh timeout</description>\n" +
" <config-property-name>DiscoveryRefreshTimeout</config-property-name>\n" +
- " <config-property-type>java.lang.Long</config-property-type>\n" +
+ " <config-property-type>long</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The discovery initial wait timeout</description>\n" +
" <config-property-name>DiscoveryInitialWaitTimeout</config-property-name>\n" +
- " <config-property-type>java.lang.Long</config-property-type>\n" +
+ " <config-property-type>long</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property> \n" +
" <config-property>\n" +
@@ -132,103 +132,103 @@
" <config-property>\n" +
" <description>number of reconnect attempts for connections after failover occurs</description>\n" +
" <config-property-name>ReconnectAttempts</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The client failure check period</description>\n" +
" <config-property-name>ClientFailureCheckPeriod</config-property-name>\n" +
- " <config-property-type>java.lang.Long</config-property-type>\n" +
+ " <config-property-type>long</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The connection TTL</description>\n" +
" <config-property-name>ConnectionTTL</config-property-name>\n" +
- " <config-property-type>java.lang.Long</config-property-type>\n" +
+ " <config-property-type>long</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The call timeout</description>\n" +
" <config-property-name>CallTimeout</config-property-name>\n" +
- " <config-property-type>java.lang.Long</config-property-type>\n" +
+ " <config-property-type>long</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The dups ok batch size</description>\n" +
" <config-property-name>DupsOKBatchSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The transaction batch size</description>\n" +
" <config-property-name>TransactionBatchSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The consumer window size</description>\n" +
" <config-property-name>ConsumerWindowSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The consumer max rate</description>\n" +
" <config-property-name>ConsumerMaxRate</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The confirmation window size</description>\n" +
" <config-property-name>ConfirmationWindowSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The producer max rate</description>\n" +
" <config-property-name>ProducerMaxRate</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The min large message size</description>\n" +
" <config-property-name>MinLargeMessageSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The block on acknowledge</description>\n" +
" <config-property-name>BlockOnAcknowledge</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The block on non durable send</description>\n" +
" <config-property-name>BlockOnNonDurableSend</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The block on durable send</description>\n" +
" <config-property-name>BlockOnDurableSend</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The auto group</description>\n" +
" <config-property-name>AutoGroup</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The pre acknowledge</description>\n" +
" <config-property-name>PreAcknowledge</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>The retry interval</description>\n" +
" <config-property-name>RetryInterval</config-property-name>\n" +
- " <config-property-type>java.lang.Long</config-property-type>\n" +
+ " <config-property-type>long</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
@@ -246,19 +246,19 @@
" <config-property>\n" +
" <description>use global pools for client</description>\n" +
" <config-property-name>UseGlobalPools</config-property-name>\n" +
- " <config-property-type>java.lang.Boolean</config-property-type>\n" +
+ " <config-property-type>boolean</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>max number of threads for scheduled threrad pool</description>\n" +
" <config-property-name>ScheduledThreadPoolMaxSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
" <description>max number of threads in pool</description>\n" +
" <config-property-name>ThreadPoolMaxSize</config-property-name>\n" +
- " <config-property-type>java.lang.Integer</config-property-type>\n" +
+ " <config-property-type>int</config-property-type>\n" +
" <config-property-value></config-property-value>\n" +
" </config-property>\n" +
" <config-property>\n" +
@@ -325,7 +325,7 @@
System.out.println("configPropertyName = " + configPropertyName);
Method setter = methodList.remove("set" + configPropertyName);
assertNotNull("setter " + configPropertyName + " does not exist", setter);
- Class c = setter.getParameterTypes()[0];
+ Class c = lookupType(setter);
elementsByTagName = el.getElementsByTagName("config-property-type");
assertEquals("setter " + configPropertyName + " has no type set", elementsByTagName.getLength(), 1);
Node configPropertyTypeNode = elementsByTagName.item(0);
@@ -341,7 +341,7 @@
newConfig.append("\" <config-property>\" + \n");
newConfig.append("\" <description>***add***</description>\" + \n");
newConfig.append("\" <config-property-name>").append(method.getName().substring(3)).append("</config-property-name>\" + \n");
- newConfig.append("\" <config-property-type>").append(method.getParameterTypes()[0].getName()).append("</config-property-type>\" + \n");
+ newConfig.append("\" <config-property-type>").append(lookupType(method).getName()).append("</config-property-type>\" + \n");
newConfig.append("\" <config-property-value></config-property-value>\" + \n");
newConfig.append("\" </config-property>\" + \n");
}
@@ -353,4 +353,30 @@
System.out.println(commentedOutConfigs);
}
}
+
+ /**
+ * @param setter
+ * @return
+ */
+ private Class<?> lookupType(Method setter)
+ {
+ Class<?> clzz = setter.getParameterTypes()[0];
+
+ if (clzz == Boolean.class)
+ {
+ return Boolean.TYPE;
+ }
+ else if (clzz == Long.class)
+ {
+ return Long.TYPE;
+ }
+ else if (clzz == Integer.class)
+ {
+ return Integer.TYPE;
+ }
+ else
+ {
+ return clzz;
+ }
+ }
}
12 years, 4 months
JBoss hornetq SVN: r11910 - in branches/Branch_2_2_EAP/src: config/jboss-as-4/non-clustered and 1 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-12-16 06:28:44 -0500 (Fri, 16 Dec 2011)
New Revision: 11910
Modified:
branches/Branch_2_2_EAP/src/config/jboss-as-4/clustered/ra.xml
branches/Branch_2_2_EAP/src/config/jboss-as-4/non-clustered/ra.xml
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java
branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java
Log:
https://issues.jboss.org/browse/JBPAPP-5791 - changed primitives to objects on resource adapter
Modified: branches/Branch_2_2_EAP/src/config/jboss-as-4/clustered/ra.xml
===================================================================
--- branches/Branch_2_2_EAP/src/config/jboss-as-4/clustered/ra.xml 2011-12-14 02:53:36 UTC (rev 11909)
+++ branches/Branch_2_2_EAP/src/config/jboss-as-4/clustered/ra.xml 2011-12-16 11:28:44 UTC (rev 11910)
@@ -271,19 +271,19 @@
<config-property>
<description>whether to use jndi for looking up destinations etc</description>
<config-property-name>UseJNDI</config-property-name>
- <config-property-type>boolean</config-property-type>
+ <config-property-type>java.lang.Boolean</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>how long in milliseconds to wait before retry on failed MDB setup</description>
<config-property-name>SetupInterval</config-property-name>
- <config-property-type>long</config-property-type>
+ <config-property-type>java.lang.Long</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
<description>How many attempts should be made when connecting the MDB</description>
<config-property-name>SetupAttempts</config-property-name>
- <config-property-type>int</config-property-type>
+ <config-property-type>java.lang.Integer</config-property-type>
<config-property-value></config-property-value>
</config-property>-->
Modified: branches/Branch_2_2_EAP/src/config/jboss-as-4/non-clustered/ra.xml
===================================================================
--- branches/Branch_2_2_EAP/src/config/jboss-as-4/non-clustered/ra.xml 2011-12-14 02:53:36 UTC (rev 11909)
+++ branches/Branch_2_2_EAP/src/config/jboss-as-4/non-clustered/ra.xml 2011-12-16 11:28:44 UTC (rev 11910)
@@ -271,7 +271,7 @@
<config-property>
<description>whether to use jndi for looking up destinations etc</description>
<config-property-name>UseJNDI</config-property-name>
- <config-property-type>boolean</config-property-type>
+ <config-property-type>java.lang.Boolean</config-property-type>
<config-property-value></config-property-value>
</config-property>
<config-property>
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java 2011-12-14 02:53:36 UTC (rev 11909)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQRAProperties.java 2011-12-16 11:28:44 UTC (rev 11910)
@@ -143,7 +143,7 @@
/**
* @param value the useJNDI to set
*/
- public void setUseJNDI(final boolean value)
+ public void setUseJNDI(final Boolean value)
{
useJNDI = value;
}
@@ -216,7 +216,7 @@
return setupAttempts;
}
- public void setSetupAttempts(int setupAttempts)
+ public void setSetupAttempts(Integer setupAttempts)
{
this.setupAttempts = setupAttempts;
}
@@ -226,7 +226,7 @@
return setupInterval;
}
- public void setSetupInterval(long setupInterval)
+ public void setSetupInterval(Long setupInterval)
{
this.setupInterval = setupInterval;
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-12-14 02:53:36 UTC (rev 11909)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-12-16 11:28:44 UTC (rev 11910)
@@ -1097,7 +1097,7 @@
/**
* @param value the useJNDI to set
*/
- public void setUseJNDI(final boolean value)
+ public void setUseJNDI(final Boolean value)
{
raProperties.setUseJNDI(value);
}
@@ -1190,7 +1190,7 @@
return raProperties.getSetupAttempts();
}
- public void setSetupAttempts(int setupAttempts)
+ public void setSetupAttempts(Integer setupAttempts)
{
if (HornetQResourceAdapter.trace)
{
@@ -1208,7 +1208,7 @@
return raProperties.getSetupInterval();
}
- public void setSetupInterval(long interval)
+ public void setSetupInterval(Long interval)
{
if (HornetQResourceAdapter.trace)
{
12 years, 4 months
JBoss hornetq SVN: r11909 - trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-12-13 21:53:36 -0500 (Tue, 13 Dec 2011)
New Revision: 11909
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
remove extra empty lines and incorrect code indentation
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-12-14 02:50:52 UTC (rev 11908)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-12-14 02:53:36 UTC (rev 11909)
@@ -359,7 +359,7 @@
this.manager = manager;
}
- public void start() throws Exception
+ public void start() throws Exception
{
synchronized (this)
{
@@ -368,7 +368,6 @@
return;
}
-
started = true;
if (!backup)
@@ -376,7 +375,6 @@
activate();
}
}
-
}
public void flushExecutor()
@@ -436,7 +434,6 @@
managementService.sendNotification(notification);
}
-
if (backupServerLocator != null)
{
backupServerLocator.close();
@@ -615,8 +612,6 @@
backupServerLocator = null;
}
-
-
serverLocator = clusterConnector.createServerLocator(true);
if (serverLocator != null)
12 years, 4 months
JBoss hornetq SVN: r11908 - trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-12-13 21:50:52 -0500 (Tue, 13 Dec 2011)
New Revision: 11908
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
remove unreachable code.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-12-13 19:32:09 UTC (rev 11907)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-12-14 02:50:52 UTC (rev 11908)
@@ -336,7 +336,7 @@
{
if (started)
{
- log.debug("Server already started!");
+ log.info("Server already started! Ignoring the call to start.");
return;
}
@@ -355,12 +355,6 @@
nodeManager.start();
- if (started)
- {
- HornetQServerImpl.log.info((configuration.isBackup() ? "backup" : "live") + " is already started, ignoring the call to start..");
- return;
- }
-
HornetQServerImpl.log.info((configuration.isBackup() ? "backup" : "live") + " server is starting with configuration " +
configuration);
12 years, 4 months
JBoss hornetq SVN: r11907 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/journal/impl and 3 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-13 14:32:09 -0500 (Tue, 13 Dec 2011)
New Revision: 11907
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PagingStore.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java
Log:
Just adding logging to print-data/print-pages (no semantic changes on this commit)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java 2011-12-13 18:40:00 UTC (rev 11906)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java 2011-12-13 19:32:09 UTC (rev 11907)
@@ -63,6 +63,8 @@
int getAlignment();
int calculateBlockSize(int bytes);
+
+ String getDirectory();
void clearBuffer(ByteBuffer buffer);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2011-12-13 18:40:00 UTC (rev 11906)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2011-12-13 19:32:09 UTC (rev 11907)
@@ -111,6 +111,11 @@
}
}
}
+
+ public String getDirectory()
+ {
+ return journalDir;
+ }
public void start()
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PagingStore.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PagingStore.java 2011-12-13 18:40:00 UTC (rev 11906)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PagingStore.java 2011-12-13 19:32:09 UTC (rev 11907)
@@ -43,6 +43,8 @@
int getCurrentWritingPage();
SimpleString getStoreName();
+
+ String getFolder();
AddressFullMessagePolicy getAddressFullMessagePolicy();
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java 2011-12-13 18:40:00 UTC (rev 11906)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/PrintPages.java 2011-12-13 19:32:09 UTC (rev 11907)
@@ -105,9 +105,15 @@
for (SimpleString store : stores)
{
+ PagingStore pgStore = manager.getPageStore(store);
+ String folder = null;
+
+ if (pgStore != null)
+ {
+ folder = pgStore.getFolder();
+ }
System.out.println("####################################################################################################");
- System.out.println("Exploring store " + store);
- PagingStore pgStore = manager.getPageStore(store);
+ System.out.println("Exploring store " + store + " folder = " + folder);
int pgid = (int)pgStore.getFirstPage();
for (int pg = 0; pg < pgStore.getNumberOfPages(); pg++)
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2011-12-13 18:40:00 UTC (rev 11906)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2011-12-13 19:32:09 UTC (rev 11907)
@@ -269,6 +269,19 @@
{
return pageSize;
}
+
+ public String getFolder()
+ {
+ SequentialFileFactory factoryUsed = this.fileFactory;
+ if (factoryUsed != null)
+ {
+ return factoryUsed.getDirectory();
+ }
+ else
+ {
+ return null;
+ }
+ }
public boolean isPaging()
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java 2011-12-13 18:40:00 UTC (rev 11906)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java 2011-12-13 19:32:09 UTC (rev 11907)
@@ -779,4 +779,13 @@
{
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.journal.SequentialFileFactory#getDirectory()
+ */
+ public String getDirectory()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
12 years, 4 months
JBoss hornetq SVN: r11906 - branches/Branch_2_2_EAP/docs/user-manual/en.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-13 13:40:00 -0500 (Tue, 13 Dec 2011)
New Revision: 11906
Modified:
branches/Branch_2_2_EAP/docs/user-manual/en/configuration-index.xml
branches/Branch_2_2_EAP/docs/user-manual/en/paging.xml
Log:
JBPAPP-7655 - my doc changes proposal
Modified: branches/Branch_2_2_EAP/docs/user-manual/en/configuration-index.xml
===================================================================
--- branches/Branch_2_2_EAP/docs/user-manual/en/configuration-index.xml 2011-12-13 18:18:34 UTC (rev 11905)
+++ branches/Branch_2_2_EAP/docs/user-manual/en/configuration-index.xml 2011-12-13 18:40:00 UTC (rev 11906)
@@ -319,6 +319,13 @@
<entry>data/paging</entry>
</row>
<row>
+ <entry><link linkend="paging.main.config"
+ >page-max-concurrent-io</link></entry>
+ <entry>integer</entry>
+ <entry>The maximum number of concurrent reads the system will do on the paging files</entry>
+ <entry>5</entry>
+ </row>
+ <row>
<entry><link linkend="configuring.delivery.count.persistence">
persist-delivery-count-before-delivery</link></entry>
<entry>Boolean</entry>
Modified: branches/Branch_2_2_EAP/docs/user-manual/en/paging.xml
===================================================================
--- branches/Branch_2_2_EAP/docs/user-manual/en/paging.xml 2011-12-13 18:18:34 UTC (rev 11905)
+++ branches/Branch_2_2_EAP/docs/user-manual/en/paging.xml 2011-12-13 18:40:00 UTC (rev 11906)
@@ -52,6 +52,7 @@
...
<paging-directory>/somewhere/paging-directory</paging-directory>
+ <page-max-concurrent-io>/5</paging-directory>
... </programlisting>
<para>
@@ -75,6 +76,12 @@
each address being paged under this configured location.</entry>
<entry>data/paging</entry>
</row>
+ <row>
+ <entry><literal>page-max-concurrent-io</literal></entry>
+ <entry>The maximum number of concurrent reads the system can make on paged files. You may increase this parameter depending on
+ the expected number of paged destinations and the limits you have on your disk</entry>
+ <entry>5</entry>
+ </row>
</tbody>
</tgroup>
</table>
12 years, 4 months
JBoss hornetq SVN: r11905 - branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/config/common/schema.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-13 13:18:34 -0500 (Tue, 13 Dec 2011)
New Revision: 11905
Modified:
branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/config/common/schema/hornetq-configuration.xsd
Log:
JBPAPP-7655 - small tweak on ordering at the xsd
Modified: branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/config/common/schema/hornetq-configuration.xsd 2011-12-13 17:49:57 UTC (rev 11904)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/config/common/schema/hornetq-configuration.xsd 2011-12-13 18:18:34 UTC (rev 11905)
@@ -140,14 +140,14 @@
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="grouping-handler" type="groupingHandlerType">
</xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0" name="page-max-concurrent-io" type="xsd:string">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="paging-directory" type="xsd:string">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="bindings-directory" type="xsd:string">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="create-bindings-dir" type="xsd:boolean">
</xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="page-max-concurrent-io" type="xsd:string">
- </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="journal-directory" type="xsd:string">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="create-journal-dir" type="xsd:boolean">
12 years, 4 months
JBoss hornetq SVN: r11904 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/config and 12 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-13 12:49:57 -0500 (Tue, 13 Dec 2011)
New Revision: 11904
Modified:
branches/Branch_2_2_EAP/src/config/common/schema/hornetq-configuration.xsd
branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/Configuration.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFileFactory.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/StorageManager.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
branches/Branch_2_2_EAP/tests/config/ConfigurationTest-full-config.xml
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
Log:
JBPAPP-7655 - adding max IO options for paging, changing memory allocation if using AIO (native layer) since the JDK is unreliable on allocating direct buffers (related to when they are GCed)
Modified: branches/Branch_2_2_EAP/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- branches/Branch_2_2_EAP/src/config/common/schema/hornetq-configuration.xsd 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/config/common/schema/hornetq-configuration.xsd 2011-12-13 17:49:57 UTC (rev 11904)
@@ -146,6 +146,8 @@
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="create-bindings-dir" type="xsd:boolean">
</xsd:element>
+ <xsd:element maxOccurs="1" minOccurs="0" name="page-max-concurrent-io" type="xsd:string">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="journal-directory" type="xsd:string">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="0" name="create-journal-dir" type="xsd:boolean">
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/Configuration.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/Configuration.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/Configuration.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -473,6 +473,15 @@
* Sets the file system directory used to store bindings.
*/
void setBindingsDirectory(String dir);
+
+ /** The max number of concurrent reads allowed on paging.
+ *
+ * Default = 5 */
+ int getPageMaxConcurrentIO();
+
+ /** The max number of concurrent reads allowed on paging.
+ * Default = 5 */
+ void setPageMaxConcurrentIO(int maxIO);
/**
* Returns the file system directory used to store journal log.
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -89,6 +89,8 @@
public static final String DEFAULT_PAGING_DIR = "data/paging";
public static final String DEFAULT_LARGE_MESSAGES_DIR = "data/largemessages";
+
+ public static final int DEFAULT_MAX_CONCURRENT_PAGE_IO = 5;
public static final boolean DEFAULT_CREATE_JOURNAL_DIR = true;
@@ -266,6 +268,8 @@
protected String pagingDirectory = ConfigurationImpl.DEFAULT_PAGING_DIR;
// File related attributes -----------------------------------------------------------
+
+ protected int maxConcurrentPageIO = ConfigurationImpl.DEFAULT_MAX_CONCURRENT_PAGE_IO;
protected String largeMessagesDirectory = ConfigurationImpl.DEFAULT_LARGE_MESSAGES_DIR;
@@ -624,7 +628,25 @@
{
bindingsDirectory = dir;
}
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.config.Configuration#getPageMaxConcurrentIO()
+ */
+ public int getPageMaxConcurrentIO()
+ {
+ return maxConcurrentPageIO;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.config.Configuration#setPageMaxConcurrentIO(int)
+ */
+ public void setPageMaxConcurrentIO(int maxIO)
+ {
+ this.maxConcurrentPageIO = maxIO;
+ }
+
+
public String getJournalDirectory()
{
return journalDirectory;
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -424,6 +424,12 @@
"journal-directory",
config.getJournalDirectory(),
Validators.NOT_NULL_OR_EMPTY));
+
+
+ config.setPageMaxConcurrentIO(XMLConfigurationUtil.getInteger(e,
+ "page-max-concurrent-io",
+ 5,
+ Validators.MINUS_ONE_OR_GT_ZERO));
config.setPagingDirectory(XMLConfigurationUtil.getString(e,
"paging-directory",
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/SequentialFileFactory.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -35,6 +35,14 @@
/** The SequentialFile will call this method when a disk IO Error happens during the live phase. */
void onIOError(int errorCode, String message, SequentialFile file);
+ /** used for cases where you need direct buffer outside of the journal context.
+ * This is because the native layer has a method that can be reused in certain cases like paging */
+ ByteBuffer allocateDirectBuffer(int size);
+
+ /** used for cases where you need direct buffer outside of the journal context.
+ * This is because the native layer has a method that can be reused in certain cases like paging */
+ void releaseDirectBuffer(ByteBuffer buffer);
+
/**
* Note: You need to release the buffer if is used for reading operations.
* You don't need to do it if using writing operations (AIO Buffer Lister will take of writing operations)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -113,7 +113,29 @@
{
return AsynchronousFileImpl.isLoaded();
}
+
+ public ByteBuffer allocateDirectBuffer(final int size)
+ {
+
+ int blocks = size / 512;
+ if (size % 512 != 0)
+ {
+ blocks ++;
+ }
+
+ // The buffer on AIO has to be a multiple of 512
+ ByteBuffer buffer = AsynchronousFileImpl.newBuffer(blocks * 512);
+
+ buffer.limit(size);
+ return buffer;
+ }
+
+ public void releaseDirectBuffer(final ByteBuffer buffer)
+ {
+ AsynchronousFileImpl.destroyBuffer(buffer);
+ }
+
public ByteBuffer newBuffer(int size)
{
if (size % 512 != 0)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFileFactory.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/journal/impl/NIOSequentialFileFactory.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -99,6 +99,17 @@
{
return timedBuffer != null;
}
+
+
+ public ByteBuffer allocateDirectBuffer(final int size)
+ {
+ return ByteBuffer.allocateDirect(size);
+ }
+
+ public void releaseDirectBuffer(ByteBuffer buffer)
+ {
+ // nothing we can do on this case. we can just have good faith on GC
+ }
public ByteBuffer newBuffer(final int size)
{
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -183,6 +183,7 @@
{
page = pagingStore.createPage((int)pageId);
+ storageManager.beforePageRead();
page.open();
List<PagedMessage> pgdMessages = page.read(storageManager);
@@ -200,6 +201,7 @@
catch (Throwable ignored)
{
}
+ storageManager.afterPageRead();
cache.unlock();
}
}
@@ -455,8 +457,26 @@
// The page is not on cache any more
// We need to read the page-file before deleting it
// to make sure we remove any large-messages pending
- depagedPage.open();
- List<PagedMessage> pgdMessagesList = depagedPage.read(storageManager);
+ storageManager.beforePageRead();
+
+ List<PagedMessage> pgdMessagesList = null;
+ try
+ {
+ depagedPage.open();
+ pgdMessagesList = depagedPage.read(storageManager);
+ }
+ finally
+ {
+ try
+ {
+ depagedPage.close();
+ }
+ catch (Exception e)
+ {
+ }
+
+ storageManager.afterPageRead();
+ }
depagedPage.close();
pgdMessages = pgdMessagesList.toArray(new PagedMessage[pgdMessagesList.size()]);
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -1290,7 +1290,11 @@
public void remove()
{
deliveredCount.incrementAndGet();
- PageSubscriptionImpl.this.getPageInfo(position).remove(position);
+ PageCursorInfo info = PageSubscriptionImpl.this.getPageInfo(position);
+ if (info != null)
+ {
+ info.remove(position);
+ }
}
/* (non-Javadoc)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/StorageManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/StorageManager.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/StorageManager.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -13,6 +13,7 @@
package org.hornetq.core.persistence;
+import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -96,6 +97,34 @@
* in case of the pools are full
* @throws Exception */
void waitOnOperations() throws Exception;
+
+ /**
+ * We need a safeguard in place to avoid too much concurrent IO happening on Paging,
+ * otherwise the system may become irrensponsive if too many destinations are reading all the same time.
+ * This is called before we read, so we can limit concurrent reads
+ * @throws Exception
+ */
+ void beforePageRead() throws Exception;
+
+ /**
+ * We need a safeguard in place to avoid too much concurrent IO happening on Paging,
+ * otherwise the system may become irrensponsive if too many destinations are reading all the same time.
+ * This is called after we read, so we can limit concurrent reads
+ * @throws Exception
+ */
+ void afterPageRead() throws Exception;
+
+
+ /** AIO has an optimized buffer which has a method to release it
+ instead of the way NIO will release data based on GC.
+ These methods will use that buffer if the inner method supports it */
+ ByteBuffer allocateDirectBuffer(int size);
+
+ /** AIO has an optimized buffer which has a method to release it
+ instead of the way NIO will release data based on GC.
+ These methods will use that buffer if the inner method supports it */
+ void freeDirectuffer(ByteBuffer buffer);
+
void clearContext();
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -6,7 +6,9 @@
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
+ private final Semaphore pageMaxConcurrentIO;
+, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
@@ -31,6 +33,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.Semaphore;
import javax.transaction.xa.Xid;
@@ -157,6 +160,8 @@
public static final byte PAGE_CURSOR_COUNTER_VALUE = 40;
public static final byte PAGE_CURSOR_COUNTER_INC = 41;
+
+ private final Semaphore pageMaxConcurrentIO;
private final BatchingIDGenerator idGenerator;
@@ -167,6 +172,8 @@
private final Journal bindingsJournal;
private final SequentialFileFactory largeMessagesFactory;
+
+ private SequentialFileFactory journalFF = null;
private volatile boolean started;
@@ -270,8 +277,6 @@
syncTransactional = config.isJournalSyncTransactional();
- SequentialFileFactory journalFF = null;
-
if (config.getJournalType() == JournalType.ASYNCIO)
{
JournalStorageManager.log.info("Using AIO Journal");
@@ -329,6 +334,15 @@
largeMessagesFactory = new NIOSequentialFileFactory(largeMessagesDirectory, false, criticalErrorListener);
perfBlastPages = config.getJournalPerfBlastPages();
+
+ if (config.getPageMaxConcurrentIO() != 1)
+ {
+ pageMaxConcurrentIO = new Semaphore(config.getPageMaxConcurrentIO());
+ }
+ else
+ {
+ pageMaxConcurrentIO = null;
+ }
}
public void clearContext()
@@ -1598,6 +1612,45 @@
return info;
}
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#startPageRead()
+ */
+ public void beforePageRead() throws Exception
+ {
+ if (pageMaxConcurrentIO != null)
+ {
+ pageMaxConcurrentIO.acquire();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#finishPageRead()
+ */
+ public void afterPageRead() throws Exception
+ {
+ if (pageMaxConcurrentIO != null)
+ {
+ pageMaxConcurrentIO.release();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#allocateDirectBuffer(long)
+ */
+ public ByteBuffer allocateDirectBuffer(int size)
+ {
+ return journalFF.allocateDirectBuffer(size);
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#freeDirectuffer(java.nio.ByteBuffer)
+ */
+ public void freeDirectuffer(ByteBuffer buffer)
+ {
+ journalFF.releaseBuffer(buffer);
+ }
+
// Public -----------------------------------------------------------------------------------
public Journal getMessageJournal()
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -13,6 +13,7 @@
package org.hornetq.core.persistence.impl.nullpm;
+import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -591,4 +592,34 @@
{
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#beforePageRead()
+ */
+ public void beforePageRead() throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#afterPageRead()
+ */
+ public void afterPageRead() throws Exception
+ {
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#allocateDirectBuffer(int)
+ */
+ public ByteBuffer allocateDirectBuffer(int size)
+ {
+ return ByteBuffer.allocateDirect(size);
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#freeDirectuffer(java.nio.ByteBuffer)
+ */
+ public void freeDirectuffer(ByteBuffer buffer)
+ {
+ // We can just have hope on GC here :-)
+ }
+
}
Modified: branches/Branch_2_2_EAP/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- branches/Branch_2_2_EAP/tests/config/ConfigurationTest-full-config.xml 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/tests/config/ConfigurationTest-full-config.xml 2011-12-13 17:49:57 UTC (rev 11904)
@@ -36,6 +36,7 @@
<create-bindings-dir>false</create-bindings-dir>
<journal-directory>somedir2</journal-directory>
<create-journal-dir>false</create-journal-dir>
+ <page-max-concurrent-io>17</page-max-concurrent-io>
<journal-type>NIO</journal-type>
<journal-compact-min-files>123</journal-compact-min-files>
<journal-compact-percentage>33</journal-compact-percentage>
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -70,6 +70,8 @@
Assert.assertEquals("pagingdir", conf.getPagingDirectory());
Assert.assertEquals("somedir", conf.getBindingsDirectory());
Assert.assertEquals(false, conf.isCreateBindingsDir());
+
+ Assert.assertEquals(17, conf.getPageMaxConcurrentIO());
Assert.assertEquals("somedir2", conf.getJournalDirectory());
Assert.assertEquals(false, conf.isCreateJournalDir());
Assert.assertEquals(JournalType.NIO, conf.getJournalType());
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/journal/impl/fakes/FakeSequentialFileFactory.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -764,4 +764,19 @@
{
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.journal.SequentialFileFactory#newDirectBuffer(int)
+ */
+ public ByteBuffer allocateDirectBuffer(int size)
+ {
+ return ByteBuffer.allocateDirect(size);
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.journal.SequentialFileFactory#releaseDirectBuffer(java.nio.ByteBuffer)
+ */
+ public void releaseDirectBuffer(ByteBuffer buffer)
+ {
+ }
+
}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2011-12-13 17:25:49 UTC (rev 11903)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2011-12-13 17:49:57 UTC (rev 11904)
@@ -13,6 +13,7 @@
package org.hornetq.tests.unit.core.paging.impl;
+import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -1706,6 +1707,42 @@
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#beforePageRead()
+ */
+ public void beforePageRead() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#afterPageRead()
+ */
+ public void afterPageRead() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#allocateDirectBuffer(int)
+ */
+ public ByteBuffer allocateDirectBuffer(int size)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#freeDirectuffer(java.nio.ByteBuffer)
+ */
+ public void freeDirectuffer(ByteBuffer buffer)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
class FakeStoreFactory implements PagingStoreFactory
@@ -1783,6 +1820,41 @@
{
}
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#startPageRead()
+ */
+ public void beforePageRead() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#finishPageRead()
+ */
+ public void afterPageRead() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#allocateDirectBuffer(int)
+ */
+ public ByteBuffer allocateDirectBuffer(int size)
+ {
+ return ByteBuffer.allocateDirect(size);
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.persistence.StorageManager#freeDirectuffer(java.nio.ByteBuffer)
+ */
+ public void freeDirectuffer(ByteBuffer buffer)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
}
12 years, 4 months
JBoss hornetq SVN: r11903 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-12-13 12:25:49 -0500 (Tue, 13 Dec 2011)
New Revision: 11903
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
JBPAPP-7727 - Fixing possible NPE
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-12-13 17:04:05 UTC (rev 11902)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-12-13 17:25:49 UTC (rev 11903)
@@ -671,9 +671,10 @@
}
else
{
- if (connection != null)
+ CoreRemotingConnection connectionToDestory = connection;
+ if (connectionToDestory != null)
{
- connection.destroy();
+ connectionToDestory.destroy();
}
connection = null;
12 years, 4 months