Author: j16sdiz
Date: 2009-03-18 05:15:16 +0000 (Wed, 18 Mar 2009)
New Revision: 26085

Modified:
   trunk/plugins/XMLSpider/db/Config.java
   trunk/plugins/XMLSpider/web/ConfigPage.java
Log:
Make subindex max size and entries configable

Modified: trunk/plugins/XMLSpider/db/Config.java
===================================================================
--- trunk/plugins/XMLSpider/db/Config.java      2009-03-18 02:50:21 UTC (rev 
26084)
+++ trunk/plugins/XMLSpider/db/Config.java      2009-03-18 05:15:16 UTC (rev 
26085)
@@ -14,7 +14,7 @@
         */
        private String indexDir;
        private int indexMaxEntries;
-       private long indexSubindexMaxSize;
+       private int indexSubindexMaxSize;
 
        private String indexTitle;
        private String indexOwner;
@@ -87,12 +87,12 @@
                return indexMaxEntries;
        }
 
-       public synchronized void setIndexSubindexMaxSize(long 
indexSubindexMaxSize) {
+       public synchronized void setIndexSubindexMaxSize(int 
indexSubindexMaxSize) {
                assert !isPersistent();
                this.indexSubindexMaxSize = indexSubindexMaxSize;
        }
 
-       public synchronized long getIndexSubindexMaxSize() {
+       public synchronized int getIndexSubindexMaxSize() {
                return indexSubindexMaxSize;
        }
 

Modified: trunk/plugins/XMLSpider/web/ConfigPage.java
===================================================================
--- trunk/plugins/XMLSpider/web/ConfigPage.java 2009-03-18 02:50:21 UTC (rev 
26084)
+++ trunk/plugins/XMLSpider/web/ConfigPage.java 2009-03-18 05:15:16 UTC (rev 
26085)
@@ -38,6 +38,14 @@
                        int v = request.getIntPart("maxParallelRequests", 
config.getMaxParallelRequests());
                        config.setMaxParallelRequests(v);
                }
+               if (request.isPartSet("indexMaxEntries")) {
+                       int v = request.getIntPart("indexMaxEntries", 
config.getIndexMaxEntries());
+                       config.setIndexMaxEntries(v);
+               }
+               if (request.isPartSet("indexSubindexMaxSize")) {
+                       int v = request.getIntPart("indexSubindexMaxSize", 
config.getIndexSubindexMaxSize() / 1024 / 1024);
+                       config.setIndexSubindexMaxSize(v * 1024 * 1024);
+               }
                if (request.isPartSet("badListedExtensions")) {
                        String v = 
request.getPartAsString("badListedExtensions", 512);
                        String[] v0 = v.split(",");
@@ -118,6 +126,16 @@
                        "Index Owner Email", "Index Owner Email", // 
                        "indexOwnerEmail", config.getIndexOwnerEmail());
                addConfig(indexConfig, //
+                       "Maximum Subindex Entries", "Maximum number of entries 
in each index.", // 
+                       "indexMaxEntries", //
+                       new String[] { "500", "1000", "2000", "4000", "8000" }, 
//
+                       Integer.toString(config.getIndexMaxEntries()));
+               addConfig(indexConfig, //
+                       "Maximum Subindex Size", "Maximum size of a subindex 
(MiB).", // 
+                       "indexSubindexMaxSize", //
+                       new String[] { "1", "2", "4", "8" }, //
+                       Integer.toString(config.getIndexSubindexMaxSize() / 
1024 / 1024));
+               addConfig(indexConfig, //
                        "Write debug info", "Write debug info", // 
                        "debug", //
                        new String[] { "false", "true" }, //

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to