Commit Graph
210 Commits
Author SHA1 Message Date
gojomo 52d00a9917 Prep for 3.1.0-beta
* **/pom.xml
    increment declared version
2011-04-15 18:09:43 +00:00
nlevitt 2df2584573 Fix HER-1880 robots.txt less specific Allow overrides more specific Disallow
* RobotsDirectives.java
    - use plain ConcurrentSkipListSet<String> instead of PrefixSet, to
      maintain complete list of prefixes, so we can know the longest match
    - allows(String) - return true if longest matching Allow prefix is longer
      than or equal to longest matching Disallow prefix
* RobotstxtTest.java
    flip expected result of test of generic Allow against specific Disallow
2011-04-14 02:25:43 +00:00
gojomo bd45720bae improved comments about new naming conventions/default-template 2011-04-11 22:49:01 +00:00
nlevitt f2ad45045b * FetchWhois.java
fix whois uri syntax - add missing "/" token
2011-04-07 17:17:48 +00:00
nlevitt 020ef44551 * FetchWhois.java
class-level javadoc including informal specification of whois uri
2011-04-07 06:44:06 +00:00
gojomo f4cf64af29 [HER-1053] compressed HTTP fetch: "Accept-encoding: gzip"
[HER-728] Offer replay stream that has been un-chunked (whether because response was HTTP/1.1 or used chunked in HTTP/1.0 against spec)
[HER-1876] Offer HTTP/1.1 option - for chunked transfer-encoding (but not persistent connections) 
* (all)
    update to use new (decoded-as-necessary) content streams/CharSequences
2011-04-06 20:54:16 +00:00
gojomo c5eb3ffd53 [HER-1053] compressed HTTP fetch: "Accept-encoding: gzip"
[HER-728] Offer replay stream that has been un-chunked (whether because response was HTTP/1.1 or used chunked in HTTP/1.0 against spec)
[HER-1876] Offer HTTP/1.1 option - for chunked transfer-encoding (but not persistent connections) 
* FetchHTTP
    add 'acceptCompression' and 'useHTTP11' properties, both default false
* Recorder
    track whether recorded-input is transfer-encoded (chunked) or content-encoded (gzip etc)
    offer alternate replay streams for 
      (1) raw 'messageBody'; 
      (2) entity (un-chunked if necessary)
      (3) content (decompressed if necessary)
    always content & GenericReplayCharSequence for CharSequence replays
* GenericReplayCharSequence
    always use a stream (rather than random-access buffer)
    always decode to prefix buffer first, so short content never touches disk no matter the encoding
* InMemoryReplayCharSequence
    deleted; 'Generic' now works similarly for small content and anyway random-access for single-byte-encodings is now rarely possible (given deconding streams)
* RecordingInputStream, RecordingOutputStream
    adjust for changed stream names, functionality moved to Recorder
* ReplayCharSequence
    use Charset instances rather than names
* ReplayInputStream
    add convenience constructor (and tmp-file-destroy) for copying any other inputStream into a seekable ReplayInputStream
2011-04-06 20:42:43 +00:00
nlevitt b79308b2e0 Part of HER-1875 - socket timeout for whois fetcher
* FetchWhois.java
2011-04-05 01:22:01 +00:00
nlevitt 81cda7be59 HER-1875 followup - override SocketFactory to support connect timeout for ftp
data connection
2011-04-05 01:21:09 +00:00
nlevitt 653f24e713 Avoid exception - "org.springframework.beans.NotWritablePropertyException:
Invalid property 'timeoutSeconds' of bean class
[org.archive.modules.fetcher.FetchFTP]: Bean property 'timeoutSeconds' is not
writable or has an invalid setter method. Does the parameter type of the setter
match the return type of the getter?"
* FetchFTP.java
    change setTimeoutSeconds(Integer) to setTimeoutSeconds(int)
