1. 10 Dec, 2002 1 commit
  2. 09 Dec, 2002 2 commits
    • Casey Duncan's avatar
      Remove import added for testing · 471b053f
      Casey Duncan authored
      471b053f
    • Casey Duncan's avatar
      More sorting improvements: · e45028f3
      Casey Duncan authored
      * Changed logic for activating first sort algorithm to elminate bad performance with large result sets (20k+). The full sort is now faster for a larger proportion of cases. This algorithm is also skipped now if a sort limit value is passed.
      
      * Full sort now handles sort limits where the limit is 25% or greater of the total result where N-Best performance degrades. This allows the application to always apply a sort limit up to and beyond the result set length.
      
      * Added an "N-worst" sort handler to deal with forward sort limits (previously only reverse limits worked properly).
      
      * Small optimizations to N-best/worst to wring out a few more CPU cycles.
      e45028f3
  3. 06 Dec, 2002 10 commits
    • Barry Warsaw's avatar
      BerkeleyConfig.__repr__(): Dumb little thing which helps to know how · d4ce5d0c
      Barry Warsaw authored
      it's configured when you see it in the log files.
      d4ce5d0c
    • Casey Duncan's avatar
      Changes to non-merged results returned by search: · 7eab805a
      Casey Duncan authored
      * For unsorted sets, merged and non-merged results are identical (lazy results)
      
      * For sorted sets, merged results are lazy and non-merged are lists of three tuples that can later be merged and sorted using mergeResults
      
      The mergeResults function has been simplified greatly and now simply accepts a list of result sets in its first argument.
      7eab805a
    • Barry Warsaw's avatar
      Cosmetic · d67a753e
      Barry Warsaw authored
      d67a753e
    • Barry Warsaw's avatar
      _RecordsIterator.__init__(): Port transaction extension fix from · 63fe89cd
      Barry Warsaw authored
      ZODB4.  We need to return the unpickled extension data.
      63fe89cd
    • Barry Warsaw's avatar
      Bump the version number · 36c6b8f1
      Barry Warsaw authored
      36c6b8f1
    • Barry Warsaw's avatar
      Simplify again the WorkThread api. Don't use a non-portable poll · f595bdbf
      Barry Warsaw authored
      object -- because we just care about one event we can simply use a
      threading.Event object.  Specific changes include,
      
      BerkeleyBase.py
      
          __init__(): Simplify the creation of the checkpointer and
          autopacker worker threads.
      
          close(): Replace autopacker.stop() with setting the Event object.
          This both kicks us out of the wait() and sets the thread's
          internal stop flag, so it's all we need.
      
          _WorkThread.init(): Take the `name' argument out of the
          constructor.  It was the only thing that 2/3rds of the subclasses
          needed to override, so just stick it in a class attribute.
      
          run(): Simplify to use the Event object.  Also, change _nextcheck
          to recalculate `now' after the work is done.  There's no telling
          how much time the work will take (it may not matter much in
          practice).
      
          stop(): Removed.
      
          _Checkpoint.__init__(): Removed
      
      Full.py
      
          _make_autopacker(): Updated
      
          _Autopack.__init__(): Updated
      
      Minimal.py
      
          _make_autopacker(): Updated
      
          _Autopack.__init__(): Removed
      f595bdbf
    • Jeremy Hylton's avatar
      Statement appears to have no effect. · 6fd17cc8
      Jeremy Hylton authored
      6fd17cc8
    • Jeremy Hylton's avatar
      Add missing import. Caught by pychecker. · 97dc2306
      Jeremy Hylton authored
      97dc2306
    • Barry Warsaw's avatar
      OpenRecoveryTest: New test for recovering from problems passing in a · bd066aff
      Barry Warsaw authored
      bogus config object.
      bd066aff
    • Barry Warsaw's avatar
      Rework the background threads to be poll-with-timeout based instead of · 6e8fbfb4
      Barry Warsaw authored
      sleep based.  We create two ends of a pipe in the parent thread, with
      the child thread polling/reading one end and the parent writing to the
      other.  The only thing written to this pipe is a "stop marker" -- just
      a string that wakes the thread up immediately when we're closing the
      storage.
      
      The primary reason for this is to speed up shutdown so that we don't
      have to wait for the next tick of the sleep counter before we'll
      trigger the thread shutdown.  Makes shutting down Zope using this
      storage much quicker.
      
      Specific changes include:
      
      BerkeleyBase.py
      
          SLEEP_TIME -> JOIN_TIME since it's now just the interval we'll
          wait for the thread.join to complete.
      
          __init__():	Create both the checkpointer thread and the autopacker
          thread, set up the pipes, and get them both rolling.  We refactor
          creation of the autopacker instance into a separate overrideable
          method since this is the one bit that's different between the two
          storages.
      
          _make_autopacker(): Intended to be overridden.
      
          close(), _doclose(): Move the thread shutdown code out of the
          lock, since we don't want to potentially deadlock the shutting
          down of the background thread.  This could happen if close() was
          entered when the autopacker thread was between lock acquisitions
          in _dopack().  Also, be sure to write to the pipe to wake the
          child threads up immediately.
      
          env_from_string(): Wrap the actual creation and opening of the
          environment in a try/except, so that if there's a failure, we can
          be sure to give up the file lock.
      
          _WorkThread class: Accept a poll object which wraps the read end
          of the pipe.  Rework run() to do the poll-with-timeout instead of
          sleep.  I don't think we strictly need to do the fd read given the
          simplicity (and mono-commandity) of the protocol, but it can't
          hurt.  The _dowork() method's signature no longer contains the
          `now' variable.
      
      Full.py
      
          _make_autopacker(): Override base class to return storage specific
          _Autopack instance.
      
      Minimal.py
      
          Same, but also include some code cleanup.
      
      
      Also, get rid of some unnecessary imports.
      6e8fbfb4
  4. 05 Dec, 2002 3 commits
    • Casey Duncan's avatar
      Merging pluginindex cleanup into the head · 680fb65b
      Casey Duncan authored
      680fb65b
    • Casey Duncan's avatar
      Major refactor of the catalog search engine centered around optimizing sort by... · 2167f3f6
      Casey Duncan authored
      Major refactor of the catalog search engine centered around optimizing sort by index operations. The resulting code greatly outperforms the previous version and uses less memory.
      
      Exposed a new ZCatalog method "search" which has a better interface for programmatic searches. Updated documentation as well.
      
      Implemented a sort limit option which allows you to inform the catalog that you are only interested in a certain number of results. In the common case this allows the ZCatalog machinery to use a different sorting algorithm (N-Best) which scales much better then a full sort.
      
      Also more tightly integrated the merge option which allows you to tell the catalog that you would like raw and unsorted intermediate results returned rather than sorted and lazified results. This can be used to efficiently merge search results across multiple catalogs.
      2167f3f6
    • Barry Warsaw's avatar
      0f4c1093
  5. 04 Dec, 2002 1 commit
  6. 03 Dec, 2002 4 commits
    • Guido van Rossum's avatar
      Fix a bug in unindexing removed messages (it was iterating over a lazy · 0fe8faf6
      Guido van Rossum authored
      list that was being modified as we went).
      [Backport from Zope3; I'm not actually sure if the list returned by
      **Btree.keys() is lazy, but I assume it is.]
      0fe8faf6
    • Barry Warsaw's avatar
      _setupDB(): Port to BerkeleyDB 4.1, and pybsddb 4.1 (experimental): · 0c9da1d4
      Barry Warsaw authored
              # DB 4.1.24 requires that operations happening in a transaction must
              # be performed on a database that was opened in a transaction.  Since
              # we do the former, we must do the latter.  However, earlier DB
              # versions don't transactionally protect database open, so this is the
              # most portable way to write the code.
      
      i.e. we use the DB_AUTO_COMMIT flag for the open, if it's defined.
      0c9da1d4
    • Barry Warsaw's avatar
      Ported to pybsddb 4.1 (experimental), these changes are actually the · 0d4d91f1
      Barry Warsaw authored
      right thing to do anyway, and should work just find for earlier
      versions of the wrapper.  Specifically,
      
      _dorecovery(), _collect_objs(), _mark(): transactionally protect
      .truncate() and .consume()
      
      _docommit(): Move the setting of the _pending flag to here from
      _finish() so we can transactionally protect it more conveniently.
      This does't change the semantics and the recovery code in _setupDBs()
      doesn't care since the flag will already be set to COMMIT.
      0d4d91f1
    • Barry Warsaw's avatar
      Ported to pybsddb 4.1 (experimental), these changes are actually the · 86e7e1c5
      Barry Warsaw authored
      right thing to do anyway, and should work just find for earlier
      versions of the wrapper.  Specifically,
      
      _doabort(), _docommit(), _mark(), _sweep(), _collect_objs():
      Transactionally protect .truncate() and .consume()
      
      _docommit(): Move the setting of the _pending flag to here from
      _finish() so we can transactionally protect it more conveniently.
      This does't change the semantics and the recovery code in _setupDBs()
      doesn't care since the flag will already be set to COMMIT.
      
      _begin(): Transactionally protect the setting of the _pending flag to
      ABORT.
      86e7e1c5
  7. 02 Dec, 2002 2 commits
  8. 30 Nov, 2002 2 commits
  9. 28 Nov, 2002 4 commits
  10. 27 Nov, 2002 2 commits
  11. 26 Nov, 2002 4 commits
  12. 25 Nov, 2002 3 commits
  13. 24 Nov, 2002 2 commits