Commit Graph
243 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
gojomo 722a8549ab [HER-1821] H3: implement hard-link-based BDB/state-dir checkpointing
* BdbModule.java
    new setting, useHardLinkCheckpoints, default true
    doCheckpoint now creates hard-links to active log files from the in-environment checkpoint-dir
    doRecover now relinks from checkpoint-dir files, when available, in preference to whatever is already in the env-dir
* pom.xml
    bring in JNA for native calls
* CLibrary
    wrapper for the link() function
2011-04-12 00:09:51 +00:00
gojomo 6388dc7605 [HER-1878] NullPointerException when parsing (some?) WARC files over slow connections
* GZIPMembersInputStream
    override OpenJDK7GZIPInputStream.readTrailer to not rely on available() as indicator of end-of-stream
    fix membersIterator hasNext() to also not rely on available() as indicator of end-of-stream
* ArchiveReader
    change innerHasNext to peek one byte (using mark/reset) rather than rely on available() as indicator of end-of-stream
    remove redundant getInputStream accessor in favor of field-name-matching getIn/setIn
* ArchiveReaderFactory, (W)ARCReaderFactory
    remove no-longer-necessary RepositionableStream references
    use getIn() rather than getInputStream()
2011-04-11 22:58:05 +00:00
gojomo 3a53da1073 adapted tests for other changes 2011-04-06 20:52:06 +00:00
gojomo e29e7dd36a comment typo 2011-04-06 20:51:40 +00:00
gojomo 9f3b8d11db * ReplayInputStream
constructor comment about using destroy()
2011-04-06 20:51:14 +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
gojomo 3f98fc248b * ArchiveUtils
(readFully) return actual number of bytes read into array
* FileUtils
    (readFullyToFile) simplify; also return total bytes read
2011-04-06 20:22:30 +00:00
gojomo 1395854f9a [HER-1865] JDK6u23 breaks GzippedInputStream & W/ARCReaders with different GZIP handling
* OpenJDK7GZIPInputStream.java, OpenJDK7InflatedInputStream.java
    backport the working GZIP implementation from OpenJDK7, with minimal 
    renames/imports/private-to-protected changes to enable member-at-a-time reading
* GZIPMembersInputStream
    base on OpenJDK7 implementation to avoid pre- & post-6u23 codepaths, and 6u23/24 readHeader bug
    override readTrailer to set member-end; update comment to reflect end-uncertainty without EOF-per-member-mode
* GZIPMembersInputStreamTest, ARCWriterTest
    test tweaks
2011-03-30 02:42:26 +00:00
gojomo 3fc3d324e8 * ArchiveReaderFactory
avoid misinterpreting a "c:" local path as a URI scheme
2011-02-26 01:04:26 +00:00
gojomo 2f9a8b860d * GZIPMembersInputStream
ensure mark()ing more frequently, when reset to before current position won't be needed
* ArchiveReaderFactory
    avoid misinterpreting a "c:" local path as a URI scheme
2011-02-26 00:59:10 +00:00
gojomo fe5363feb0 * GzipMembersInputStreamTest
test with 6 small members
2011-02-24 22:13:46 +00:00
gojomo 9fef4f1f26 * ArchiveReader
better logging of caught/recovery-attempted IOException
* GZIPMemberInputStream
    handling of previously-unrecognized case in pre-JDK6u23: attempt at read() exhausts inflater with no new bytes available (previous nonzero-length read had not indicated inflater finished)
2011-02-24 19:22:50 +00:00
gojomo bb07080e02 [HER-1865] JDK6u23 breaks GzippedInputStream & W/ARCReaders with different GZIP handling
* ArchiveReaderFactoryTest
    test cases for generic reader-get methods -- one of which had obsolete STREAM_ALL=-1 problem
2011-02-23 01:09:05 +00:00
gojomo c6a94c2264 [HER-1865] JDK6u23 breaks GzippedInputStream & W/ARCReaders with different GZIP handling
* ArchiveReaderFactory
    discard obsolete -1 flag value creating problems with usual uses
