Commit Graph
328 Commits
Author SHA1 Message Date
Kenji Nagahashi 8fc44b626c added a test case for catching HER-2013 2012-07-19 14:15:22 -07:00
Noah Levitt eee6c6cd30 * ArchiveRecord.java
fix indentation only (no substantive changes)
2012-07-16 09:57:24 -07:00
Noah Levitt c108c4c451 HER-2014 Make ArchiveRecord.getPosition() public instead of protected.
* ArchiveRecord.java, HeaderedArchiveRecord.java
    getPosition() - change visibility to public
2012-07-16 09:54:54 -07:00
Travis Wellman c5d740a6d4 remove some dead or redundant code
* ArchiveUtils
    sb.length() was tested twice and int i was never used
* PrefixFinder
    opCount is never used
* BdbMultipleWorkQueues
    tries is never used
2012-07-11 16:57:13 -07:00
Travis Wellman c1a0525107 suppress unused warnings for serialVersionUid
Toward the goal of having Eclipse warnings be useful to look at, suppressing
unused warnings for serialVersionUid will significantly reduce clutter.
2012-07-10 14:12:33 -07:00
Travis Wellman 4ca6e9cc99 revert a change that may break bdb history 2012-07-03 17:38:43 -07:00
Noah Levitt 6225f6fa0b Fix HER-2013 scheme-less relative URI not resolved correctly
* LaxURI.java
    parseUriReference() - fix logic testing if uri string is a path to respect scheme-less uris even if they contain colons
* UURIFactoryTest.java
    add test for scheme-less relative uri (with colons)
2012-06-28 16:49:50 -07:00
Travis Wellman 6626b44286 generics warnings fixes
This commit does not change any functionality, just
alters generics to reduce warnings in Eclipse.
2012-06-21 18:23:06 -07:00
Noah Levitt 99acaa9bfa Fix tests revealed to be failing
* UriUtils.java
    isLikelyFalsePositive() - do not flag urls starting with ../ as likely false positives
* UriUtilsTest.java
    remove test url that is now rejected
