Example #1
0
 private void registerCrawler(AbstractCrawler cw) {
   synchronized (crawlers) {
     crawlers.put(cw.getType(), cw);
   }
   synchronized (runnables) {
     runnables.put(cw, new RunnableCrawler(cw));
   }
   idxMgr.setupIndex(cw.getType());
   cw.registerListener(this);
 }
Example #2
0
 @Override
 public void crawlComplete(String type, boolean commitNeeded) {
   if (commitNeeded) {
     idxMgr.getIndex(type).commit();
   }
   synchronized (runningCrawlers) {
     runningCrawlers.remove(type);
   }
   logger.info("type " + type + " removed from runningCrawlers");
 }
Example #3
0
 public void clearIndex(String type) {
   idxMgr.getIndex(type).deleteByQuery("type:" + type);
 }
Example #4
0
 public void queueDeletion(String type, String id) {
   idxMgr.delete(type, id);
 }
Example #5
0
 @Override
 public List<Hit> findByType(String type, String query) {
   return idxMgr.getIndex(type).doQuery(query);
 }
Example #6
0
 @Override
 public void dataFetched(String type, Map<String, String> fetchedData) {
   idxMgr.index(type, fetchedData);
 }