~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-23 19:35:38 UTC
  • mto: This revision was merged to the branch mainline in revision 4187.
  • Revision ID: john@arbash-meinel.com-20090323193538-3d01aetz07jsyd3w
Add 'combine_backing_indices' as a flag for GraphIndex.set_optimize().

Update the Packer code so that it sets combine_backing_indices=False, as we know that
we won't be making extra queries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        # Indicate it hasn't been built yet
141
141
        self._nodes_by_key = None
142
142
        self._optimize_for_size = False
143
 
        self._combine_spilled_indices = True
144
143
 
145
144
    def add_node(self, key, value, references=()):
146
145
        """Add a node to the index.
181
180
        combine mem with the first and second indexes, creating a new one of
182
181
        size 4x. On the fifth create a single new one, etc.
183
182
        """
184
 
        if self._combine_spilled_indices:
 
183
        if self._combine_backing_indices:
185
184
            (new_backing_file, size,
186
185
             backing_pos) = self._spill_mem_keys_and_combine()
187
186
        else:
193
192
                                      base_name, size)
194
193
        # GC will clean up the file
195
194
        new_backing._file = new_backing_file
196
 
        if self._combine_spilled_indices:
 
195
        if self._combine_backing_indices:
197
196
            if len(self._backing_indices) == backing_pos:
198
197
                self._backing_indices.append(None)
199
198
            self._backing_indices[backing_pos] = new_backing