2011-04-04 20:10:54 +00:00
nlevitt 8e7b9a5fdf Fix HER-1875 FetchFTP needs socket timeout
* FetchFTP.java
    setSoTimeoutMs(), getSoTimeoutMs()
    (init) - set default value of 20000 ms, same as FetchHTTP
    fetch() - set various timeouts on FTPClient - effectively sets connect
    timeout and socket timeout on control connection, and socket timeout on
    data connection (notably, does not set connect timeout on data connection
    w/ current commons-net)
2011-04-04 19:50:56 +00:00
nlevitt 013b5e394d Different fix for HER-1872: additional property preloadSourceUrl. Use either
that or preloadSource (a filesystem path), rather than try to handle both
possibilities with one string.
* PersistLoadProcessor.java
* PersistProcessor.java
2011-03-02 01:24:28 +00:00
nlevitt d97d4aa8cb Fix HER-1872 PersistLoadProcessor preloadSource does not support url
(regression from h1)
* PersistLoadProcessor.java
    change preloadSource from ConfigFile to String, allowing the logic in
    PersistProcessor.copyPersistSourceToHistoryMap() to decide how to load it
2011-02-26 00:59:35 +00:00
nlevitt b9c408cb07 Change form of generic serverless whois url to e.g. whois:archive.org
* FetchWhois.java
* UURIFactory.java
2011-02-19 02:00:18 +00:00
nlevitt 368ff65286 * FetchWhois.java
add license preamble
2011-02-17 22:52:37 +00:00
nlevitt 4991b295bc HER-1645 whois fetcher
* URIAuthorityBasedQueueAssignmentPolicy.java
    whois urls all go in special "whois" queue
* PreconditionEnforcer.java, CrawlURI.java
    move markPrerequisite() method from PreconditionEnforcer to CrawlURI
* profile-crawler-beans.cxml
    commented-out whois fetcher clause
* FetchStatusCodes.java
    new status codes for whois
* ServerCache.java
    getHostFor() - return "whois:" for whois urls, following dns: convention
* UURIFactory.java
    ugly hack for whois urls
* SchemeNotInSetDecideRule.java
    add whois to list of supported schemes
* WriterPoolProcessor.java
    shouldWrite() - we should write successful whois fetches
* WARCWriterProcessor.java
    write whois records
* FetchWhois.java
    the fetcher
2011-02-17 22:33:28 +00:00
gojomo 548114dbde [HER-1864] cookies are being set and sent back on TLDs/public-suffixes (like '.com') (sometimes called 'supercookies')
* CookieSpecBase
    use Guava InternetDomainName public-suffixes to both (1) prevent storing cookie on public-suffix; (2) prevent looking-up cookies for public-suffixes
* BdbCookieStorage
    correct checkpoint/relaunch behavior: don't reuse persisted cookies on normal relaunches; do reuse on resume-from-checkpoint
2011-02-16 01:18:57 +00:00
gojomo 40f7debeaa [HER-1846] IOException due to disk full situation can cause frontier lock-up
* WARCWriterProcessor
    move checkSize into block protected by catch/finally cleanup of errors
* WARCWriterProcessorTest
    test to simulate record-write-failure and verify does not cause pool lockup
* WARCWriterTest, WriterPoolMember
    comment and warnings cleanup
2011-01-28 03:02:17 +00:00
gojomo c1a99a8e35 [HER-1861] Add 'first-named' robots policy, which considers rules for more than one user-agent, in order
* Robotstxt, RobotstxtTest
    treat wildcardRules specially, so that it is possible to ask for only explicitly-named matches
* MostFavoredRobotsPolicy
    improve comment, change masquerade default to true
* FirstNamedRobotsPolicy, FirstNamedRobotsPolicyTest
    policy to consider alternate user-agents in order, using the first that has any explicit (non-wildcard) rules declared (or failing that, the original default user-agent)
2011-01-28 00:48:25 +00:00
gojomo a3d4dc5ac2 [HER-1834] log-bloat, memory problems when hopsPath grows endlessly with no max-hops limit set
* TooManyHopsDecideRule
    remove inadvertent reversal of sense of comparison, making default scope reject almost everything (and breaking most self-tests)
