Commit Graph
193 Commits
Author SHA1 Message Date
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
gojomo 0627a67dce Minimize transient garbage volume by optimized serialization based on the 'Kryo' library
* AutoKryo
    extension of Kryo to allow classes to control their own registration, trigger registration of associated classes, and deserialize classes without no-arg constructors
* KryoBinding
    binding for use with BDB that uses AutoKryo serialization for a 2X-4X reduction in byte[] size
* UURI
    improved serialization via Externalizable and Kryo's CustomSerialization methods
* BdbModule
    discard deprecated CachedBDBMap option
    (getObjectCache) extend with both declaredClass and valueClass (for when map values are specializations of the declared type, as with frontier.allQueues)
    adjust type declarations
* ObjectIdentityBdbCache
    use KryoBinding rather than SerialBinding
* CachedBdbMapTest
    discarded
* BdbFrontier, BdbServerCache, StatisticsTracker
    adjust type declarations, objectCache creation
* BdbMultipleWorkQueues
    use KryoBinding rather than (Recycling)SerialBinding
* BdbWorkQueue, CrawlServer, CrawlHost, CrawlURI
    add autoregister support
* LinkContext
    public for kryo registration
2010-11-05 23:23:58 +00:00
gojomo 6164939fc4 Minimize transient garbage creation identified by allocation profiling
* CrawlURI
    use ArrayList and indexed access rather than LinkedList and iterator instances for overlays
2010-11-05 22:32:05 +00:00
gojomo f4d69b37da Minimize transient garbage creation identified by allocation profiling
* UURIFactory, canonicalize/**, PathologicalPathDecideRule, ExtractorHTML
    use recycled matchers via TextUtils
* CrawlURI, KeyedProperties, OverlayContext, SheetOverlaysManager
    use ArrayList and indexed access rather than LinkedList and iterator instances
2010-11-05 21:34:53 +00:00
nlevitt acedca1788 Part of [HER-1836] let more than one extractor run on a single url - new
setting "independentExtractors" - when enabled, extractors run regardless of
whether other extractors have run
* profile-crawler-beans.cxml, AbstractFrontier.java, ExtractorParameters.java,
  Extractor.java
    new setting independentExtractors
* ContentExtractor.java
    shouldProcess() - respect independentExtractors
2010-10-26 23:49:42 +00:00
gojomo dc056d73f4 [HER-1832] URI without fetch-attempt causes either RuntimeException (H1) or nonsensical history info (H3) in FetchHistoryProcessor
* FetchHistoryProcessor.java
    skip history-storage if no evidence of fetch-attempt (A_FETCH_START_TIME data)
2010-10-26 00:32:18 +00:00
gojomo 3a362002c7 [HER-1833] many crawls want to suppress DNS-server's provision of a default local domain
* FetchDNS.java
    append '.' to domain name for lookup, anchoring it as FQDN
2010-10-25 23:50:12 +00:00
nlevitt d392341141 * ExtractorXML.java
shouldExtract() - choose to extract also if content starts with <?xml ...
2010-10-19 02:53:07 +00:00
nlevitt b75f604bf9 [HER-1836] let more than one extractor run on a single url?
* ContentExtractor.java
    shouldProcess() - do not check uri.hasBeenLinkExtracted()
* CrawlURI.java
    update javadoc comments on hasLinkBeenExtracted()
2010-10-19 02:08:54 +00:00
gojomo a757140cf6 [HER-1831] change version numbering convention to be less confusing
* **/pom.xml
    change 3.1.1-SNAPSHOT to 3.0.1-SNAPSHOT
2010-09-30 19:48:35 +00:00
nlevitt 74d3fb54ce HER-1828 ExtractorXML misses https urls
* ExtractorXml.java
    adjust XML_URI_EXTRACTOR regex to also look for https urls
2010-09-25 07:48:46 +00:00
nlevitt 63c8de4045 fix for [HER-1824] ExtractorXML doesn't properly unescape
* ExtractorXML.java
    processXML() - unescape extracted urls with commons-lang unescapeXml()
