[hornetq-commits] JBoss hornetq SVN: r11900 - in branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710: src/main/org/hornetq/core/config and 5 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Dec 12 17:30:39 EST 2011


Author: clebert.suconic at jboss.com
Date: 2011-12-12 17:30:38 -0500 (Mon, 12 Dec 2011)
New Revision: 11900

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/main/org/hornetq/core/config/Configuration.java
   branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
   branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
   branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
   branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/config/ConfigurationTest-full-config.xml
   branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
Log:
JBPAPP-7655 - The customer is facing an issue that's directly related to the way concurrent paging will happen, and multiple pages being accessed. We are adding a direct allocation on Paging (and releasing it manually what is causing issues with NIO), and we are also dealing with some max-IO on paging.. 

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-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/config/common/schema/hornetq-configuration.xsd	2011-12-12 22:30:38 UTC (rev 11900)
@@ -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/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/Configuration.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/Configuration.java	2011-12-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/Configuration.java	2011-12-12 22:30:38 UTC (rev 11900)
@@ -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/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java	2011-12-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java	2011-12-12 22:30:38 UTC (rev 11900)
@@ -88,6 +88,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;
 
@@ -255,6 +257,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;
 
@@ -613,7 +617,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/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java	2011-12-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java	2011-12-12 22:30:38 UTC (rev 11900)
@@ -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/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java	2011-12-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java	2011-12-12 22:30:38 UTC (rev 11900)
@@ -31,6 +31,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;
 
@@ -156,6 +157,8 @@
    public static final byte PAGE_CURSOR_COUNTER_INC = 41;
 
    private UUID persistentID;
+   
+   private final Semaphore pageMaxConcurrentIO;
 
    private final BatchingIDGenerator idGenerator;
 
@@ -318,6 +321,15 @@
       largeMessagesFactory = new NIOSequentialFileFactory(largeMessagesDirectory, false);
 
       perfBlastPages = config.getJournalPerfBlastPages();
+      
+      if (config.getPageMaxConcurrentIO() != 1)
+      {
+         pageMaxConcurrentIO = new Semaphore(config.getPageMaxConcurrentIO());
+      }
+      else
+      {
+         pageMaxConcurrentIO = null;
+      }
    }
 
    public void clearContext()
@@ -1538,8 +1550,10 @@
     */
    public void beforePageRead() throws Exception
    {
-      // TODO Auto-generated method stub
-      
+      if (pageMaxConcurrentIO != null)
+      {
+         pageMaxConcurrentIO.acquire();
+      }
    }
 
    /* (non-Javadoc)
@@ -1547,8 +1561,10 @@
     */
    public void afterPageRead() throws Exception
    {
-      // TODO Auto-generated method stub
-      
+      if (pageMaxConcurrentIO != null)
+      {
+         pageMaxConcurrentIO.release();
+      }
    }
 
    /* (non-Javadoc)

Modified: branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/config/ConfigurationTest-full-config.xml	2011-12-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/config/ConfigurationTest-full-config.xml	2011-12-12 22:30:38 UTC (rev 11900)
@@ -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/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java	2011-12-12 22:03:12 UTC (rev 11899)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7710/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java	2011-12-12 22:30:38 UTC (rev 11900)
@@ -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());



More information about the hornetq-commits mailing list