2011-01-26 03:08:32 +00:00
gojomo 8212d1c0dd [HER-1860] H3: Remove dependence on GC/finalization/PhantomReference magic in used ObjectIdentityCache implementation
* StatisticsTracker
    move small stat maps to in-memory ConcurrentMaps
    update processedSeedRecords for new ObjectIdentityCache shape
    move hostsDistribution/hostsBytes/hostsLastFinished tracking to CrawlHosts/hostsCache
* CrawlSummaryReport
    gets hosts count from hostsCache
* SeedRecord
    implement IdentityCacheable
* FetchStats
    remember last-success times
2011-01-20 23:36:50 +00:00
gojomo 0b577c1245 [HER-1860] H3: Remove dependence on GC/finalization/PhantomReference magic in used ObjectIdentityCache implementation
* IdentityCacheable
    new interface required of objects stored in ObjectIdentityCaches
* IdentityCacheableWrapper
    wrapper for storing arbitrary objects in ObjectIdentityCaches
* ObjectIdentityCache
    keys now always Strings
    values now always IdentityCacheables
    new dirtyKey() method to ensure a key is persisted
* ObjectIdentityBdbCache, ObjectIdentityMemCache
    update for new ObjectIdentityCache shape; still using legacy GC magic
* ObjectIdentityBdbManualCache
    alternate implementation relying on dirtying to ensure persistence
    use Guava library MapMaker for soft memMap; capped dirtyMap
* BdbModule
    use ObjectIdentityBdbManualCache by default
    up expectedConcurrency default to 64
* BdbModuleTest, ObjectIdentityBdbCacheTest, ObjectIdentityBdbManualCacheTest
    update, add tests
* Frontier
    FrontierGroup as IdentityCacheable
* AbstractFrontier, WorkQueueFrontier, BdbFrontier
    touchup queue/group accessors
    make queue instances dirty whenever mutated 
* WorkQueue, CrawlHost, CrawlServer
    IdentityCacheable support; appropriate makeDirty()s
* ServerCache, DefaultServerCache
    update for new ObjectIdentityCache shape
2011-01-20 23:28:38 +00:00
gojomo d2f28f051c [HER-1834] log-bloat, memory problems when hopsPath grows endlessly with no max-hops limit set
* CrawlURI
    add getHopCount() for total (including tallied overflow) hop count
* TooManyHopsDecideRule
    base decision on getHopCount()
2011-01-19 07:37:43 +00:00
gojomo 6795b3bfba [HER-1834] log-bloat, memory problems when hopsPath grows endlessly with no max-hops limit set
* CrawlURI
    MAX_HOPS_DISPLAYED constant, 50
    build new CrawlURI pathFromSeed value via extendHopsPath, which shows only MAX_HOPS_DISPLAYED hops, and precedes string with int value of hops unshown
* CrawlURITest
    test for extendHopsPath
2011-01-19 02:30:42 +00:00
gojomo 57edfde618 [HER-1859] ExtractorJS improper handling of Javascript string literal escapes
* ExtractorJS
    apply JS literal string deescaping before interpretation as link
* ExtractorJSTest
    3 basic tests, including one for this issue
* Link
    provide logging and fallback for case where via may be null; risk identified in creation of test cases could present again if a '.js' file is ever provided as a (via-less) seed
2011-01-18 23:34:35 +00:00
nlevitt 0af0d3cc6a * WARCWriterProcessor.java
addStats() - use putIfAbsent() to avoid race conditions; move
    creation of stats map to constructor to avoid another race condition
* WARCWriter.java
    switch back to thread-unsafe data structures for stats since object is used
    in one thread at a time according to javadoc
2011-01-18 04:02:42 +00:00
gojomo 823aaf0154 Add Javadoc class comment notes about (potentially) left-open-by-design ReplayCharSequence instances 2011-01-18 01:32:26 +00:00
nlevitt 69429f2d4e Missed one file r7051 commit
* ExtractorJS.java
    do not close ReplayCharSequence
