Package org.archive.modules.net

Examples of org.archive.modules.net.ServerCache


           
            long now = System.currentTimeMillis();
            int maxBandwidthKB = getMaxPerHostBandwidthUsageKbSec();
            if (maxBandwidthKB > 0) {
                // Enforce bandwidth limit
                ServerCache cache = this.getServerCache();
                CrawlHost host = cache.getHostFor(curi.getUURI());
                long minDurationToWait = host.getEarliestNextURIEmitTime()
                        - now;
                float maxBandwidth = maxBandwidthKB * 1.024F; // kilo factor
                long processedBytes = curi.getContentSize();
                host
View Full Code Here


        String mime = MimetypeUtils.truncate(curi.getContentType());
        incrementMapCount(mimeTypeDistribution, mime);
        incrementMapCount(mimeTypeBytes, mime, curi.getContentSize());

        // Save hosts stats.
        ServerCache sc = serverCache;
        saveHostStats(sc.getHostFor(curi.getUURI()).getHostName(),
                curi.getContentSize());
       
        if (getTrackSources() && curi.getData().containsKey(A_SOURCE_TAG)) {
          saveSourceStats((String)curi.getData().get(A_SOURCE_TAG),
                        sc.getHostFor(curi.getUURI()).
                    getHostName());
        }
    }
View Full Code Here

TOP

Related Classes of org.archive.modules.net.ServerCache

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.