2012-06-06 09:00:13 -07:00
Noah Levitt 342ea33be5 Move test classes into test area of source tree
* LongToIntConsistentHashTest.java, UriUtilsTest.java
2012-06-05 18:03:33 -07:00
Noah Levitt 35378df2fa Merge branch 'master' into no-package-scope 2012-06-05 17:58:40 -07:00
Noah Levitt 3dce1e909d Change scope of most/all default-scope i.e. package-scoped class members to protected, to make heritrix more friendly to third-party extensions. (I don't think there was ever an intent to limit the scope of any of these to package-only.) 2012-06-05 17:55:41 -07:00
Travis Wellman 07a2fc65ea use methods to specify which report rather than string constants
* MultiReporter
    deleted. direct method calls are a better way to specify the kind of report desired
    getReports was never used to choose from the array of strings. no use case for MultiReporter.
* ArchiveUtils
    writeReportToString was not used, and it used the now deleted MultiReporter#reportTo
* DevUtils, Frontier, ToePool, AbstractFrontier, WorkQueueFrontier
    MultiReporter -> Reporter and make methods that implemented named multireport public
* FrontierNonemptyReport, FrontierSummaryReport
    call the appropriate report method instead of passing a string constant
2012-06-01 17:57:25 -07:00
Travis Wellman 493e2423f6 begin removing MultiReporter
* MultiReporter.java
    deprecated
* ToePool, ToeThread, WorkQueue, WorkQueueFrontier, PrecedenceProvider, CrawlURI, FetchStats.java
    remove MultiReporter#getReports() and reportTo(String, PrintWriter)
    these are not used as MultiReporter specifies, and MultiReporter is going away anyhow
2012-06-01 17:14:41 -07:00
Noah Levitt 9fffa8fc53 **/pom.xml
bump version to 3.1.2-SNAPSHOT
2012-05-01 18:17:33 -07:00
Noah Levitt 79c40346fc **/pom.xml
* bump version number to 3.1.1 for release
2012-05-01 18:01:06 -07:00
Noah Levitt 52d5307a9b Merge branch 'her-1948' 2012-04-20 12:33:19 -07:00
Noah Levitt 8d0a1678de * effective_tld_names.dat
update to latest from publicsuffix.org
2012-04-20 12:25:57 -07:00
Noah Levitt da28258f90 Option to set bdb cache size as an absolute number instead of a percentage (part of HER-1948) 2012-04-19 18:16:53 -07:00
Kenji Nagahashi 27d621f21a renamed PublicSuffixes2 to PublicSuffixes.
deleted debug println.
2012-04-18 10:14:51 -07:00
Kenji Nagahashi a0d52e6c17 PublicSuffixes2Test still had tests for PublicSuffix. fixed. 2012-04-18 10:14:51 -07:00
Kenji Nagahashi b2d62a81ff trial rewrite of PublicSuffixes for small memory footprint (no significant performance gain) 2012-04-18 10:14:50 -07:00
Noah Levitt 31df3a8f03 Merge branch 'master' into speculative-links 2012-04-13 18:16:08 -07:00
Noah Levitt 52703c6eb4 * ArchiveUtils.java
doubleToString() - return "NaN" for NaN (inf symbol didn't quite make sense to me)
2012-03-15 18:46:01 -07:00
Kenji Nagahashi adc82c1c6f Second round of HTML cleanup:
- added missing <html> and <body>
- fixed non-working CSS link, added CSS link to all pages
- replaced layout by <br> and &nbsp; with structural tags with CSS
- removed superfluous output, notably in BeanBrowseResource
- <code>-ify variable names in ScriptResource
- added special handling of NaN in doubleToString()
2012-03-03 00:46:56 -08:00
Noah Levitt db801b3e0f Fix problems handling crawl job paths with characters that require url-encoding, since we sometimes refer to them with file: urls
* PathSharingContext.java, CrawlJob.java
    use java.net.URI to convert paths to and from file: urls
2012-02-10 15:48:09 -08:00
Noah Levitt cfac7ead91 Fix for HER-1985 H3: SurtPrefixDecideRule forgets learned/seed-derived/seed-directive SURT prefixes in checkpoint-resume
* SurtPrefixedDecideRule.java
    make class implement Checkpointable, save surt prefixes to json on checkpoint and load them on recover
* profile-crawler-beans.cxml
    make main SurtPrefixedDecideRule a top-level bean so that it can be checkpointed
* Checkpoint.java, CheckpointService.java
    add some FINE level logging during checkpointing and recovery
2012-02-09 10:05:07 -08:00
Noah Levitt 9dbe673bc3 * UriUtils.java
some improvements to likely-uri detection based on crawl log analysis
2012-01-20 11:23:45 -08:00
Noah Levitt 803f9ca979 HER-1984 save script state - implement by adding a map to the application context for arbitrary use, and make sure the app context is available in all scripting environments
* PathSharingContext.java
    new member variable ConcurrentHashMap data and accessor getData()
* ScriptedProcessor.java, ScriptedDecideRule.java
    make appCtx available to scripts; also remove unused member sharedMap
* ActionDirectory.java
    formatting fix
2012-01-19 13:31:57 -08:00
Noah Levitt 995133dc40 Fix for HER-1962 NPE from missing sheet
* SheetOverlaysManager.java
    getOverlayMap(String) - return null if sheet missing instead of triggering npe
* KeyedProperties.java
    get(String) - check for null return value from getOverlayMap() and log warning
2011-10-27 10:40:30 -07:00
nlevitt 5735839252 Post 3.1.0
* **/pom.xml
   switch version to "3.1.1-SNAPSHOT"
2011-10-21 19:00:37 +00:00
nlevitt 8c99fc947c Prep for 3.1.0 release
* **/pom.xml
    bump version-id to "3.1.0"
* README.txt
    refer to exactly 3.1.0 release notes
2011-10-21 17:08:04 +00:00
nlevitt 32680b8f73 Fix for HER-1960 kryo buffer can hog memory, lead to oome (bug report, patch from Kenji)
* KryoBinding.java
    wrap ObjectBuffers with WeakReference so that can be garbage collected if necessary (when recreated they'll be back at the default size of 16k)
2011-10-20 02:21:54 +00:00
nlevitt 351a89c5a9 Fix java.lang.IllegalArgumentException from CharBuffer.allocate() in GenericReplayCharSequence.decode()
Reported by Kenji who says, "My guess is that root cause is Recorder.calcRecommendedCharBufferSize():
    return Math.min(inStream.getRecordedBufferLength()/2,(int)inStream.getSize());
    URL above returns HTML larger than 5GB (infinite smileys!! what the heck), and (int)intStream.getSize() became negative."
* Recorder.java
    -        return Math.min(inStream.getRecordedBufferLength()/2,(int)inStream.getSize());
    +        return (int) Math.min(inStream.getRecordedBufferLength()/2, inStream.getSize());
2011-10-13 15:47:02 +00:00
nlevitt a09c8e69b8 * Recorder.java
remove TODOs that have already been done
2011-10-12 17:52:45 +00:00
nlevitt c5de0048d1 "Fix" for HER-1951 ExtractorJS produces many false positives
* UriUtils.java
    isLikelyFalsePositive() - check for unusual characters, likely mimetypes, and a couple of other common traps
* UriUtilsTest.java
    add some tests for this code
2011-09-30 00:48:00 +00:00
nlevitt a577f1eb0b * PathSharingContext.java
start() - restore this override to call initLaunchDir() (how did I miss that), then super.start()
2011-09-29 23:12:26 +00:00
nlevitt 1390024902 * BdbModuleTest.java
testDoCheckpoint() - call BdbModule.destroy() in addition to stop() to close resources
2011-09-29 21:37:34 +00:00
nlevitt 747fbc0a0f Fix for HER-1954 bdb closed at crawl finish instead of teardown -- refactor crawl finish and teardown
* PathSharingContext.java
    start(), doStart(), stop(), doStop() - remove these overloaded methods, because the spring bug they were working around seems to be fixed, not seeing any problems with cyclical dependencies - might be this one https://jira.springsource.org/browse/SPR-7266
    doClose() - remove because superclass version seems to work fine (this method generally wasn't being called anyway, though it would be now with other changes in this checkin)
* CrawlJob.java
    refactor teardown to call close() on the ApplicationContext, which calls destroy() on any beans that implement DisposableBean - this is now the way to have beans do stuff at teardown
* CrawlController.java
    send FINISHED crawl state event after calling appCtx.stop() so that isFinished() can indicate ready-ness for teardown
* BdbModule.java
    move close() to teardown, i.e. implementation of DisposableBean.destroy(); remove shutdown hook and rely on teardown; related tweaks
* WorkQueueFrontier.java, CrawlerLoggerModule.java, BdbUriUniqFilter.java
    move close() to teardown
* CrawlMapper.java, AbstractFrontier.java, PreloadedUriPrecedencePolicy.java, FetchWhois.java, FetchHTTP.java, PersistLogProcessor.java, WriterPoolProcessor.java
    add comments about cleanup that maybe should wait until teardown
* UriUniqFilter.java
    remove incorrect(?) comment
2011-09-29 00:39:55 +00:00
nlevitt f20b3eee30 Fix HER-1935 Many calls to File.mkdirs() and other file/dir methods don't check the return value. Also fix bug where pointless empty directories were created in scratch dir.
* BasicProfileTest.java, SelfTestBase.java, CrawlControllerTest.java, PrecedenceLoader.java, MigrateH1to3Tool.java, CrawlerLoggerModule.java, StatisticsTracker.java, CheckpointUtils.java, BdbUriUniqFilter.java, ARCWriterProcessorTest.java, WARCWriterProcessorTest.java, PersistProcessor.java, WriterPoolProcessor.java, PrefixFinderTest.java, StoredQueueTest.java, FileUtilsTest.java, ObjectIdentityBdbManualCacheTest.java, ObjectIdentityBdbCacheTest.java, ObjectPlusFilesOutputStream.java, TestUtils.java, TmpDirTestCase.java, Engine.java
    Replace calls to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir). In these cases the calls were either already in a spot where the possible IOException would be handled appropriately, or the line was trivially moved into such a block.
* ActionDirectory.java, Engine.java
    replace calls to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir), and throw IllegalStateException on failure
* BdbModule.java
    setup() - replace call to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir) and add "throws IOException" - conveniently the place where this method is called was already in a try block that catches IOException
* Checkpoint.java
    generateFrom() - replace call to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir) and add "throws IOException"
