Examples of CrawlInfo


Examples of org.apache.oodt.pcs.health.CrawlInfo

    List statuses = new Vector();

    if (crawlers != null && crawlers.size() > 0) {
      Collections.sort(crawlers, new Comparator() {
        public int compare(Object o1, Object o2) {
          CrawlInfo c1 = (CrawlInfo) o1;
          CrawlInfo c2 = (CrawlInfo) o2;

          return c1.getCrawlerName().compareTo(c2.getCrawlerName());
        }

      });

      for (Iterator i = crawlers.iterator(); i.hasNext();) {
        CrawlInfo info = (CrawlInfo) i.next();
        String crawlerUrlStr = "http://" + crawlHost + ":"
            + info.getCrawlerPort();
        CrawlerStatus status = new CrawlerStatus();
        status.setInfo(info);
        status.setStatus(printUp(getCrawlerUp(crawlerUrlStr)));
        status.setCrawlHost(crawlHost);
        statuses.add(status);
View Full Code Here

Examples of org.apache.oodt.pcs.health.CrawlInfo

    }

    List statuses = new Vector();

    for (Iterator i = this.crawlProps.getCrawlers().iterator(); i.hasNext();) {
      CrawlInfo info = (CrawlInfo) i.next();
      String crawlUrlStr = "http://" + this.crawlProps.getCrawlHost() + ":"
          + info.getCrawlerPort();
      try {
        CrawlDaemonController controller = new CrawlDaemonController(
            crawlUrlStr);
        CrawlerHealth health = new CrawlerHealth();
        health.setCrawlerName(info.getCrawlerName());
        health.setNumCrawls(controller.getNumCrawls());
        health
            .setAvgCrawlTime((double) (controller.getAverageCrawlTime() / 1000.0));
        statuses.add(health);

      } catch (Exception e) {
        CrawlerHealth health = new CrawlerHealth();
        health.setCrawlerName(info.getCrawlerName());
        health.setNumCrawls(CRAWLER_DOWN_INT);
        health.setAvgCrawlTime(CRAWLER_DOWN_DOUBLE);
        statuses.add(health);
      }
View Full Code Here

Examples of org.apache.oodt.pcs.health.CrawlInfo

    String crawlHost = this.crawlProps.getCrawlHost();

    if (crawlers != null && crawlers.size() > 0) {
      Collections.sort(crawlers, new Comparator() {
        public int compare(Object o1, Object o2) {
          CrawlInfo c1 = (CrawlInfo) o1;
          CrawlInfo c2 = (CrawlInfo) o2;

          return c1.getCrawlerName().compareTo(c2.getCrawlerName());
        }

      });

      String biggestString = getBiggestString(crawlers);
      for (Iterator i = crawlers.iterator(); i.hasNext();) {
        CrawlInfo info = (CrawlInfo) i.next();
        String crawlerUrlStr = "http://" + crawlHost + ":"
            + info.getCrawlerPort();
        System.out.println(getStrPadding(info.getCrawlerName(), biggestString)
            + info.getCrawlerName() + ": [" + crawlerUrlStr + "]: "
            + printUp(getCrawlerUp(crawlerUrlStr)));
      }
    }

  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.CrawlInfo

    if (this.crawlProps.getCrawlers() == null) {
      return;
    }

    for (Iterator i = this.crawlProps.getCrawlers().iterator(); i.hasNext();) {
      CrawlInfo info = (CrawlInfo) i.next();
      String crawlUrlStr = "http://" + this.crawlProps.getCrawlHost() + ":"
          + info.getCrawlerPort();
      try {
        CrawlDaemonController controller = new CrawlDaemonController(
            crawlUrlStr);
        System.out.println(info.getCrawlerName() + ":");
        System.out.println("Number of Crawls: " + controller.getNumCrawls());
        System.out.println("Average Crawl Time (seconds): "
            + (double) (controller.getAverageCrawlTime() / 1000.0));
        System.out.println("");

      } catch (Exception e) {
        System.out.println(info.getCrawlerName() + ": DOWN");
      }

    }
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.CrawlInfo

  private String getBiggestString(List crawlInfos) {
    int biggestStrSz = Integer.MIN_VALUE;
    String biggestStr = null;

    for (Iterator i = crawlInfos.iterator(); i.hasNext();) {
      CrawlInfo info = (CrawlInfo) i.next();
      String crawlInfoName = info.getCrawlerName();
      if (crawlInfoName.length() > biggestStrSz) {
        biggestStr = crawlInfoName;
        biggestStrSz = biggestStr.length();
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.