Commit Graph
283 Commits
Author SHA1 Message Date
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
gojomo bdd7f7e1ab Fix exceptions at launch, post-crawl-finish
* KryoBinding.java
    always default to registrationOptional, for now
* StatisticsTracker.java
    explicitly set valueClass of sourceDistribution to ConcurrentHashMap
* StoredQueue.java
    answer 0 for size() when backing DB closed
2011-01-07 01:24:38 +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
gojomo ea49e55c89 [HER-1850] IllegalStateException from WorkQueueFrontier.wakeQueues in BlockIterator
* WorkQueueFrontier.java
    double in-memory snoozedClassQueues size
    protect all adds/removes to snoozedOverflow in synchronized blocks
2010-12-09 22:28:20 +00:00
gojomo c1b8138d4d [HER-1762] H3 performance tuning
Charset lookup sync de-bottlenecking
* org/apache/commons/httpclient/EncodingUtil.java
    use explicit Charset instances or cached to minimize lookups
* LaxURLCodec, BdbMultipleWorkQueues
    use explicit Charset instances
2010-12-06 19:47:49 +00:00
gojomo 85e4123b3c * TopNSet
refactor to narrow synchronized areas
2010-12-03 01:03:41 +00:00
gojomo 1c8f9374f6 [HER-1845] recovery process generates duplicated F+ entries in new recovery log
* AbstractFrontier
    remove redundant logging
2010-11-23 01:25:17 +00:00
kristinn_sig e90eff9c84 [HER-1843] Possible int overflow in CheckpointService.java
* CheckpointService
  Made checkpointIntervalMinutes setter accept a long instead of an int (was missed when the class variable was made a long). While it was non-harmful the way it was, this is more in line with Java conventions.
2010-11-18 08:53:56 +00:00
kristinn_sig 675d71d557 [HER-1843] Possible int overflow in CheckpointService.java
* CheckpointService
  Conversion from mintues to milliseconds is now done using all longs, preventing an int overflow.
  Removed errant semi-colon.
2010-11-18 00:46:06 +00:00
gojomo ba4b01261e [HER-1838] H3: job-not-found 404 not very clear
* EngineApplication
    better message for simple 404
    (contributed by Matt Warhaftig)
2010-11-16 23:17:37 +00:00
gojomo 600a4ca326 Fix selftest failures where empty 'profile' directory may not exist (eg git)
* SelfTestBase
    ...and make a tmp empty directory instead
2010-11-16 01:01:31 +00:00
gojomo c170390c0d Fix selftest failures where empty 'profile' directory may not exist (eg git)
* SelfTestBase
    only copy profile directory if it exists
2010-11-16 00:58:13 +00:00
gojomo cb7f96682b Remove synchronization on frontier methods; rely on safe queues, synchronization-per-WorkQueue instead
* AbstractFrontier
    remove inbound/outbound queues; simplify managerThread
    perform findEligible/schedule/receive/finish immediately
* WorkQueueFrontier
    eliminate holdQueues setting 
    synchronize sendToQueue on target queue
    make findEligibleUri reentrant; rely on [Blocking|Stored]Queue thread-safety
    make arriving at front of ready trigger for 'active'/budget-session
    simplify inactiveQueues management
    simplify waking from overflow
* WorkQueue
    redefine 'active' as in-budget-session
    rename 'held' as 'managed'
    synchronize major methods, relying on allQueues cache that operations on same intended queue use identical instance
    split over-budget test to isOverSessionBudget and isOverTotalBudget
    have toString show classKey
* BdbFrontier
    checkpoint fixes: remember nextOrdinal, rotate frontier-recover log, reset queues on recovery
    consistencyCheck method for probing state during stress tests
2010-11-15 22:56:03 +00:00
gojomo c8074bdbf3 Improve ability to force-terminate crawls
* RecordingInputStream.java
    check for interrupt on each socket-timeout
* CrawlController.java
    on second requestCrawlStop, interrupt threads via ToePool.cleanup
* ToePool.java
   adjust for new earlier/repeated cleanup
* ToeThread.java
   better warnings/recovery on forced-interrupts
2010-11-15 22:26:36 +00:00
gojomo d4f5004b9c Lessen synchronization bottleneck on crawl.log
* UriProcessingFormatter.java
    allow pre-caching of a specific LogRecord's formatted version, outside the synchronized publish()