* CheckpointService.java
    move call to Checkpoint.generateFrom() inside existing try block since it now can throw IOException
* Recorder.java
    ensure(File) - replace call to File.mkdirs() with FileUtils.ensureWriteableDirectory(dir), and throw IllegalStateException on failure
    new Recorder(File,String,int,int) - call ensure() on the correct object, the containing directory; and remove redundant call to ensure()
2011-09-12 20:12:10 +00:00
nlevitt f7cc187b09 * ANVLRecord.java
remove accidentally committed test code
2011-09-12 18:22:55 +00:00
nlevitt d2306fced6 Fix for HER-1934 ANVLRecord: clone() method does not call super.clone()
* ANVLRecord.java
    clone() - return (ANVLRecord) super.clone() - this does the right thing
2011-09-12 18:21:21 +00:00
nlevitt 0a28717500 Fix for HER-1922 ThreadLocalHttpConnectionManager: possible memory leak due to non-static inner class.
* ThreadLocalHttpConnectionManager.java
    make nested class ConnectionInfo static so it doesn't reference instance of containing class
2011-09-12 17:53:25 +00:00
nlevitt 40ff3affa3 * ObjectIdentityMemCache.java
fix mistake in r7240 - 'val.setIdentityCache()' was no longer being called the first time through, when the object comes from the 'supplier' (thanks Gordon)
2011-09-12 17:09:29 +00:00
nlevitt 24f4b715ec Various little cleanups including several discovered by Aaron using an automated tool.
* WorkQueueFrontier.java
   (HER-1925) avoid 2 possible null pointer dereferences