2011-02-23 00:24:47 +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
gojomo a6f3b7db25 * ARCWriterTest
test inspired by Erik Hetzner's HER-1865 test code
2011-02-19 00:35:09 +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 885a25c90c Robustify based on JUnit issues on Windows
* ArchiveReader
    improve warning message
* WriterPoolMember
    attempt pre-delete of target filename, warn on failure, for better odds on some filesystems
* ARCWriterTest, WARCWriterTest
    ensure timely close of readers/writers in case filenames are reused
    restore originally-intended unique target names
2011-02-17 01:21:48 +00:00
gojomo 9d588b9978 implement Closeable 2011-02-17 01:17:35 +00:00
gojomo b86f0afc83 * TopNSet
resolve strange type complaint in my Windows Eclipse JDK6u24 setup
2011-02-17 01:14:32 +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 5de965590c Update Guava library to r08
* .classpath, commons/pom.xml
    update reference
* ObjectIdentityBdbManualCache
    use new maximumSize() option on dirtyItems map
2011-02-16 01:15:13 +00:00
gojomo 9b78770027 [HER-1865] JDK6u23 breaks GzippedInputStream & W/ARCReaders with different GZIP handling
* GZIPMembersInputStream
    new workaround class that offers choice of pre/post JDK6u23 behavior and new accessors for finding member boundary offsets
* GZIPMembersInputStreamTest
    test for above
* ArchiveUtils, ARCWriter
    move static compress utilities to ArchiveUtils
* ArchiveReader, (W)ARCReaderFactory, (W)ARCWriterTest
    adapt to use GZIPMembersInputStream
* GzippedInputStream(Test)
    deleted
2011-02-16 01:12:25 +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
nlevitt a6fd015f6b * commons/pom.xml
fix inconsistent line endings (remove ^M's) - a trivial change to poke
    continuum which is truncating this file
2011-01-28 02:04:55 +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 f0f8aeb9b9 * WARCWriter
remove that pesky reference to a 'modules' class (usu. available in dev setup, but not in ordered formal builds)
2011-01-19 01:25:42 +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
nlevitt 799e0d9ff8 Remove errant import that eclipse added to satisfy a javadoc reference, but that breaks build 2011-01-17 23:06:11 +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 ded64befb5 W/ARCWriter-related refactoring
* WriterPoolSettingsData
    useful defaults for frequentFlushes and writeBufferSize
2011-01-15 02:43:08 +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 c5717f80d4 * DisposableStoredSortedMap
better class comment, error handling
2011-01-14 22:09:21 +00:00
gojomo df1d064598 * StoredQueue.java
protect isEmpty() like size() for access after backing BDB closed
2011-01-14 22:07:01 +00:00
nlevitt 898689ab38 * WriterPoolMember.java
restore void return value of write(*) methods
* WriterPoolMember.java
    do not expect return from write(*) methods
2011-01-12 08:38:56 +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
gojomo 9e75ff0019 * GenerationFileHandler
disable flush-minimizing optimization until its effect on watching logs in web UI can be minimized
2011-01-12 00:18:28 +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
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 e3181ffd37 * StoredQueue.java
simplify to reduce synchronization intricacy; possibly reduce contention
2010-12-03 01:29:49 +00:00
gojomo a5256f38ee * commons/pom.xml
dependency on guava java libraries
2010-12-03 00:59:32 +00:00
gojomo 72682be382 * org.apache.commons.httpclient.util.EncodingUtil
added in prep for Chaset synchronization bottleneck workarounds
2010-11-23 02:00:38 +00:00
gojomo 04656f56c8 More synchronization-bottleneck-minimizing
* GenerationFileHandler
    override flush to only flush 1/100th of the time
2010-11-16 02:03:55 +00:00
gojomo 881c829fe5 Checkpoint fixes/improvements
* BdbModule
    store lengths in JDB manifest; limit extension of last JDB on recover
* CrawlerJournal
    rotate frontier-recover on checkpoints like other logs
2010-11-15 22:37:58 +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 9fb8374b67 * ObjectIdentityBdbCache
comment-out debug output
2010-11-15 21:05:29 +00:00
gojomo f2edeea28b * StoredQueue.java
added debugging info and possible fix for occasionally-seen peek-timing issue
2010-11-15 21:03:15 +00:00