2010-09-23 02:03:48 +00:00
gojomo 1ce23ecbcd [HER-747] Ensure 'retired' status for queues is operator-controllable
[HER-1768] Changing queue totalBudget not retiring queue as expected
* CrawlURI.java
    (includesRetireDirective) internalize to CrawlURI
* AbstractFrontier.java
    allow re-enqueuing of untried URI with retire-driective
    clean up terminology/method-names
* WorkQueue.java, WorkQueueFrontier.java, BdbFrontier.java
    adjust budget/sessionBalance handling to always count up, always consult latest values, always refresh values from latest URI
    (processFinish) reorganize to reduce redundancy
* DispositionProcessor.java
    offer forceRetire setting
* QuotaEnforcer.java
    set failed-status *or* forceRetire, not both
[HER-1823] H3: adding SheetAssociations mid-crawl won't affect already queued CrawlURIs (sheet liveness) 
* SheetsOverlayManager.java
    (applyOverlaysTo) rename, unify, reapply whenever called to ensure liveness
* CandidatesProcessor.java
    adjust to rename
2010-09-21 10:55:07 +00:00
gojomo 153e709fe5 * WriterPoolProcessor.java
eliminate nonsensical type check
2010-09-15 03:52:11 +00:00
gojomo d6a4d158b0 [HER-1803] H3: make it easier to change robots settings
* RobotsPolicy.java
    simplified unification of RobotsHonoring and RobotsExclusion policy classes; subclasses specialize
* ObeyRobotsPolicy.java
    classic obey-robots-as-declared policy
* IgnoreRobotsPolicy.java
    ignore declared robots policy
* CustomRobotsPolicy.java
    follow custom-crafted policy in robots.txt format
* MostFavoredRobotsPolicy.java
    follow the most-permissive policy available to a set of user-agents; optionally adopt ('masquerade') the user-agent whose rules are chosen
* RobotsExclusionPolicy.java, RobotsHonoringPolicy.java
    deleted
* CrawlMetadata.java
    use new string robotsPolicyName as main determinant of policy
    maintain map of available policies ('obey','ignore', and any the operator added)
* CrawlServer.java
    retain Robotstxt instance rather than customized RobotsExclusionPolicy
* PreconditionEnforcer.java
    use full CrawlMetadata rather than just UserAgentProvider subset
    consult RobotsPolicy looked up through CrawlMetadata for allow/disallow decision
* DispositionProcessor.java
    update CrawlServer with Robotstxt only
    consult Robotstxt for crawl-delay
* profile-crawler-beans.cxml (*2), migrate-template-crawler-beans.cxml, selftest-crawler-beans.cxml
    remove old declarations/examples; add new
* ExtractorHTML.java, JerichoExtractorHTML.java
    consult RobotsPolicy.obeyMetaRobotsNofollow for NOFOLLOW
* Robotstxt.java
    new constructors for new use patterns
* **/*Test.java
    update/remove to match new use patterns
2010-09-10 00:27:20 +00:00
gojomo 3e43cf7bd5 * LinkContext.java
undo inadvertent introduction of class-serialization-format incompatibility
2010-09-09 23:22:15 +00:00
gojomo de551ced58 [HER-1801] H3: Unreleased lock causes deadlock when checkpointing
* Frontier.java
    add beginDisposition(), endDisposition() methods
* AbstractFrontier.java
    implement beginDisposition(), endDisposition() methods to maintain dispositions-in-progress lock
* BdbFrontier.java
    acquire exclusive dispositionInProgressLock before allowing checkpoint to begin; release at completion of checkpoint
* ToeThread.java
    call beginDisposition before dispositionChain/finished(); call endDisposition after finished() and on exceptions
* DispositionChain.java
    shed all prior relation to locking/checkpointing
2010-09-03 02:14:41 +00:00
gojomo dbf22ad574 [HER-1480] URIs logged (as -6 or -7) that should never be scheduled
* Extractor.java
    discard special-casing of URI-ignored-scheme
2010-09-03 00:29:05 +00:00