示例#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);
 }
示例#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");
 }
示例#3
0
 public void clearIndex(String type) {
   idxMgr.getIndex(type).deleteByQuery("type:" + type);
 }
示例#4
0
 public void queueDeletion(String type, String id) {
   idxMgr.delete(type, id);
 }
示例#5
0
 @Override
 public List<Hit> findByType(String type, String query) {
   return idxMgr.getIndex(type).doQuery(query);
 }
示例#6
0
 @Override
 public void dataFetched(String type, Map<String, String> fetchedData) {
   idxMgr.index(type, fetchedData);
 }