|
|
|
@ -982,12 +982,50 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
|
", " + robots.size() + " entries" +
|
|
|
|
|
", " + 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
|
|
|
|
|
log.logConfig("Starting Indexing Management");
|
|
|
|
|
wordIndex = new plasmaWordIndex(indexPath, ramRWI_time, log);
|
|
|
|
|
noticeURL = new plasmaCrawlNURL(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
|
|
|
|
|
int wordCacheMaxCount = Math.max((int) getConfigLong(WORDCACHE_INIT_COUNT, 30000),
|
|
|
|
|
(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);
|
|
|
|
|
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
|
|
|
|
|
log.logConfig("Starting Parser");
|
|
|
|
|
this.parser = new plasmaParser();
|
|
|
|
@ -1088,26 +1108,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
|
new Object(),
|
|
|
|
|
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
|
|
|
|
|
this.log.logConfig("Starting Cookie Monitor");
|
|
|
|
|
this.outgoingCookies = new HashMap();
|
|
|
|
|