2011-01-17 21:27:39 +00:00
nlevitt 50bb39a839 * WARCWriterProcessor.java
initialize urlsWritten (fix npe, oops)
2011-01-15 19:46:42 +00:00
nlevitt 72932b8ca8 Rename and comment on WARCWriter stats bits to clarify their use as temporary
accumulators on behalf of WARCWriterProcessor.
2011-01-15 04:17:49 +00:00
nlevitt 9a34201c8e Make warc writer stats thread-safe. 2011-01-15 04:01:04 +00:00
nlevitt 6de68e3e36 Let Recorder remember its replayCharSequence, and ToeThread close it when uri
processing is finished.
* Recorder.java
    getReplayCharSequence() - remember ReplayCharSequence, obtain new one if
        none remembered or remembered has been closed
    endReplays() - close replayCharSequence
* ToeThread.java
    run() - call Recorder.endReplays() when finished with uri
* ReplayCharSequence.java
    isOpen() - return false if close() has been called
* GenericReplayCharSequence.java, InMemoryReplayCharSequence.java
    implement isOpen()
* KeyWordProcessor.java, ExtractorHTML.java, HTTPContentDigest.java,
  ExtractorCSS.java, ExtractorXML.java
    do not close ReplayCharSequence
2011-01-15 03:13:27 +00:00
gojomo 6f095b409c [HER-1848] Add option to disable link-extraction from 404 error pages
* FetchStatusCodes
    add 404 constant
