@Test public void removeTrackedQuery() { TrackedQueryManager manager = newManager(); manager.setQueryActive(SAMPLE_FOO_QUERY); assertNotNull(manager.findTrackedQuery(SAMPLE_FOO_QUERY)); manager.removeTrackedQuery(SAMPLE_FOO_QUERY); assertNull(manager.findTrackedQuery(SAMPLE_FOO_QUERY)); manager.verifyCache(); }
public void removeTrackedQuery(QuerySpec query) { query = normalizeQuery(query); TrackedQuery trackedQuery = findTrackedQuery(query); hardAssert(trackedQuery != null, "Query must exist to be removed."); this.storageLayer.deleteTrackedQuery(trackedQuery.id); Map<QueryParams, TrackedQuery> trackedQueries = this.trackedQueryTree.get(query.getPath()); trackedQueries.remove(query.getParams()); if (trackedQueries.isEmpty()) { this.trackedQueryTree = this.trackedQueryTree.remove(query.getPath()); } }
TrackedQueryManager { public void removeTrackedQuery(QuerySpec query) { query = normalizeQuery(query); TrackedQuery trackedQuery = findTrackedQuery(query); hardAssert(trackedQuery != null, "Query must exist to be removed."); this.storageLayer.deleteTrackedQuery(trackedQuery.id); Map<QueryParams, TrackedQuery> trackedQueries = this.trackedQueryTree.get(query.getPath()); trackedQueries.remove(query.getParams()); if (trackedQueries.isEmpty()) { this.trackedQueryTree = this.trackedQueryTree.remove(query.getPath()); } } }
TrackedQueryManager { public void removeTrackedQuery(QuerySpec query) { query = normalizeQuery(query); TrackedQuery trackedQuery = findTrackedQuery(query); hardAssert(trackedQuery != null, "Query must exist to be removed."); this.storageLayer.deleteTrackedQuery(trackedQuery.id); Map<QueryParams, TrackedQuery> trackedQueries = this.trackedQueryTree.get(query.getPath()); trackedQueries.remove(query.getParams()); if (trackedQueries.isEmpty()) { this.trackedQueryTree = this.trackedQueryTree.remove(query.getPath()); } } TrackedQueryManager(
      PersistenceStorageEngine storageLayer, LogWrapper logger, Clock clock); }
TrackedQueryManager { public void removeTrackedQuery(QuerySpec query) { query = normalizeQuery(query); TrackedQuery trackedQuery = findTrackedQuery(query); hardAssert(trackedQuery != null, "Query must exist to be removed."); this.storageLayer.deleteTrackedQuery(trackedQuery.id); Map<QueryParams, TrackedQuery> trackedQueries = this.trackedQueryTree.get(query.getPath()); trackedQueries.remove(query.getParams()); if (trackedQueries.isEmpty()) { this.trackedQueryTree = this.trackedQueryTree.remove(query.getPath()); } } TrackedQueryManager(
      PersistenceStorageEngine storageLayer, LogWrapper logger, Clock clock); TrackedQuery findTrackedQuery(QuerySpec query); void removeTrackedQuery(QuerySpec query); void setQueryActive(QuerySpec query); void setQueryInactive(QuerySpec query); void setQueryCompleteIfExists(QuerySpec query); void setQueriesComplete(Path path); boolean isQueryComplete(QuerySpec query); PruneForest pruneOldQueries(CachePolicy cachePolicy); Set<ChildKey> getKnownCompleteChildren(Path path); void ensureCompleteTrackedQuery(Path path); boolean hasActiveDefaultQuery(Path path); long countOfPrunableQueries(); }
TrackedQueryManager { public void removeTrackedQuery(QuerySpec query) { query = normalizeQuery(query); TrackedQuery trackedQuery = findTrackedQuery(query); hardAssert(trackedQuery != null, "Query must exist to be removed."); this.storageLayer.deleteTrackedQuery(trackedQuery.id); Map<QueryParams, TrackedQuery> trackedQueries = this.trackedQueryTree.get(query.getPath()); trackedQueries.remove(query.getParams()); if (trackedQueries.isEmpty()) { this.trackedQueryTree = this.trackedQueryTree.remove(query.getPath()); } } TrackedQueryManager(
      PersistenceStorageEngine storageLayer, LogWrapper logger, Clock clock); TrackedQuery findTrackedQuery(QuerySpec query); void removeTrackedQuery(QuerySpec query); void setQueryActive(QuerySpec query); void setQueryInactive(QuerySpec query); void setQueryCompleteIfExists(QuerySpec query); void setQueriesComplete(Path path); boolean isQueryComplete(QuerySpec query); PruneForest pruneOldQueries(CachePolicy cachePolicy); Set<ChildKey> getKnownCompleteChildren(Path path); void ensureCompleteTrackedQuery(Path path); boolean hasActiveDefaultQuery(Path path); long countOfPrunableQueries();  }