* GenerationFileHandler.java
    force a format before publish(), to benefit above (a small hit in other cases where it's redundant)
2010-11-15 21:01:37 +00:00
gojomo 1501e1ddd1 * ScriptResource.java
flush rather than close, avoiding console dump
2010-11-15 20:59:45 +00:00
gojomo 6a2716ce00 Reduce synchronization bottlenecks
* FrontierJournal, CrawlerJournal
    do barest minimum inside 'synchronized' method
2010-11-12 19:37:52 +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 6452013af7 Frontier throughput experiments & fixed, continued
* WorkQueueFrontier
    (findEligibleURI) avoid outbound.capacity-sensitive activation, which under a race created by recent changes led to infinite recursion here
* AbstractFrontier
    (next) when nothing is immediately ready, try adding one-at-a-time to outbound, rather than fillOutbound()
2010-11-09 23:32:12 +00:00
gojomo ad57749dea * WorkQueueFrontier.java
debugging output for reported findEligibleURI deep-recursion
2010-11-08 23:45:19 +00:00
gojomo b5eb4f3c1e * AbstractFrontier
reduce size of inbound now that many threads will opportunistically clear it
2010-11-08 23:44:43 +00:00
gojomo 3dc5f04c06 Avoid deadlock on terminate() of already-paused/stopping crawl
* AbstractFrontier
    (managementTasks) don't synchronize around possibly-blocking take(), only around process()
2010-11-08 21:06:58 +00:00
gojomo 3be9941f76 Resolve deadlock seen after latest changes
* AbstractFrontier
    (drainInbound) don't assume current thread will be able to take() full batch; poll() and exit early if other threads have drained queue first
2010-11-08 18:54:03 +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 c7398ce463 Experiment to work-around Frontier.managerThread bottleneck
* AbstractFrontier, WorkQueueFrontier
    synchronize around all InEvent/findEligibleURI actions, so that drainInbound and fillOutbound may be called outside managerThread
    whenever a ToeThread would block on enqueue() or next(), try the appropriate catch-up method before blocking
    remove assertions no longer true with activity happening outside managerThread
2010-11-06 02:14:39 +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 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 d72e6cd1d0 [HER-1830] H3: improve sheet examples in default configuration CXML
* **/profile-crawler-beans.xml
    only 1 example SurPrefixesSheetAssociation
2010-10-01 00:16:23 +00:00
gojomo 13d8c4f851 [HER-1830] H3: improve sheet examples in default configuration CXML
* **/profile-crawler-beans.xml
    example SurPrefixesSheetAssociation
2010-09-30 23:01:25 +00:00
gojomo f1cd7dd527 [HER-1827] Have Frontier report include top X longest queues
* WorkQueueFrontier.java
    improve effective precision of top-n-queues by also updating on dequeues
2010-09-28 22:42:22 +00:00
gojomo 8f28d493a2 [HER-1827] Have Frontier report include top X longest queues
* Histotable.java
    expose static method useful for frequency-reporting
* TopNSet.java, TopNSet.java
    improve handling of case where updates may decrease frequency counts
    add convenience methods for common needs
* WorkQueueFrontier.java
    replace single longestActiveQueue with largestQueues TopNSet, of configurable size
    make max-queues-to-report-per-category configurable
2010-09-28 22:12:28 +00:00
gojomo de32bdb053 [HER-1825] H3: make default base queue precedence a more useful default
* BaseQueuePrecedencePolicy.java
    make default '3' (leaving space for 2 'higher') rather than '1'
2010-09-24 04:34:20 +00:00
gojomo 7909954b8f [HER-1823] H3: adding SheetAssociations mid-crawl won't affect already queued CrawlURIs (sheet liveness)
* SheetsOverlayManager.java
    (applyOverlaysTo) clear previous info so redundant sheets don't accrete
2010-09-21 11:07:33 +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 c701cd391a [HER-1822] H3: bean browser in non-paused crawl sometimes raises exceptions, doesn't work
* JobRelatedResource.java
    add more property names to blacklist
    route all relevant requests through new utilitiy getPropertyDescriptors method that patches instances as necessary to suppress problems
2010-09-21 10:28:29 +00:00
gojomo 1f08c114bb * ToeThread.java
tighten INFO logging to FINE
2010-09-10 21:12:48 +00:00
gojomo 4166316113 * AbstractFrontier.java
remove Serializable & related transient declarations -- serialization no longer used for checkpointing nor advisable
2010-09-10 01:00:19 +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 bce841be5f * JobResource.java
improve message for checkpoint-not-made flash
2010-09-09 23:21:28 +00:00
gojomo 3861c8caa4 * BdbMultipleWorkQueues.java
improve detail of logging of error that's been seen in some checkpoint-resume situations
2010-09-09 23:20:47 +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 d12d078a07 [HER-1800] H3: Incomplete checkpoint listed in combo box
* Checkpoint.java
    remove previous attempt to use Lifecycle to catch error
* Checkpointable.java
    @Autowired(required=false) annotation for setRecoveryCheckpoint
* CheckpointService.java
    HasValidator implementation for post-build validity check; also check at launch (probably redundant)
* CheckpointValidator.java
    ensure validity stamp exists on any present Checkpoint
2010-09-03 01:03:01 +00:00
gojomo 99ce106a9d * CrawlJob.java
tighten logging
2010-09-03 00:30:33 +00:00
gojomo bc698c09fc [HER-1480] URIs logged (as -6 or -7) that should never be scheduled
* LaxURI.java
    increase tolerance with regard to path-segments
* UURIFactory.java
    allow digits in scheme regex
    discard old supported-schemes code
* UURIFactoryTest.java
    tests for roundtrip serialization of problematic hostlike-scheme and bars-in-path
* CrawlerLoggerModule.java
    discard special-casing of URI scheme errors
* SchemeNotInSetDecideRule.java
    rule to apply to URIs of unknown schemes; by default REJECTs those not usually handled by Heritrix
* **/profile-crawler-beans.cxml
    add REJECT SchemeNotInSetDecideRule
2010-09-03 00:24:13 +00:00
gojomo 0347269785 [HER-1817] cleanup logging.properties / WARNING+ for most 3rd party; SEVERE+ for HttpClient; INFO for project classes
* logging.properties
    streamline to bare essentials; allow INFO for org.archive classes
* GenericReplayCharSequence.java, BdbUriUniqFilter.java
    demote some INFO logging to FINE
2010-09-03 00:00:46 +00:00
gojomo 9bfa8fc1db * JobResource.java
remove stray whitespace
2010-09-02 23:56:52 +00:00
gojomo ad8941fa23 1-liner fixing argument display for usage help argument echo
* Heritrix.java
    (usage) StringUtils.join the String[] args
    commit in honor of Travis, who suggested fix
2010-08-27 00:56:42 +00:00
gojomo 2f78980e5d [HER-1814] remove dependency on apache commons-pool/GenericObjectPool
* SelfTestBase.java
    don't try to UURIify 'fieldesc:' ad-hoc URIs
2010-08-26 21:56:50 +00:00
gojomo 47b28f92f8 fix class reference (and build) 2010-08-20 00:47:55 +00:00