summaryrefslogtreecommitdiff
path: root/htroot
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2008-05-06 13:44:38 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2008-05-06 13:44:38 +0000
commitfbb712c669dc001230cbfac24065e9b91dd52c19 (patch)
treeb1f2c6c0447767c415e3e64320ed78173410589b /htroot
parentee81ff4ef434c2e0852bec3b2f882ebcff784b69 (diff)
refactoring:
moved importer classes to crawler and plasma package git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4770 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
-rw-r--r--htroot/IndexImport_p.html9
-rw-r--r--htroot/IndexImport_p.java36
-rw-r--r--htroot/WatchCrawler_p.java7
3 files changed, 15 insertions, 37 deletions
diff --git a/htroot/IndexImport_p.html b/htroot/IndexImport_p.html
index d5fc5227d..97d8eeab4 100644
--- a/htroot/IndexImport_p.html
+++ b/htroot/IndexImport_p.html
@@ -24,14 +24,7 @@
<table border="0" cellpadding="2" cellspacing="1">
<tr class="TableCellLight">
<td>Import&nbsp;Type:</td>
- <td title="the path to the database that should be imported">
- <select name="importType" size="1">
- <!-- Options not availible because of missing support for Assortment DB's
- <option value="plasmaDB">PLASMA DB Import</option>
- <option value="assortment">Assortment File Import</option>-->
- <option value="NURL">Crawling Queue Import</option>
- </select>
- </td>
+ <td title="the path to the database that should be imported"></td>
<td title="the cache size that should be used for the import db">Cache Size</td>
<td>
<select name="cacheSize" size="1">
diff --git a/htroot/IndexImport_p.java b/htroot/IndexImport_p.java
index 675c94330..46587de48 100644
--- a/htroot/IndexImport_p.java
+++ b/htroot/IndexImport_p.java
@@ -51,9 +51,10 @@
import java.io.PrintStream;
import java.util.Date;
+import de.anomic.crawler.NoticeURLImporter;
+import de.anomic.crawler.Importer;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
-import de.anomic.plasma.dbImport.dbImporter;
import de.anomic.server.serverByteBuffer;
import de.anomic.server.serverDate;
import de.anomic.server.serverObjects;
@@ -71,27 +72,12 @@ public final class IndexImport_p {
if (post != null) {
if (post.containsKey("startIndexDbImport")) {
try {
- String importType = (String) post.get("importType");
- int cacheSize = post.getInt("cacheSize", 0);
- boolean startImport = true;
-
-// // check if there is an already running thread with the same import path
-// Thread[] importThreads = new Thread[plasmaDbImporter.runningJobs.activeCount()*2];
-// activeCount = plasmaDbImporter.runningJobs.enumerate(importThreads);
-//
-// for (int i=0; i < activeCount; i++) {
-// plasmaDbImporter currThread = (plasmaDbImporter) importThreads[i];
-// if (currThread.getJobName().equals(new File(importPath))) {
-// prop.put("error",2);
-// startImport = false;
-// }
-// }
-//
-
+ boolean startImport = true;
if (startImport) {
- dbImporter importerThread = switchboard.dbImportManager.getNewImporter(importType);
+ Importer importerThread = new NoticeURLImporter(switchboard.plasmaPath, switchboard.crawlQueues, switchboard.profilesActiveCrawls, switchboard.dbImportManager);
+
if (importerThread != null) {
- importerThread.init(switchboard, cacheSize);
+ importerThread.setJobID(switchboard.dbImportManager.generateUniqueJobID());
importerThread.startIt();
}
prop.put("LOCATION","");
@@ -119,7 +105,7 @@ public final class IndexImport_p {
) {
// getting the job nr of the thread
String jobID = (String) post.get("jobNr");
- dbImporter importer = switchboard.dbImportManager.getImporterByID(Integer.valueOf(jobID).intValue());
+ Importer importer = switchboard.dbImportManager.getImporterByID(Integer.valueOf(jobID).intValue());
if (importer != null) {
if (post.containsKey("stopIndexDbImport")) {
try {
@@ -145,11 +131,11 @@ public final class IndexImport_p {
/*
* Loop over all currently running jobs
*/
- dbImporter[] importThreads = switchboard.dbImportManager.getRunningImporter();
+ Importer[] importThreads = switchboard.dbImportManager.getRunningImporter();
activeCount = importThreads.length;
for (int i=0; i < activeCount; i++) {
- dbImporter currThread = importThreads[i];
+ Importer currThread = importThreads[i];
// get import type
prop.put("running.jobs_" + i + "_type", currThread.getJobType());
@@ -183,9 +169,9 @@ public final class IndexImport_p {
/*
* Loop over all finished jobs
*/
- dbImporter[] finishedJobs = switchboard.dbImportManager.getFinishedImporter();
+ Importer[] finishedJobs = switchboard.dbImportManager.getFinishedImporter();
for (int i=0; i<finishedJobs.length; i++) {
- dbImporter currThread = finishedJobs[i];
+ Importer currThread = finishedJobs[i];
String error = currThread.getError();
String fullName = currThread.getJobName().toString();
String shortName = (fullName.length()>30)?fullName.substring(0,12) + "..." + fullName.substring(fullName.length()-22,fullName.length()):fullName;
diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.java
index 8b68c4792..db822e42b 100644
--- a/htroot/WatchCrawler_p.java
+++ b/htroot/WatchCrawler_p.java
@@ -37,12 +37,12 @@ import java.util.regex.PatternSyntaxException;
import de.anomic.crawler.CrawlEntry;
import de.anomic.crawler.CrawlProfile;
+import de.anomic.crawler.SitemapImporter;
import de.anomic.crawler.ZURL;
import de.anomic.htmlFilter.htmlFilterContentScraper;
import de.anomic.htmlFilter.htmlFilterWriter;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
-import de.anomic.plasma.dbImport.SitemapImporter;
import de.anomic.server.serverFileUtils;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@@ -340,10 +340,9 @@ public class WatchCrawler_p {
storeHTCache, true, crawlOrder, xsstopw, xdstopw, xpstopw);
// create a new sitemap importer
- SitemapImporter importerThread = (SitemapImporter) sb.dbImportManager.getNewImporter("sitemap");
+ SitemapImporter importerThread = new SitemapImporter(sb, sb.dbImportManager, new yacyURL(sitemapURLStr, null), pe);
if (importerThread != null) {
- importerThread.init(sb, 0);
- importerThread.initSitemap(new yacyURL(sitemapURLStr, null), pe);
+ importerThread.setJobID(sb.dbImportManager.generateUniqueJobID());
importerThread.startIt();
}
} catch (Exception e) {