* CrawlController.java
    getState() - change declared return type from Object to State
* CrawlerLoggerModule.java
    (HER-1932) remove unused, unset field "reports"
* BdbCookieStorage.java
    elide pointless extra variable
* FetchHTTP.java, DownloadURLConnection.java, ProcessUtils.java
   (HER-1933) use Arrays.toString() for logged arrays
* CrawlServer.java
    - remove unused field robotstxtChecksum
    - updateRobots() - avoid reinventing existing utility class InstanceofPredicate
* ExternalGeoLookupInterface.java
    (HER-1938) extend Serializable, since ExternalGeoLocationDecideRule is declared Serializable and has a ExternalGeoLookupInterface field
* DecideRuleSequence.java
    (HER-1937) make field fileLogger transient
* PersistLogProcessor.java
    (HER-1924) remove field recoveryCheckpoint shadowing same field in superclass Processor
* ExtractorUniversal.java
    (HER-1920) use return value of potentialTLD.toLowerCase() as it appears was intended
* ARCWriterProcessor.java
    (HER-1928) avoid possible null pointer dereference
* S3URLConnection.java
    (HER-1933) set S3ServiceException as cause of rethrown IOException, and do not put stacktrace array in message
* ObjectIdentityMemCache.java
    (HER-1929) avoid possible null pointer dereference
* .classpath
    more source jar references, other cleanup
2011-09-12 02:12:44 +00:00
nlevitt 794c41ebd3 Patch from Kenji to fix "weird 'NoSuchElement' exception retrieving XML response from H3 web interface. It appeared to be concurrency related.... Probably Histotable was accessed concurrently from my JMX interface and web interface and it left Histotable in an inconsistent state. Much less likely without JMX monitoring, but it could also happen with H3 without JMX" (Kenji)
* Histotable.java
    make tally(K,long) synchronized
2011-09-01 21:04:56 +00:00
nlevitt e6de9cd96b * Sheet.java
prime() - fix exception triggered in process of handling earlier real exception, which was masking the real exception - see http://tech.groups.yahoo.com/group/archive-crawler/message/7303
2011-08-30 22:41:37 +00:00
nlevitt 28aa2ffede * **/pom.xml
improve formatting (no substantive changes at all -- try "svn diff -x -ub -c7232")
2011-08-05 17:46:57 +00:00
nlevitt 62e1c835dd Fix HER-1913 cookies not being sent
* CookieSpecBase.java
    match(String, int, String, boolean, SortedMap) - use InternetDomainName.name() instead of .toString(), since the latter doesn't return the plain old domain name
* Cookie.java
    javadoc typo
2011-07-26 19:07:26 +00:00
nlevitt cb7a454d0c Post 3.1.0-RC1
* **/pom.xml
   switch version back to "3.1.0-SNAPSHOT"
2011-07-26 03:42:02 +00:00