OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from appengine_wrappers import CACHE_TIMEOUT | 5 from appengine_wrappers import CACHE_TIMEOUT |
6 from future import Future | 6 from future import Future |
7 | 7 |
8 BRANCH_UTILITY = 'BranchUtility' | 8 BRANCH_UTILITY = 'BranchUtility' |
9 FILE_SYSTEM_CACHE = 'CompiledFileSystem' | 9 FILE_SYSTEM_CACHE = 'CompiledFileSystem' |
10 FILE_SYSTEM_CACHE_LISTING = 'CompiledFileSystemListing' | 10 FILE_SYSTEM_CACHE_LISTING = 'CompiledFileSystemListing' |
11 FILE_SYSTEM_READ = 'Read' | 11 FILE_SYSTEM_READ = 'Read' |
12 FILE_SYSTEM_STAT = 'Stat' | 12 FILE_SYSTEM_STAT = 'Stat' |
13 GITHUB_STAT = 'GithubStat' | 13 GITHUB_STAT = 'GithubStat' |
14 KNOWN_ISSUES = 'KnownIssues' | 14 KNOWN_ISSUES = 'KnownIssues' |
15 REFERENCE_RESOLVER = 'ReferenceResolver' | 15 REFERENCE_RESOLVER = 'ReferenceResolver' |
| 16 CHROME_VERSION_DATA_SOURCE = 'ChromeVersionDataSource' |
| 17 AVAILABILITY_DATA_SOURCE = 'AvailabilityDataSource' |
16 | 18 |
17 class _SingleGetFuture(object): | 19 class _SingleGetFuture(object): |
18 def __init__(self, multi_get, key): | 20 def __init__(self, multi_get, key): |
19 self._future = multi_get | 21 self._future = multi_get |
20 self._key = key | 22 self._key = key |
21 | 23 |
22 def Get(self): | 24 def Get(self): |
23 return self._future.Get()[self._key] | 25 return self._future.Get()[self._key] |
24 | 26 |
25 class ObjectStore(object): | 27 class ObjectStore(object): |
(...skipping 21 matching lines...) Expand all Loading... |
47 def GetMulti(self, keys, namespace, time=CACHE_TIMEOUT): | 49 def GetMulti(self, keys, namespace, time=CACHE_TIMEOUT): |
48 """Gets a |Future| with values mapped to |keys| from the object store, with | 50 """Gets a |Future| with values mapped to |keys| from the object store, with |
49 any keys not in the object store mapped to None. | 51 any keys not in the object store mapped to None. |
50 """ | 52 """ |
51 raise NotImplementedError() | 53 raise NotImplementedError() |
52 | 54 |
53 def Delete(self, key, namespace): | 55 def Delete(self, key, namespace): |
54 """Deletes a key from the object store. | 56 """Deletes a key from the object store. |
55 """ | 57 """ |
56 raise NotImplementedError() | 58 raise NotImplementedError() |
OLD | NEW |