* ExtractorParameters
    rename isIndependentExtractor (which seems to describe the parameters object) to getExtractIndependently (the paramters' imperative to extractors)
    add getExtract404s
* Extractor
    add default ExtractorParameters impl
    remove redundant shouldProcess
* ContentExtractor
    consult getExtract404s, if false skip extraction of 404s
2011-01-15 01:21:09 +00:00
gojomo cd398d4c46 W/ARCWriter-related refactoring
* Arc2Warc, Warc2Arc
    adapt to new constructors, settings-object
* MiserOutputStream
    stream to monitor position, optionally suppress flushes
* WriterPoolMember
    use MiserOutputStream rather than special file-access to find compressed offsets
    use shared settings object rather than copying multiple values
* WriterPoolSettings
    add settings for frequentFlushes and writeBufferSize for IO optimization
* ARCReader, ARCWriter, ARCWriterPool
    adapt to new constructors, settings-object
* WriterPoolSettingsData
    impl of WriterPoolSettings for testing and adhoc use
* WARCWriter
    adapt to new constructors, settings-object
    remove checkSize rollover to new file (done elsewhere)
    remove extraneous id-generator code/static-method
* WARCWriterPool
    adapt to new constructors, settings-object
* WARCWriterPoolSettings, WARCWriterPoolSettingsData
    add recordIDGenerator setting, impl class for testing/adhoc use
* WARCWriterTest
    adapt to new constructors, settings-object
* Generator, GeneratorFactory
    removed in favor of RecordIDGenerator interface
* RecordIDGenerator 
    common interface for classes that can provide WARC record IDs
* UUIDGenerator, UUIDGeneratorTest
    adapt to derive from RecordIDGenerator
    avoid throwing exceptions
* ARCWriterPoolTest, ARCWriterTest
    adapt to new constructors, settings-object
* WARCWriterProcessor
    do checkSize file-rollover here, so related records don't span WARCs
    calculate processor's totalBytesWritten via position offset changes (as before stats-additions)
    delegate record-ID generation
* WriterPoolProcessor
    add frequentFlushes and writeBufferSize from new WARCWriterPoolSettings interface
2011-01-14 23:26:31 +00:00
gojomo 402b9a45a6 * RobotstxtTest
add test case for robots.txt with extraneous leading whitespace and missing blank lines
2011-01-12 23:45:49 +00:00
nlevitt ef9d2e8c0e [HER-1789] stats from WARCWriterProcessor
* WriterPoolMember.java
    write(*), copyFrom() - return number of (uncompressed) bytes written, for
    convenience
* WARCWriter.java
    tally by record type: number of records written, content bytes, total
    bytes, and (possibly compressed) size on disk
* WARCWriterProcessor.java
    keep totals and write report to processors-report.txt
2011-01-12 00:54:01 +00:00
nlevitt 463d295c24 * SurtPrefixedDecideRule.java
buildSurtPrefixSet() - close the reader obtained from surtsSource when
    we're finished with it
2011-01-11 20:46:15 +00:00
nlevitt 36515bdbf6 Part of HER-1857. Rename textSource->surtsSource, and make old surtsSourceFile
a facade for surtsSource.
2011-01-11 20:42:05 +00:00
nlevitt 4ee1e09fd3 * SurtPrefixedDecideRule.java
new property textSource, an org.archive.io.ReadSource, allowing
    specification inline in cxml as well as in external file
* profile-crawler-beans.cxml
    commented out clauses demonstrating use of textSource
2011-01-09 21:10:37 +00:00
nlevitt dd439dac3b Fixes and improvements to to DecideRuleSequence/logToFile.
* DecideRuleSequence.java
    - use Spring Lifecycle start() to initialize logToFile
    - inject logger module as SimpleFileLoggerProvider, since we're in
      heritrix-modules and don't have access to CrawlerLoggerModule from
      heritrix-engine
* CrawlerLoggerModule.java
    - implement SimpleFileLoggerProvider
    - setupSimpleLog() - use 'T' instead of '+' between date and time in
      timestamp
* SimpleFileLoggerProvider.java
    new interface with one method, setupSimpleLog()
* Scoper.java
    do not call scope.start()/scope.stop(), these are handled using Spring
    Lifecycle now
* DecideRule.java
    remove unused, unneeded start()/stop()
2011-01-07 02:09:31 +00:00
nlevitt 93cf655bed Add logToFile support to DecideRuleSequence. File is logs/{spring-bean-id}.log,
format: [timestamp] [decisive-rule-num] [decisive-rule-class] [decision] [uri]
* Scoper.java
    start(),stop() - call scope.start()/scope.stop()
* CrawlerLoggerModule.java
    setupSimpleLog() - new logToFile paradigm
* DecideRule.java
    start(),stop() - noop
* DecideRuleSequence.java
    logToFile support
* profile-crawler-beans.cxml
    <!-- <property name="logToFile" /> -->
2011-01-06 18:39:19 +00:00
nlevitt 641f193e17 * ExtractorXML.java
shouldExtract(CrawlUri) - Avoid java.lang.IndexOutOfBoundsException
    checking for xml preamble in brief/empty url content.
2011-01-03 22:41:00 +00:00
gojomo 7678326121 remove obsolete renamed classes 2010-12-06 19:43:16 +00:00
gojomo 35e015698c [HER-1847] DocumentLengthT(h)resholdDecideRule spelling, naming
* (Not)ExceedsDocumentLengthT(h)resholdDecideRule
    improve comments, rename to:
     ResourceLongerThanDecideRule
     ResourceNoLongerThanDecideRule
2010-12-06 18:39:19 +00:00
gojomo 2546bf5a01 correct misspelling of 'Threshold' 2010-12-06 18:13:39 +00:00
gojomo 0500cdc8c1 * FetchStatusDecideRule.java
eliminate unused
2010-12-03 00:40:09 +00:00
gojomo 301b943f03 Consolidate ModuleAttributeConstants into CoreAttributeConstants
* (many)
    distinction between these two constant-collecting classes was fuzzy (to the point that they already referred to each other), and they were both in same subproject/package already as well; so, merged constants into the larger, older class
2010-11-09 23:47:37 +00:00
gojomo f12e940edd Discard 'CredentialAvatar' -- no longer needed with Spring settings -- use Credential instances directly 2010-11-06 03:45:00 +00:00
gojomo 7fdb7cb384 tests cleanup
* UURI
    return to custom-serialization rather than externalization
* CachedBdbMap
    remove obsolete class
* StripSessionCFIDs, StripSessionIDs
    update patterns to restore intended case-insensitivity
* StripSessionCFIDsTest
    put expected, actual in expected order
2010-11-06 01:26:20 +00:00
gojomo c56eb5d343 Experiment to assist large seed-loads
* TextSeedModule.java
     in large seed loads, try to force finalization, just in case it's lagging
2010-11-05 23:27:43 +00:00