Package com.googlecode.flaxcrawler.frontier

Examples of com.googlecode.flaxcrawler.frontier.DefaultStatisticsService


    private void init() throws CrawlerException {
        log.info("Initializing crawler controller");

        try {
            log.info("Initializing statistics service");
            statisticsService = new DefaultStatisticsService(STATS_DB_DIR);

            log.info("Initializing task queue");
            if (queue != null) {
                log.info("Queue is overriden, setting it instead of default inner task queue");
                ((TaskQueueImpl) taskQueue).setQueue(queue);
View Full Code Here


public class TestDefaultStatisticsService {

    @Test
    @Ignore
    public void testAfterScheduling() throws DatabaseException {
        DefaultStatisticsService statisticsService = null;

        try {
            statisticsService = new DefaultStatisticsService("stats");


            CrawlerTask task = new CrawlerTask("http://google.com/", 1);
            statisticsService.afterScheduling(task);

            assertNotNull(statisticsService.getDomainStatistics("google.com"));
            assertTrue(statisticsService.isCrawled("http://google.com/"));
            assertTrue(statisticsService.getDomainStatistics("google.com").getScheduled() > 0);
        } finally {
            if (statisticsService != null) {
                statisticsService.dispose();
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.googlecode.flaxcrawler.frontier.DefaultStatisticsService

Copyright © 2018 www.massapicom. 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.