|
| root_path |
|
| last_history_size |
|
|
| index_yaml_is_manual = False |
|
| index_yaml_mtime = None |
|
int | last_history_size = 0 |
|
Helper class for updating index.yaml.
This class maintains some state about the query history and the
index.yaml file in order to minimize the number of times index.yaml
is actually overwritten.
def google.appengine.datastore.datastore_stub_index.IndexYamlUpdater.__init__ |
( |
|
self, |
|
|
|
root_path |
|
) |
| |
Constructor.
Args:
root_path: Path to the app's root directory.
def google.appengine.datastore.datastore_stub_index.IndexYamlUpdater.UpdateIndexYaml |
( |
|
self, |
|
|
|
openfile = open |
|
) |
| |
Update index.yaml.
Args:
openfile: Used for dependency injection.
We only ever write to index.yaml if either:
- it doesn't exist yet; or
- it contains an 'AUTOGENERATED' comment.
All indexes *before* the AUTOGENERATED comment will be written
back unchanged. All indexes *after* the AUTOGENERATED comment
will be updated with the latest query counts (query counts are
reset by --clear_datastore). Indexes that aren't yet in the file
will be appended to the AUTOGENERATED section.
We keep track of some data in order to avoid doing repetitive work:
- if index.yaml is fully manual, we keep track of its mtime to
avoid parsing it over and over;
- we keep track of the number of keys in the history dict since
the last time we updated index.yaml (or decided there was
nothing to update).
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/datastore/datastore_stub_index.py