changed startup initialization sequence slightly

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3446 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 4f2e6ef47b
commit 33f97cff7a

@ -982,12 +982,50 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
", " + robots.size() + " entries" + ", " + robots.size() + " entries" +
", " + ppRamString(robotsDBFile.length()/1024)); ", " + ppRamString(robotsDBFile.length()/1024));
// start a cache manager
log.logConfig("Starting HT Cache Manager");
// create the cache directory
String cache = getConfig(HTCACHE_PATH, HTCACHE_PATH_DEFAULT);
cache = cache.replace('\\', '/');
if (cache.endsWith("/")) { cache = cache.substring(0, cache.length() - 1); }
if (new File(cache).isAbsolute()) {
htCachePath = new File(cache); // don't use rootPath
} else {
htCachePath = new File(rootPath, cache);
}
this.log.logInfo("HTCACHE Path = " + htCachePath.getAbsolutePath());
long maxCacheSize = 1024 * 1024 * Long.parseLong(getConfig(PROXY_CACHE_SIZE, "2")); // this is megabyte
String cacheLayout = getConfig(PROXY_CACHE_LAYOUT, PROXY_CACHE_LAYOUT_TREE);
boolean cacheMigration = getConfigBool(PROXY_CACHE_MIGRATION, true);
this.cacheManager = new plasmaHTCache(htCachePath, maxCacheSize, ramHTTP_time, cacheLayout, cacheMigration);
// starting message board
initMessages(ramMessage_time);
// starting wiki
initWiki(ramWiki_time);
//starting blog
initBlog(ramBlog_time);
// Init User DB
this.log.logConfig("Loading User DB");
File userDbFile = new File(getRootPath(), DBFILE_USER);
this.userDB = new userDB(userDbFile, 2000);
this.log.logConfig("Loaded User DB from file " + userDbFile.getName() +
", " + this.userDB.size() + " entries" +
", " + ppRamString(userDbFile.length()/1024));
//Init bookmarks DB
initBookmarks();
// start indexing management // start indexing management
log.logConfig("Starting Indexing Management"); log.logConfig("Starting Indexing Management");
wordIndex = new plasmaWordIndex(indexPath, ramRWI_time, log);
noticeURL = new plasmaCrawlNURL(plasmaPath, -1); noticeURL = new plasmaCrawlNURL(plasmaPath, -1);
errorURL = new plasmaCrawlEURL(plasmaPath, -1); errorURL = new plasmaCrawlEURL(plasmaPath, -1);
wordIndex = new plasmaWordIndex(indexPath, ramRWI_time, log);
// set a high maximum cache size to current size; this is adopted later automatically // set a high maximum cache size to current size; this is adopted later automatically
int wordCacheMaxCount = Math.max((int) getConfigLong(WORDCACHE_INIT_COUNT, 30000), int wordCacheMaxCount = Math.max((int) getConfigLong(WORDCACHE_INIT_COUNT, 30000),
(int) getConfigLong(WORDCACHE_MAX_COUNT, 20000)); (int) getConfigLong(WORDCACHE_MAX_COUNT, 20000));
@ -1004,24 +1042,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
kelondroRecords.setCacheGrowStati(memprereq + (memprereq / 8) + 2 * 1024 * 1024, memprereq); kelondroRecords.setCacheGrowStati(memprereq + (memprereq / 8) + 2 * 1024 * 1024, memprereq);
kelondroCache.setCacheGrowStati(memprereq + (memprereq / 8) + 2 * 1024 * 1024, memprereq); kelondroCache.setCacheGrowStati(memprereq + (memprereq / 8) + 2 * 1024 * 1024, memprereq);
// start a cache manager
log.logConfig("Starting HT Cache Manager");
// create the cache directory
String cache = getConfig(HTCACHE_PATH, HTCACHE_PATH_DEFAULT);
cache = cache.replace('\\', '/');
if (cache.endsWith("/")) { cache = cache.substring(0, cache.length() - 1); }
if (new File(cache).isAbsolute()) {
htCachePath = new File(cache); // don't use rootPath
} else {
htCachePath = new File(rootPath, cache);
}
this.log.logInfo("HTCACHE Path = " + htCachePath.getAbsolutePath());
long maxCacheSize = 1024 * 1024 * Long.parseLong(getConfig(PROXY_CACHE_SIZE, "2")); // this is megabyte
String cacheLayout = getConfig(PROXY_CACHE_LAYOUT, PROXY_CACHE_LAYOUT_TREE);
boolean cacheMigration = getConfigBool(PROXY_CACHE_MIGRATION, true);
this.cacheManager = new plasmaHTCache(htCachePath, maxCacheSize, ramHTTP_time, cacheLayout, cacheMigration);
// make parser // make parser
log.logConfig("Starting Parser"); log.logConfig("Starting Parser");
this.parser = new plasmaParser(); this.parser = new plasmaParser();
@ -1088,26 +1108,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
new Object(), new Object(),
Boolean.valueOf(getConfig(CRAWLJOB_GLOBAL_CRAWL_TRIGGER + "_isPaused", "false"))}); Boolean.valueOf(getConfig(CRAWLJOB_GLOBAL_CRAWL_TRIGGER + "_isPaused", "false"))});
// starting board
initMessages(ramMessage_time);
// starting wiki
initWiki(ramWiki_time);
//starting blog
initBlog(ramBlog_time);
// Init User DB
this.log.logConfig("Loading User DB");
File userDbFile = new File(getRootPath(), DBFILE_USER);
this.userDB = new userDB(userDbFile, 2000);
this.log.logConfig("Loaded User DB from file " + userDbFile.getName() +
", " + this.userDB.size() + " entries" +
", " + ppRamString(userDbFile.length()/1024));
//Init bookmarks DB
initBookmarks();
// init cookie-Monitor // init cookie-Monitor
this.log.logConfig("Starting Cookie Monitor"); this.log.logConfig("Starting Cookie Monitor");
this.outgoingCookies = new HashMap(); this.outgoingCookies = new HashMap();

Loading…
Cancel
Save