Changeset 2138 for trunk/sources
- Timestamp:
- 07/06/09 19:53:43 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.DB/3.3/Store.cs
r2137 r2138 41 41 private SemWeb.Store store; 42 42 private object bigLock = new object(); 43 private SemWeb.Store cachedStore; 44 43 45 public Store(string connectionString) { 44 46 lock (bigLock) { … … 75 77 SemWeb.N3Reader n3Reader = new SemWeb.N3Reader(new StringReader(query)); 76 78 SemWeb.Query.GraphMatch matcher = new SemWeb.Query.GraphMatch(n3Reader); 77 if ( memStore == null) {79 if (cachedStore == null) { 78 80 CacheStore(); 79 81 } 80 matcher.Run( memStore, resultSink);82 matcher.Run(cachedStore, resultSink); 81 83 return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList(); 82 84 } 83 85 } 84 86 85 SemWeb.Store memStore;86 87 private void CacheStore() { 87 memStore = new SemWeb.MemoryStore();88 memStore.Import(store);88 cachedStore = new SemWeb.MemoryStore(); 89 cachedStore.Import(store); 89 90 } 90 91 … … 92 93 lock (bigLock) { 93 94 MyQueryResultSink resultSink = new MyQueryResultSink(); 94 if ( memStore == null) {95 if (cachedStore == null) { 95 96 CacheStore(); 96 97 } 97 Translate(query).Run( memStore, resultSink);98 Translate(query).Run(cachedStore, resultSink); 98 99 return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList(); 99 100 }
Note: See TracChangeset
for help on using the changeset viewer.